Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Miori on Sun 14/06/2009 16:23:47

Title: repeat a part of a script
Post by: Miori on Sun 14/06/2009 16:23:47
Hello!

I have a condition and if it is done it should go back to the point where the condition beginns until it isn't true anymore. How can i do this?

Please don't tell me i should put it into "room_RepExec" it is already there, but if the condition is not true the character leaves the room, so it doesn't ask after the condition again.

Title: Re: repeat a part of a script
Post by: NsMn on Sun 14/06/2009 16:26:28
Don't you know the while structure? You should just look up "while" in the help file.
Title: Re: repeat a part of a script
Post by: Akatosh on Sun 14/06/2009 16:26:49
Well, as AGS doesn't support a GOTO command, your can pretty much just use a while-loop and/or a recursive function. But I guess you know about those two already, with that mammoth project of yours, so this post probably wasn't helpful at all.  :P

/EDIT: Damn ninjas, can't never see 'em coming...
Title: Re: repeat a part of a script
Post by: GuyAwesome on Sun 14/06/2009 16:31:48
What exactly are you trying to do? It sounds like you want a while loop, as Akatosh and NsMn said, but it depends on what you're checking, and what you want to happen.

If it's something you want to be checked repeatedly while in the room, room_RepExec probably IS the place you want it to be. Show us what you've got there now, and we might be able to sort it out.
Title: Re: repeat a part of a script
Post by: Miori on Wed 17/06/2009 13:18:59
@GuyAwesome

It's for the calculation of the Experience for my Fighting System.


@ Akatosh

I really didn't think about a while-loop and i don't know how to make a recursive function, but hey ^^ it is the first game i programm by myself. Further i just used RPG Maker and u can't really call that programming  ;D. All modules are preprogrammed there.



now i put it into RepExec of the Room after the fight. Now it works :D
thank you for your help :)