User Tag List

Results 1 to 10 of 10

Thread: Not again! (More Script Problems!)

  1. #1
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,277
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.99%

    Not again! (More Script Problems!)

    Sigh.... First off, someone PLEASE tell me the rules on double-posting here. -_-

    My new problem is this one little error message:

    "Cannot cast from Bool to Float!"

    It comes up whenever I try to compile this script:
    Code:
    // Harp of Ages: Yes, it's true! If you have certain items, this Harp will do different things!
    // Changable Variables:
    // ID1- ID of the item you wish to be the Tune of Echoes, the first Harp tune. Use std.zh for the IDs.
    // ID2- ID of the item you wish to be the Tune of Currents, the second Harp tune. See above.
    // ID3- ID of the item you wish to be the Tune of Ages, the final Harp tune. Also see the first.
    // DrmntTmeHle- Combo used by the Dormant/Sleeping Time Hole (Before using Tune of Echoes).
    // OpnTmeHle- Combo used by the Open/Awakened Time Hole (After using Tune of Echoes).
    // Note: Due to limitations... IF YOU AWAKEN A TIME PORTAL, USE IT. If you leave the screen after awakening one and come back, if you use the Tune
    // of Echoes again, you MUST leave the screen, come back, and do it AGAIN! Otherwise, you'll go to the wrong place... >_<
    
    import "std.zh"
    item script HarpofAges
    {
    	int CurMap = 0;
    	int CurDMap = 0;
    	int CurScrn = 0;
    	int LastMap = 0;
    	int LastDMap = 0;
    	int LastScrn = 0;
    	int WrpMap = 0;
    	int WrpDMap = 0;
    	int WrpScrn = 0;
    	int WrpMap2 = 0;
    	int WrpDMap2 = 0;
    	int WrpScrn2 = 0;
    	int ID1 = 46;
    	int ID2 = 47;
    	int ID3 = 0;
    	int DrmntTmeHle = 0;
    	int OpnTmeHle = 0;
    	int Time = 1;
    	int TimeCheck1 = 1;
    	int TimeCheck2 = 0;
    	int FFCLocation = 0;
    
    	void run()
    	{
    		CurMap = Game->GetCurMap();
    		CurDMap = Game->GetCurDMap();
    		CurScrn = Game->GetCurScreen();
    		WrpMap = CurMap + 1;
    		WrpDMap = CurDMap + 1;
    		WrpScrn = CurScrn;
    		WrpMap2 = CurMap - 1;
    		WrpDMap2 = CurDMap - 1;
    		WrpScrn2 = CurScrn;
    		if (Link->Item[16] == true)
    		{
    			if (CurMap == 2 || CurMap == 4 || CurMap == 6 || CurMap == 8 || CurMap == 10)
    			{
    				Time = 0;
    				Link->PitWarp(WrpDMap2, WrpScrn2);
    				Quit();
    			}
    			else if (CurMap == 1 || CurMap == 3 || CurMap == 5 || CurMap == 7 || CurMap == 9)
    			{
    				Time = 1;
    				Link->PitWarp(WrpDMap, WrpScrn);
    				Quit();
    			}
    		}
    		else if (Link->Item[47] == true)
    		{
    			if (CurMap == 2 || CurMap == 4 || CurMap == 6 || CurMap == 8 || CurMap == 10)
    			{
    				Time = 0;
    				Link->PitWarp(WrpDMap2, WrpScrn2);
    				Quit();
    			}
    			else if (CurMap == 1 || CurMap == 3 || CurMap == 5 || CurMap == 7 || CurMap == 9)
    			{
    				Time = 1;
    			}
    		}
    		else if (Link->Item[46] == true)
    		{
    			ffc FFCLocation = Screen->LoadFFC(32);
    			FFCLocation = (FFCLocation->X) + (FFCLocation->Y);
    			if (Screen->ComboD [FFCLocation] == DrmntTmeHle)
    			{
    				Screen->ComboD [FFCLocation] = OpnTmeHle;
    			}
    		}
    	}
    }
    Every time it reaches one of the checks for if Link has an item or not... It gives me that error. I HAVE to find out how to check if Link has a certain item or not, or this script won't exactly work right.... I know I could make it work without the item checks, but...

  2. #2
    Gibdo
    Join Date
    Mar 2004
    Age
    40
    Posts
    910
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    3,249
    Level
    18
    vBActivity - Bars
    Lv. Percent
    36.63%

    Re: Not again! (More Script Problems!)

    You're not double posting. Double posting means posting a topic and replying yourself with the same username.

  3. #3
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,277
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.99%

    Re: Not again! (More Script Problems!)

    Quote Originally Posted by cbailey78 View Post
    You're not double posting. Double posting means posting a topic and replying yourself with the same username.
    -_- Wow. Thanks for being SO off-topic. I wasn't asking if I was double-posting here. I was asking for the rules on double-posting. Like, how long must I wait before it's okay (if it ever is)?

    Back to the thread itself, does anyone have any idea why beta 16c gives me that compiler error?

  4. #4
    Wizrobe The_Amaster's Avatar
    Join Date
    Dec 2005
    Location
    St. Mystere
    Age
    32
    Posts
    3,803
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,811
    Level
    28
    vBActivity - Bars
    Lv. Percent
    26.14%

    Re: Not again! (More Script Problems!)

    This could just be an overall 16c error. Remember when I was trying to import your Shovel and Cane of Somaria scripts, I got a similar error.

  5. #5
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.55%

    Re: Not again! (More Script Problems!)

    I think what might be going on is that == only works on ints. Instead of
    Code:
    if(foo == true)
    try
    Code:
    if(foo)
    This behavior is not intended though, and if == still doesn't work for bools in the latest alpha, please post a bug report and I'll investigate.

    Oh, and as for double posting, AGN rules forbid it universally. I personally have no problems with it, as long as the new post contains genuine new information, so you could say that double-posting in here is decriminalized if not legal.

  6. #6
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,277
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.99%

    Re: Not again! (More Script Problems!)

    Quote Originally Posted by DarkDragon View Post
    I think what might be going on is that == only works on ints. Instead of
    Code:
    if(foo == true)
    try
    Code:
    if(foo)
    This behavior is not intended though, and if == still doesn't work for bools in the latest alpha, please post a bug report and I'll investigate.

    Oh, and as for double posting, AGN rules forbid it universally. I personally have no problems with it, as long as the new post contains genuine new information, so you could say that double-posting in here is decriminalized if not legal.
    Will do, but wouldn't "if(foo)" make it so it does the next line of code if it's true or not? I'll test this out in the latest build now.

    Edit: Well, well, well.... Nope, still doesn't work in 219, the latest windows Alpha. Time to make a bug report.

  7. #7
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.55%

    Re: Not again! (More Script Problems!)

    If == were working correctly,
    Code:
    if(foo)
    would be exactly the same as
    Code:
    if(foo == true)
    that is, the next code would execute if foo were true, and wouldn't otherwise. The == true is just redundant.
    If you wanted, you COULD keep adding == true checks
    Code:
    if( (foo==true)==true)
    Code:
    if( ((foo==true)==true))==true )
    all of which amounts to the same thing.

  8. #8
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,277
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.99%

    Re: Not again! (More Script Problems!)

    Quote Originally Posted by DarkDragon View Post
    If == were working correctly,
    Code:
    if(foo)
    would be exactly the same as
    Code:
    if(foo == true)
    that is, the next code would execute if foo were true, and wouldn't otherwise. The == true is just redundant.
    If you wanted, you COULD keep adding == true checks
    Code:
    if( (foo==true)==true)
    Code:
    if( ((foo==true)==true))==true )
    all of which amounts to the same thing.
    I get it now. But then, it should still be fixed, just in case someone needs to make a check for if foo is false, right? Or is there another way?

  9. #9
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.55%

    Re: Not again! (More Script Problems!)

    To check if foo is false, you can use the not operator (!), which turns false to true, and true to false. Thus all of the following are equivalent:
    Code:
    if(foo == false)
    Code:
    if(!foo == true)
    Code:
    if(!foo)
    But yes, I'll fix it, just because there's no reason == shouldn't work on booleans (especially since rewriting if(foo == bar), for two booleans foo and bar, is annoying.)

  10. #10
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,277
    Level
    24
    vBActivity - Bars
    Lv. Percent
    43.99%

    Re: Not again! (More Script Problems!)

    Quote Originally Posted by DarkDragon View Post
    To check if foo is false, you can use the not operator (!), which turns false to true, and true to false. Thus all of the following are equivalent:
    Code:
    if(foo == false)
    Code:
    if(!foo == true)
    Code:
    if(!foo)
    But yes, I'll fix it, just because there's no reason == shouldn't work on booleans (especially since rewriting if(foo == bar), for two booleans foo and bar, is annoying.)
    Thanks. Oh, by the way, something's faultering in my script now:
    Code:
    // Harp of Ages: Yes, it's true! If you have certain items, this Harp will do different things!
    // Changable Variables:
    // ID1- ID of the item you wish to be the Tune of Echoes, the first Harp tune. Use std.zh for the IDs.
    // ID2- ID of the item you wish to be the Tune of Currents, the second Harp tune. See above.
    // ID3- ID of the item you wish to be the Tune of Ages, the final Harp tune. Also see the first.
    // DrmntTmeHle- Combo used by the Dormant/Sleeping Time Hole (Before using Tune of Echoes).
    // OpnTmeHle- Combo used by the Open/Awakened Time Hole (After using Tune of Echoes).
    // Note: Due to limitations... IF YOU AWAKEN A TIME PORTAL, USE IT. If you leave the screen after awakening one and come back, if you use the Tune
    // of Echoes again, you MUST leave the screen, come back, and do it AGAIN! Otherwise, you'll go to the wrong place... >_<
    
    import "std.zh"
    item script HarpofAges
    {
    	int CurMap = 0;
    	int CurDMap = 0;
    	int CurScrn = 0;
    	int LastMap = 0;
    	int LastDMap = 0;
    	int LastScrn = 0;
    	int WrpMap = 0;
    	int WrpDMap = 0;
    	int WrpScrn = 0;
    	int WrpMap2 = 0;
    	int WrpDMap2 = 0;
    	int WrpScrn2 = 0;
    	int ID1 = 32;
    	int ID2 = 19;
    	int ID3 = 0;
    	int DrmntTmeHle = 0;
    	int OpnTmeHle = 0;
    	int Time = 1;
    	int FFCLoad = 0;
    	int FFCLocation = 0;
    
    	void run()
    	{
    		CurMap = Game->GetCurMap();
    		CurDMap = Game->GetCurDMap();
    		CurScrn = Game->GetCurScreen();
    		WrpMap = CurMap + 1;
    		WrpDMap = CurDMap + 1;
    		WrpScrn = CurScrn;
    		WrpMap2 = CurMap - 1;
    		WrpDMap2 = CurDMap - 1;
    		WrpScrn2 = CurScrn;
    		if (Link->Item[ID3])
    		{
    			if (CurMap == 2 || CurMap == 4 || CurMap == 6 || CurMap == 8 || CurMap == 10)
    			{
    				Time = 0;
    				Link->PitWarp(WrpDMap2, WrpScrn2);
    				Quit();
    			}
    			else if (CurMap == 1 || CurMap == 3 || CurMap == 5 || CurMap == 7 || CurMap == 9)
    			{
    				Time = 1;
    				Link->PitWarp(WrpDMap, WrpScrn);
    				Quit();
    			}
    		}
    		else if (Link->Item[ID2])
    		{
    			if (CurMap == 2 || CurMap == 4 || CurMap == 6 || CurMap == 8 || CurMap == 10)
    			{
    				Time = 0;
    				Link->PitWarp(WrpDMap2, WrpScrn2);
    				Quit();
    			}
    			else if (CurMap == 1 || CurMap == 3 || CurMap == 5 || CurMap == 7 || CurMap == 9)
    			{
    				Time = 1;
    			}
    		}
    		else if (Link->Item[ID1])
    		{
    			ffc FFCLoad = Screen->LoadFFC(32);
    			FFCLocation = (FFCLoad->Y & 240)+(FFCLoad->X>>4);
    			if (Screen->ComboD [FFCLocation] == DrmntTmeHle)
    			{
    				Screen->ComboD [FFCLocation] = OpnTmeHle;
    				Screen->ComboT [FFCLocation] = 1;
    			}
    		}
    	}
    }
    It's not doing anything, even if I have the specified items. I also need the help of an FFC to tell where a combo is, because there's no other way to find the combo's location, and just specifying a hardcoded location (one that'll never change) isn't a very good idea. I've checked to see if it was instead grabbing FFC 1, but... Nope. It's just plain not working. Any help would be appreciated.

    Edit: Ehehehe..... I just figured out that my problem was that the FFCs ALWAYS reset if you leave their combos at 0.... Not a very wise idea to make them do that, I feel. Aaanyways.... Now, the combo it changes seems to refuse to be a warp. I can set it to ANY of the walkable warp types for average warp-tile transitions (That is, Direct Warp or Stairs), yet.... Walking on it does nothing. As shown in the above, updated script, I tried to change the combo type during the script, but it doesn't work. Can anyone help me on this?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social