Jump to content

link's legends pt 2

Photo

i need help with scripting.


  • This topic is locked This topic is locked
5 replies to this topic

#1 lincolnpepper

lincolnpepper

    epic gamer

  • Members
  • Real Name:Lincoln
  • Location:null island

Posted 05 June 2016 - 10:32 AM

so i have a script, and here is what it SHOULD do: if you stand on it, have 3 or more triforce pieces (not the first 3 specifically, since this is like a banjo-kazooie or mario 64 style thing where you can get them in any order.) it teleports you to another screen. here is my script:

ffc script TriforceWarp{
void run(int map, int scr){
while(true){
if ( LinkCollision(this) && NumTriforcePieces() >= 3 ) Link->PitWarp(map,scr);
Waitframe();
}
}
}



does anyone have an idea why it doesnt work?


Edited by lincolnpepper, 05 June 2016 - 11:31 AM.


#2 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 05 June 2016 - 11:16 AM

You don't need to put a ; at the end of "while(true)". Also, do you have "this" defined as anything?


  • lincolnpepper likes this

#3 grayswandir

grayswandir

    semi-genius

  • Members

Posted 05 June 2016 - 11:24 AM

That looks like it should work, actually. (The ; after the while shouldn't be there, but I don't think it'll actually mess anything up.)
I'm guessing it's probably an error in your setup? You're placing the ffc on the screen with a non-0 combo, and setting the script and arguments right, and all that?
You'll probably need to stick a few Traces in there to debug, maybe.
  • lincolnpepper likes this

#4 lincolnpepper

lincolnpepper

    epic gamer

  • Members
  • Real Name:Lincoln
  • Location:null island

Posted 05 June 2016 - 11:45 AM

That looks like it should work, actually. (The ; after the while shouldn't be there, but I don't think it'll actually mess anything up.)
I'm guessing it's probably an error in your setup? You're placing the ffc on the screen with a non-0 combo, and setting the script and arguments right, and all that?
You'll probably need to stick a few Traces in there to debug, maybe.

 

 

well, crap. i forgot to set the freeform combo to the script. it still doesnt do anything though ;.;


You don't need to put a ; at the end of "while(true)". Also, do you have "this" defined as anything?

 

 

this just means the freeform combo, i thought. also, the simicolon there was a mistake :P fixed it.



#5 Deedee

Deedee

    Small Pixie Dragon

  • Administrators
  • Real Name:Deedee
  • Pronouns:She / Her, They / Them
  • Location:Canada

Posted 05 June 2016 - 12:48 PM

(The ; after the while shouldn't be there, but I don't think it'll actually mess anything up.)

 

False.

 

A ; after while(true) is very dangerous, because it marks the end of the loop there. Not only will you have an empty while loop, you will have a while loop that freezes the game, due to the waitframe never being reached.

 

Anyways, are you setting D0 and D1 in the FFC options to the map number and Screen? Also, I believe warping runs on DMaps, not Maps, so you might not have your DMaps set up. A DMap is basically data of what map an area should use, what color it will be, etc.


Edited by Dimentio, 05 June 2016 - 12:50 PM.


#6 grayswandir

grayswandir

    semi-genius

  • Members

Posted 05 June 2016 - 01:09 PM

False.
 
A ; after while(true) is very dangerous, because it marks the end of the loop there. Not only will you have an empty while loop, you will have a while loop that freezes the game, due to the waitframe never being reached.

That wasn't the case though. It wasn't:
while(true);
, it was
while(true) {;
. So that statement group will open with a blank statement, but it should still run.


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users