repeat a part of a script

Started by Miori, Sun 14/06/2009 16:23:47

Previous topic - Next topic

Miori

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.


NsMn

Don't you know the while structure? You should just look up "while" in the help file.

Akatosh

#2
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...

GuyAwesome

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.

Miori

@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 :)

SMF spam blocked by CleanTalk