Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : Timing for Wait N and Movement.
New Topic New Poll Post Reply
Poster Message
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Timing for Wait N and Movement. (0)  
I have some character scripts with rather particular timing, such that
Wait 1 turn(s)
Wait 1 turn(s)
works but
Wait 2 turn(s)
does not.

I see the part in the source code that does this, and it looks quite intentional. Some comments related to the wait command code: "If a move can't be made right now, then don't register the delay until next turn to avoid an additional turn delay in loops after it completes." "Waiting is done this turn. Process commands that don't take a turn now, and wait till next turn on the rest."

So I already found my workaround, but I don't really understand why it is the way it is, and I'm curious about the intent of the waiting and movement interaction.
05-19-2005 at 04:28 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Timing for Wait N and Movement. (0)  
schep wrote:
I have some character scripts with rather particular timing, such that
Wait 1 turn(s)
Wait 1 turn(s)
works but
Wait 2 turn(s)
does not.
...
So I already found my workaround, but I don't really understand why it is the way it is, and I'm curious about the intent of the waiting and movement interaction.
Ohh...hmm... If I understand correctly, the inconsistency is that two consecutive "Wait 1 turn" commands force the NPC to really wait two full turns (and not do anything else until the third turn), but a single "Wait 2 turns" command allows the NPC to perform checks and do speech on the second turn, right? This does sound like bad logic. Both amounts of waiting should cause full turns to pass without doing anything else at all on these turns.

I propose simplifying the upper Wait check in the code to
if (this->wTurnDelay)
{
	//Skip turn.
	--this->wTurnDelay;
	return;
}


Do you agree this would be more proper?

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
05-20-2005 at 02:25 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 865
Registered: 03-01-2005
IP: Logged
icon Re: Timing for Wait N and Movement. (0)  
mrimer wrote:
Do you agree this would be more proper?
It works for me. And anybody who really wants speech or conditionals on the Nth turn can just Wait N-1; Something; Wait 1, right?

Edit: There was previously a long discussion of the other bExecuteNoMoveCommands stuff here, but I eventually convinced myself mrimer's change will make that part act very reasonably and consistently with older versions. Except that a C++ comment under case CCharacterCommand::CC_Wait has ceased to make sense.


[Edited by schep at Local Time:05-20-2005 at 06:07 PM]

[Edited by schep at Local Time:05-20-2005 at 06:08 PM: grammar]
05-20-2005 at 05:49 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : Timing for Wait N and Movement.
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.