Python - Single Hero gets captured everytime defeated - Block problem

Users who are viewing this thread

spiritwind

Squire
Ok, I'm trying to make a quest that requires one of the heros to show the dialog everytime he is killed. 
Pretty much in whole you fight him, kill him, go back into dialog where he gives a dying speech, and the quest is complete and his party is removed from game.  Here is what I have.
Here is the code for the spawn and giving the quest.
[trp_nasuada|plyr, "nasuada_help3", [], "Hes as good as dead!",
"close_window",[(set_spawn_radius,7),(spawn_around_party,"p_main_party","pt_maragoth"),(call_script, "script_start_quest",
"qst_kill_maragoth", "$g_talk_troop")]],
____
[party_tpl|pt_maragoth, "start", [(eq,"$talk_context",tc_party_encounter)], "What are you doing here you skunk!?",

"maragoth1",[]],
[anyone|plyr, "maragoth1", [], "I've come to slay you!", "maragoth2",[]],
[anyone, "maragoth2", [], "You weak minded fool, you think you can slay me!  Ah, this ought to be fun!",
"close_window",[(encounter_attack),]],
[party_tpl|pt_maragoth, "start", [(eq,"$talk_context",tc_hero_defeated)], "Ugh, *cough* *cough* I guess... This is... How it was
meant... to be...  *Dies*", "maragoth3",[]],
[party_tpl|pt_maragoth|plyr, "maragoth3", [(assign,"$maragoth_dead",1)], "Your wrath has finally come to an end...",
"close_window",[(remove_party, "$g_encountered_party"),(assign, "$g_leave_encounter",1),(call_script, "script_succeed_quest",
"qst_kill_maragoth", "$g_talk_troop")]],
___
For some reason it would spawn about 4 or 5 of his parties, I only want one, and he escapes every time and I never got a chance to test to see if the quest even finishes.
____
The second problem I am faced with is that one of the blocks is not working.  There is a lady named nasuada, she gives the quest, and its made so that once she speaks the very first line there is a condition block.  But it does not work.  She just keeps giving the quest and giving it.
-- Here is part of what I have *the ones that have the blocks*
[trp_nasuada, "start", [(assign,"$nasuada_quest_give",1)], "Please help us!  Go and kill Maragoth!", "nasuada_help",[]],

____
[trp_nasuada, "start", [(eq,"$nasuada_quest_give",1)], "My scouts tell me Maragoth is still terrorizing the area!  Go kill him
now!", "nasuada_quest_given",[]],

____
Any help would be grealty appreciated! 
 
For your first issue, stick a debug display_message in the spawn block and see if it's being called too many times.  If it isn't, check to see that your party template isn't being used somewhere else in error.  For the escape chance, look for cf_check_hero_can_escape_from_player in module_scripts.py.  It looks (by inspection) like this is called for any encountered enemy hero which has a default escape chance of something like 80%.  I see no obvious errors in the code you've posted but such issues have a way of living outside the current scope of consideration.

For your second issue, check that the second dialog is ahead of the first.  Ifn' you didn't already know:  when parsing dialogs to determine which state it should be in, the game goes in order and picks the first match.  Some people will tell you to always stick all your new dialogs at the top but this is not necessary and can lead to further issues down the line if you do a lot of dialog work.  Just keep the most specialized stuff at the top if your logical tree with tie breakers in front.  Alternatively, you could add a (eq, "$nasuada_quest_give", 0) to the condition block of the first dialog. 

Hope that helps in some way.
 
For some reason the condition blocks are not working. The only way I managed to get it to go to another set if you've got the quest if by this, ,(check_quest_active, "qst_kill_maragoth")
___
I think I understand what you are saying on the first one, I will see if I can find anything else.  I got it to where it takes him off the party list but then I get tons of errors as it trys to spawn more of him * at least thats what I think the errors are from...*
___
Thanks a ton for your help!
 
Still having trouble.  could someone type up a short tutorial on how they work. For some reason they just don't like me even tho I completly *think* I understand how they work and how to use them...
 
Got the blocks working, just orgainzation errors I'm pretty sure, still having the troubleing problem of the hero dying.  I have to claim that he is hiding and their scouts know where he is now and it spawns him.  It would be awesome if there was some way to make sure the guy dies everytime.  maybe I shouldent make him a hero but rather a troop... Hmmm... Why does it get an error when I do remove_party or whatever.  I'll add more details when I have them =)
 
Back
Top Bottom