Scripting help please
As long as the enemy has a castle, any hero or any other stack, there is a theoretical chance of the hero beeing resurrected (check for the availability of a sanctuary on the map). So if the specific hero is killed by a neutral stack, and there would be a theoretical chance of the hero beeing resurrected, then (i think) he is not really dead.
I used Humakt's suggested scripts and, on the first run-through, everything worked fine. However, the Baddy was in the final castle and that always did work. All problems seem to arise when he is killed first.
I recently had a similar problem with Beebee and the 3 Pigs: the game just won't finish even though all towns, enemies, etc. have been subdued.
I recently had a similar problem with Beebee and the 3 Pigs: the game just won't finish even though all towns, enemies, etc. have been subdued.
RobB
I made small test map and it worked fine in every scenario I tested. I couldn't replicate bug.RobB wrote:I used Humakt's suggested scripts and, on the first run-through, everything worked fine. However, the Baddy was in the final castle and that always did work. All problems seem to arise when he is killed first.
I recently had a similar problem with Beebee and the 3 Pigs: the game just won't finish even though all towns, enemies, etc. have been subdued.
Did you use my former or latter suggestion?
Thundermaps
"Death must be impartial. I must sever my ties, lest I shield my kin."
"Death must be impartial. I must sever my ties, lest I shield my kin."
Continuous event shouldn't be on hero and especially not on army hero is in. Put it on the map's continuous events instead. I usually say where the script should be if it's located somewhere else than map events.RobB wrote:The one with a script on every town "captured" event and a continuous event on the bad hero (even though I didn't really understand "owner is human or opposing player is human"). I wrote the scripts exactly as you said.
Also did you set the numeric variable Towns_Owned to number of towns the red (human) player controls at the start of the game like I stated? It is vital for the script to work properly.
Thundermaps
"Death must be impartial. I must sever my ties, lest I shield my kin."
"Death must be impartial. I must sever my ties, lest I shield my kin."
Sorry - my poor writing skills. I meant the event checking the hero's status was a continuous one. It is, of course, a map event.Humakt wrote:Continuous event shouldn't be on hero and especially not on army hero is in. Put it on the map's continuous events instead. I usually say where the script should be if it's located somewhere else than map events.
This wasn't necessary. Red owns no towns at the beginning. Moreover, since the first town reached is inaccessible afterwards (one-way portal), I was able to cut my town count down to 4. I played it again yesterday - caught the baddy early on - and it all worked fine, so I think it's a winner.Humakt wrote:Also did you set the numeric variable Towns_Owned to number of towns the red (human) player controls at the start of the game like I stated? It is vital for the script to work properly.
I do hope I've got this right. This is Scenario 3 in the campaign, but I have something similar in Scenario 5 which the grand finale.
RobB
-
- Leprechaun
- Posts: 27
- Joined: 06 Jan 2006
ok this is resurecting an old thread, but another sugestion although slightly longer you can do a nested set of conditional checks as a continous event, or even so it's not such a resouce hog just do it on the players turn, but check to see if the player owns the towns first if he doesn't own anyone of them then that check will fail and the tree will end, then for the last couple check you can check if the badguy is dead and run run a message for that possibability, saying you found "badguy's corpse", or if he's not dead but in prision you can run a different script where he give a big speal before you behead him. here's a simplified tree
if Red Player owns the town named "town1"
if Red Player owns the town named "town2" then
if Red Player owns the town named "town3" then
if Red Player owns the town named "town4" then
if Red Player owns the town named "town5" then
if Hero named "badguy" is dead then
Display "you found Badguys corpse today beaten to a pulp, you feel a bit bad because you didn't get to do it yourself"
Red Player Wins
else
if Hero named "badguy" is in prison then
Display "you have finally conquored Badguy and all of his armies, as you take him up to the gallows he give some long winded speech, it abruptly ends ind a gurgle as the switch is thrown, and he drops like a pile of bricks."
Red Player Wins
if Red Player owns the town named "town1"
if Red Player owns the town named "town2" then
if Red Player owns the town named "town3" then
if Red Player owns the town named "town4" then
if Red Player owns the town named "town5" then
if Hero named "badguy" is dead then
Display "you found Badguys corpse today beaten to a pulp, you feel a bit bad because you didn't get to do it yourself"
Red Player Wins
else
if Hero named "badguy" is in prison then
Display "you have finally conquored Badguy and all of his armies, as you take him up to the gallows he give some long winded speech, it abruptly ends ind a gurgle as the switch is thrown, and he drops like a pile of bricks."
Red Player Wins
Who is online
Users browsing this forum: No registered users and 0 guests