Announcement: Be excellent to each other.


Caravel Forum : DROD RPG Boards : RPG Bugs : No turn cost for Imperative Die
New Topic New Poll Post Reply
Poster Message
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon No turn cost for Imperative Die (+1)  
It's nice to be able to run scripts on the defeat of an NPC using "Wait until Defeat", but a lot of the time, I'd like to get rid of the monster immediately too. Imperative Die would be the logical choice for this.

Unfortunately, it doesn't run immediately: it waits until the next turn to actually take effect. So the monster stays around for a turn, being annoying.

Again, there's workarounds for this, but none of them ideal. Could use Disappear followed with a Game Effect, but the blood splats don't seem as impressive, and you have to be sure you're picking the right effect for your NPC and so forth.

I've been looking for other ways to run scripts on the same turn as defeat as a result, but "Wait for defeat" seems to be the only way to do this. So having Imperative Die act immediately would certainly be useful, since at least that part of the script is running after combat right now.
09-17-2008 at 06:56 PM
View Profile Send Private Message 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: No turn cost for Imperative Die (0)  
Has this change been made?

____________________________
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.
10-23-2020 at 05:34 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
kieranmillar
Level: Smitemaster
Rank Points: 2668
Registered: 07-11-2014
IP: Logged
icon Re: No turn cost for Imperative Die (+1)  
No. To test I made the following monster:

  Set var "_MyHP" = 100
  Imperative 1
  Wait for defeat 
  Speech "Hey, I died!",Normal,Self,0,.
  Imperative 4

Upon fighting it, it immediately responded with the speech, but did not splat until the following turn.
10-29-2020 at 08:17 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: No turn cost for Imperative Die (0)  
Thanks for confirming. The splat should happen on the same turn as defeat/death.

Moving this to the RPG Bugs board.

____________________________
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.
10-29-2020 at 09:47 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
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: No turn cost for Imperative Die (0)  
I've reproduced the issue on my end and I see the root cause. The current behavior is...for a reason I can't recall...intentional. There's specific waiting for the next player move to show the NPC's death.

Relevant code:
					case ScriptFlag::Die:
						//Stop script execution whether visible or not.
						bProcessNextCommand = false;
						if (bExecuteNoMoveCommands)
							return; //wait until first move to display death

						this->wCurrentCommandIndex = this->commands.size();
						if (this->bVisible)
						{
							//NPC dies.
							if (!bExecuteNoMoveCommands)
								CueEvents.Add(CID_MonsterDiedFromStab, this);

							CCueEvents Ignored;
							SetKillInfo(NO_ORIENTATION); //center stab effect
							room.KillMonster(this, Ignored, true);
						}
					break;


I'm trying to recall why it would be this way. Maybe so other scripts could detect the NPC's defeat on the next turn? No, that's not currently supported, actually. I think the comment about "wait until first move..." is in relation to move 0 (entering the room). That is, any NPCs that have scripted to die on room entrance wait until the player makes a move (otherwise, they simply wouldn't show up in the new room being transitioned to at all, like in regular DROD). That would make sense.

I'm going to try changing this so "Imperative Die" is only blocked on turn 0 and will put up a PR if this seems to work.

____________________________
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.

[Last edited by mrimer at 10-31-2020 04:05 AM]
10-31-2020 at 04:05 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: No turn cost for Imperative Die (0)  
PR

Bonus: Exposed the "NPC defeated" event as a scripted event check

____________________________
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.

[Last edited by mrimer at 10-31-2020 04:37 AM]
10-31-2020 at 04:36 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
kieranmillar
Level: Smitemaster
Rank Points: 2668
Registered: 07-11-2014
IP: Logged
icon Re: No turn cost for Imperative Die (+1)  
This appears to be working fine in 1.2.8.alpha.2020-11-10.

Interestingly, when I ran this example test script from earlier in the thread:
  Set var "_MyHP" = 100
  Imperative 1
  Wait for defeat 
  Speech "Hey, I died!",Normal,Self,0,.
  Imperative 4

The speech never showed up. Although it was in the speech log. I guess triggering speech and Imperative Die on the same turn completely KOs a character's speech visually?

More on topic, I am a little concerned that this change could cause a significant number of demos to fail. I'll need to look through all of the scripting of all of the published demos and see if it's in use, unless there is some kind of tool available to check the scripting in all of the holds?

[Last edited by kieranmillar at 11-10-2020 11:11 PM]
11-10-2020 at 09:50 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: No turn cost for Imperative Die (0)  
kieranmillar wrote:
The speech never showed up. Although it was in the speech log. I guess triggering speech and Imperative Die on the same turn completely KOs a character's speech visually?
Yes, that's correct. If a character is already dead, queued speech for that character won't be displayed onscreen.

I recall the rationale was that it tends to feel hokey more than not to have a character still talking that's already dead.

I just confirmed speech works this way in 5.x also. (Try an NPC on a hot tile, that speaks on the turn it burns up, for instance.)

____________________________
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.

