Page 1 of 1

waitevent inside waitevent or savelocation-continuelocation

Posted: Thu Apr 09, 2015 6:29 pm
by Bugala
I have just had to find out a different and do quite a lot of coding of getting around a simple problem because you cant have waitevent inside waitevent.

Hence I would have a feature list of either to have possiblity of having waitevent inside waitevent.

Or then there could be "SaveLocation(n, jumpto)", "ContinueLocation(n)" type of command where idea would be that if I am for example executing line 100 in my code, but wouldnt want to execute that function further at that point yet, I could then use "SaveLocation(1, main())" to jump duirectly from that place back to Main() loop.

Then at later point I could use "ContinueLocation(1)" to jump back to line 101 and continue executing the program. Using this method, you could get around the waitevent inside waitevent limit, and practically have waitevent possiblity.

For example, In my case idea was that I had been using system where each card was dealt separately. As example, if you were dealt 5 cards in poker game, instead of being dealt 5, you would be dealt 1 card, 5 times. I had reasons for this, since most of time each card is supposed to trigger its own event, instead of 2 same cards triggering event only once in double force.

However, at one point I noticed you could get two cards too many at same time. I would have liked to use "ReceiveCard" function which checks for handsizelimit going over as well and tells player to discard one card if so have happened, but now it happened, that since there were two cards coming at once, i couldnt use the same thing twice, as i would first need to get back to that "WaitEvent()" part to deal with the first card, and then would need to jump back to that same place somehow to deal with the second one and it was messy way of doing it.

If there had been possiblity of simply using WaitEvent(), i would have done that trouble with that one line of code. Now I really had to twist my brain back and forth in trying to figure out some reasonable way of doing it.

Of course, possiblity to jump out of that function execution to that WaitEvent() place, and then being able to jump back to that saved place, would have solved the problem too. Hence my second suggestion that if two waitevents is too hard, then would it be possible to have that save/continue system somehow?

Re: waitevent inside waitevent or savelocation-continuelocat

Posted: Thu Apr 09, 2015 9:54 pm
by airsoftsoftwair
That's not likely going to come because it abets spaghetti code which I don't want to have in Hollywood :) Do it the clean way...