[Last edited by mrimer at 11-10-2020 11:16 PM]
11-10-2020 at 11:15 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
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: No turn cost for Imperative Die (0)  
kieranmillar wrote:
I am a little concerned that this change could cause a significant number of demos to fail. I'll need to look through all of the scripting of all of the published demos and see if it's in use, unless there is some kind of tool available to check the scripting in all of the holds?
You could be right, but it might not be as bad as you think. For instance, before, the player might need to wait a turn for something to happen after such an encounter, and now they don't. This might translate to a demo playback where the player sits around for another turn when they don't have to. But you'd probably know better than I what real-world scenarios we have in published holds.

I'm not aware of a specific tool for that, as I don't play with the server-side data. I bet Schik or Skell have something very close to this sitting on a shelf, so please ask them.

____________________________
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.
11-10-2020 at 11:32 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
kieranmillar
Level: Smitemaster
Rank Points: 2668
Registered: 07-11-2014
IP: Logged
icon Re: No turn cost for Imperative Die (+1)  
The particular scenario I'm worried about is using wait for defeat on a boss monster to wait for it to die before triggering a scorepoint. With this change, the player's stats will still be the same when the scorepoint is triggered, but it will happen one turn earlier. I don't know whether the spider would care about that though. If it does, then the verification for that scorepoint would now fail.
11-10-2020 at 11:38 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: No turn cost for Imperative Die (0)  
kieranmillar wrote:
The particular scenario I'm worried about is using wait for defeat on a boss monster to wait for it to die before triggering a scorepoint. With this change, the player's stats will still be the same when the scorepoint is triggered, but it will happen one turn earlier. I don't know whether the spider would care about that though. If it does, then the verification for that scorepoint would now fail.
Ah, gotcha.

Looking at the playback validation code here, there's nothing expecting the score point to be registered on the final move of the move playback. As long as the score point occurs somewhere during the move sequence, and the playback can play through successfully to the end, it will count as valid.

____________________________
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.
11-11-2020 at 12:12 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Meta
Level: Master Delver
Rank Points: 106
Registered: 12-06-2016
IP: Logged
icon Re: No turn cost for Imperative Die (+1)  
In 1.2.7, if the player tries to move to the character with Imperative Die on that turn, then the player will stay on the same tile due to the delay. On the other hand, with this fix, if I am not mistaken, the player will move to the tile where the character was. This difference could break many demos.
11-11-2020 at 03:10 AM
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: No turn cost for Imperative Die (0)  
Meta wrote:
In 1.2.7, if the player tries to move to the character with Imperative Die on that turn, then the player will stay on the same tile due to the delay. On the other hand, with this fix, if I am not mistaken, the player will move to the tile where the character was. This difference could break many demos.
That's a good point. I agree this change in behavior could happen.

Edit: If the score point was achieved by defeating this enemy, it would not break these demos. However, for score points later on in play past defeating this enemy, I could see that this change could break them. However, in practice, I'm not sure how common it is to bump an enemy that was just defeated when it's still standing in front of you. Wouldn't the player typically wait for it to disappear before trying to occupy the NPC's tile?

____________________________
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.

[Last edited by mrimer at 11-11-2020 07:49 AM]
11-11-2020 at 07:44 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Meta
Level: Master Delver
Rank Points: 106
Registered: 12-06-2016
IP: Logged
icon Re: No turn cost for Imperative Die (+1)  
mrimer wrote: Wouldn't the player typically wait for it to disappear before trying to occupy the NPC's tile?

My personal experience suggested otherwise. When I first encountered such boss, I was confused by that the boss did not die, and the scorepoint did not showed up. So, I decided to bump the boss to make sure that it was really killed. Then, the death of the boss and the popped up scorepoint convinced me that the script asked us to execute the boss after defeating it, and the scorepoint was triggered once the boss was executed. The only way to execute the boss was to bump it. As a result, I kept bumping such bosses, and it was until much later when I learned what really had happened.
11-11-2020 at 10:31 AM
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: No turn cost for Imperative Die (0)  
Meta wrote:
mrimer wrote: Wouldn't the player typically wait for it to disappear before trying to occupy the NPC's tile?

My personal experience suggested otherwise. When I first encountered such boss, I was confused by that the boss did not die, and the scorepoint did not showed up. So, I decided to bump the boss to make sure that it was really killed. Then, the death of the boss and the popped up scorepoint convinced me that the script asked us to execute the boss after defeating it, and the scorepoint was triggered once the boss was executed. The only way to execute the boss was to bump it. As a result, I kept bumping such bosses, and it was until much later when I learned what really had happened.
Thanks for sharing your play experience in these situations. I believe I understand.

For score points where there is only one boss like this, they should still validate in the typical case.

When there is a sequence of bosses being defeated this way, it is possible the playback validation will fail after the first boss defeat.

I think we still want to move forward with the fix, but please share alternative opinions if you have them.

____________________________
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.

[Last edited by mrimer at 11-11-2020 03:40 PM]
11-11-2020 at 03:39 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
New Topic New Poll Post Reply
Caravel Forum : DROD RPG Boards : RPG Bugs : No turn cost for Imperative Die
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.