Page 1 of 4 1234 LastLast
Results 1 to 20 of 62

Thread: "GeneralWithAncKilled" condition not working?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default "GeneralWithAncKilled" condition not working?

    I'm using 1.2 M2TW without Kingdoms.

    I was testing an ancillary trigger involving this condition, but it simply doesn't appear. I took the trigger from the vanilla ones and I'm sure I didn't make any mistakes, all other triggers work fine, and nothing wrong on the error log.

    Now here's the interesting part, I loaded up vanilla to try if its triggers work.

    Code:
    ;------------------------------------------
    Trigger holy_lance_killed_anc_trigger
        WhenToTest PostBattle
        Condition Attribute Piety > 3
              and WonBattle
              and GeneralWithAncKilled holy_lance
              and not HasAncType Relic
    
        AcquireAncillary holy_lance chance  10
    So I gave holy_lance to a hostile general, moved him to my place and killed him with my 5 piety general. No lance. Checked the trace.log and the trigger never fired. Afterwards I tried it with chance 100 and Piety > 0, still no luck. So the question is, has anyone ever got it to work?

  2. #2
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: "GeneralWithAncKilled" condition not working?

    Test it without all the other conditions first. Are you sure your general doesnt already have a relic?

  3. #3

    Default Re: "GeneralWithAncKilled" condition not working?

    Tried it again. This is the revised version:
    Code:
    ;------------------------------------------
    Trigger holy_lance_killed_anc_trigger
        WhenToTest PostBattle
        Condition WonBattle
    	  and IsGeneral
              and GeneralWithAncKilled holy_lance
    
        AcquireAncillary holy_lance chance  100
    I gave the lance to Bartolomeo Selvo, who didn't have any other ancillaries. Waited til next turn then moved him and killed him. Still no lance. No signs of it firing on trace either.

  4. #4

    Default Re: "GeneralWithAncKilled" condition not working?

    Well, could anyone try it out? I just wanna make sure if it's my mistake, some version problem, or the trigger itself really doesn't work.

  5. #5

    Default Re: "GeneralWithAncKilled" condition not working?

    OK I'm at my wits end. I thought maybe the condition GeneralWithAnc could be talking about a friendly general, and tested it accordingly.

    First I revised the trigger like above. Gave the lance to a general of mine. Next turn this general and another general fought some Italian spears and unfortunately the general with anc died. Then I won the battle, and got a veteran warrior anc. But still no lance and no trigger fired.

    Before you ask, yes I'm using file_first. Can I conclude that this condition is indeed bugged? Feel free to prove me wrong, believe me I tried.

  6. #6
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: "GeneralWithAncKilled" condition not working?

    Its possible that it doesnt work, there are a few commands that dont but this would be the first condition I know of that is broken.

  7. #7
    Squid's Avatar Opifex
    Patrician Artifex Technical Staff

    Join Date
    Feb 2007
    Location
    Frozen waste lands of the north
    Posts
    17,751
    Blog Entries
    3

    Default Re: "GeneralWithAncKilled" condition not working?

    One thought, the general that survived was he the commanding general? If not then that trigger won't fire because of the IsGeneral condition.
    Under the patronage of Roman_Man#3, Patron of Ishan
    Click for my tools and tutorials
    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe." -----Albert Einstein

  8. #8

    Default Re: "GeneralWithAncKilled" condition not working?

    Nope, the surviving general was always the leading general.

    I thought maybe the anc has to be added through a trigger rather than the console. Tested it, from both friendly and enemy side, nothing.

  9. #9

    Default Re: "GeneralWithAncKilled" condition not working?

    is the holy_lance set as transferable in export_descr_ancillaries?

  10. #10
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: "GeneralWithAncKilled" condition not working?

    Perhaps the Condition "GeneralWithAncKilled" is not set up to run in this circumstance. It is supposed to export character_record according to its entry, but in this instance you're checking for the person being General in the battle having died, and trying to give it to... a second in command? The game might be having trouble determining the second in command as a viable output. Also, the Condition "IsGeneral" would apply to whoever the trigger is firing for, not the person who got killed in the battle. So that condition I think would mean you're excluding the second in command because he wasn't the general in the battle :hmmm:. Maybe try using instead "AgentType = named character". Also, what's wrong with the Vanilla trigger for the same effect? It's set to fire when a general captures the settlement, but you should just be able to change the WhenToTest to post-battle, and the condition "and not I_WorldwideAncillaryExists holy_lance" should check for the same thing and perhaps more efficiently than "GeneralWithAncKilled".

    Cheers,
    Augustus

  11. #11
    GrnEyedDvl's Avatar Liberalism is a Socially Transmitted Disease
    Artifex Technical Staff

    Join Date
    Jan 2007
    Location
    Denver CO
    Posts
    23,851
    Blog Entries
    10

    Default Re: "GeneralWithAncKilled" condition not working?

    I should have caught this earlier


    Your condition says:
    If general with holy lance was killed
    and also won the battle
    give him the ancillary

    That will never work.

    Make sure I am reading this right, but what you want is when one general dies that has the ancillary, you want to give the ancillary to the winning general?

  12. #12
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: "GeneralWithAncKilled" condition not working?

    Quote Originally Posted by GrnEyedDvl View Post
    I should have caught this earlier


    Your condition says:
    If general with holy lance was killed
    and also won the battle
    give him the ancillary

    That will never work.

    Make sure I am reading this right, but what you want is when one general dies that has the ancillary, you want to give the ancillary to the winning general?
    I think what he wants to do is make it so the general who is not the head of the army, but is a family member/named character in the army gets the ancillary. Real life scenario would be finding the holy lance on the battlefield on your fallen comrade. In his scenario it seems that he tries to get the leading general killed, but still checks that that army wins the battle. It's very unlikely to be able to work like that, might fall in the category of things you just can't replicate .

    Cheers,
    Augustus

  13. #13

    Default Re: "GeneralWithAncKilled" condition not working?

    Well, I don't know which general the condition is referring to, so I tried different scenarios.

    If it refers to an enemy general you killed, I tried that in the first post. No trigger.
    If it refers to a friendly general who got killed, I tried that in post 5. No trigger.

    The problem with the condition is, if the "GeneralWithAncKilled" refers to the general referred by the entire trigger(sorry don't no how to put it, if you know what I mean), then the trigger would be pointless, the general is already dead, he can scarcely get any new ancs.

  14. #14
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: "GeneralWithAncKilled" condition not working?

    Quote Originally Posted by aeoleron9 View Post
    Well, I don't know which general the condition is referring to, so I tried different scenarios.

    If it refers to an enemy general you killed, I tried that in the first post. No trigger.
    If it refers to a friendly general who got killed, I tried that in post 5. No trigger.

    The problem with the condition is, if the "GeneralWithAncKilled" refers to the general referred by the entire trigger(sorry don't no how to put it, if you know what I mean), then the trigger would be pointless, the general is already dead, he can scarcely get any new ancs.
    It does refer to the general being specified by the whole trigger in this instance to my knowledge. So you're right in saying it would be useless used as a trait trigger, you should try using the one I specified above, because the "FactionwideAncillaryExists" would work sort of the same way, since PostBattle the ancillary wouldn't exist, and it would be looking for a participant in the battle, which if you specify local has to be yours, and if you specify named character Agent Type, has to be the second in command, would then potentially receive.

    You would use GeneralWithAncKilled as a condition for other things in the campaign_script.txt. Here's an example of both:

    Better way to try your script:
    Code:
    Trigger holy_lance_recovered_vnv_trigger
        WhenToTest PostBattle
              and CharacterIsLocal
              and AgentType = named character
              and FactionwideAncillaryExists holy_lance false
    
        AcquireAncillary holy_lance Chance 100
    The FactionwideAncillaryExists will either be "and FactionwideAncillaryExists holy_lance false" or it will be "and not FactionwideAncillaryExists holy_lance true". Haven't tested either, but I know one of the two, and logically both, should work. All of these conditions also use the exported character_record from PostBattle, so they should key in properly

    Here's an example of a theoretical usage of GeneralWithAncKilled:

    Code:
    	monitor_event PostBattle GeneralWithAncKilled holy_lance
    		and I_EventCounter holy_lance_missing == 0
    
    		add_events
    			event	counter holy_lance_missing
    			date	2 12 22
    		end_add_events
    	end_monitor
    
    	monitor_event EventCounter EventCounterType holy_lance_missing
    		and EventCounter > 0
    
    		if I_EventCounter holy_lance_missing == 1
    			and Religion catholic
    
    			historic_event find_the_holy_lance true
    
    			set_event_counter find_the_holy_lance 1
    		end_if
    
    		if I_EventCounter holy_lance_missing == 2
    			and Religion catholic
    
    			historic_event find_the_holy_lance2 true
    
    			set_event_counter find_the_holy_lance 2
    		end_if
    
    		if I_EventCounter holy_lance_missing == 3
    			and Religion catholic
    
    			historic_event find_the_holy_lance3 true
    
    			set_event_counter find_the_holy_lance 3
    		end_if
    
    		if I_EventCounter find_the_holy_lance == 1
    			and Religion catholic
    			and FactionType england
    
    			add_events
    				event	disaster locusts
    				region London_Region
    				date 0 5 10
    			end_add_events
    		end_if
    
    		if I_EventCounter find_the_holy_lance == 2
    			and Religion catholic
    			and FactionType england
    
    			add_events
    				event	disaster flood
    				region London_Region
    				date 0 5 10
    			end_add_events
    		end_if
    
    		if I_EventCounter find_the_holy_lance == 3
    			and Religion catholic
    			and FactionType england
    
    			destroy_buildings england church false
    		end_if
    I haven't really checked the above syntax, just using it as a theoretical example. In the above situation, when the general who had the holy lance is killed, it checks for it post battle and then sets an event counter, with three dates, the first being when word has circulated of the event, the second and third when the event worsens. So two turns after the general is killed and the lance is lost, an event will pop up saying the lance is lost and every good catholic nation needs to find it. Then it will set an event counter which will trigger a disaster of locusts, because you see God is angry you lost his lance! The same thing happens 10 turns and 20 turns from when you're first informed, signifying your failure to find the lance, which are accompanied by floods and the destruction of all churches. In addition to the above, you'd also need to work with traits and possibly other areas, and make it possible to find the holy lance and trigger an event which reverses the effects of the holy_lance_missing event, so you aren't getting floods and churches blowing up even if you find the lance. So it could be used, just not to effect another character.

    Cheers,
    Augustus

  15. #15

    Default Re: "GeneralWithAncKilled" condition not working?

    Problem with Factionwide is that it'll trigger even when you didn't have the anc to begin with. So after any battle it will trigger and you'll get the holy lance out of nowhere. To prevent this, I would have to make a counter for every relic ancillary previously owned...and god that's going to be tedious.

  16. #16
    Byg's Avatar Read The Manual
    Patrician

    Join Date
    Nov 2005
    Posts
    4,569

    Default Re: "GeneralWithAncKilled" condition not working?

    Can this work in the campaign script?
    Last edited by Byg; August 19, 2008 at 02:40 AM.

    NEW BGR V 20150324! . . . . . . . .. . . .BGRIV_E

  17. #17

    Default Re: "GeneralWithAncKilled" condition not working?

    Most likely a combination of both the script and eda. Use the script to trigger an event counter and use that to trigger the ancillary. But imo it's more trouble than its worth.

  18. #18

    Icon1 Re: "GeneralWithAncKilled" condition not working?

    The ‘GeneralWithAncKilled’ condition looks for the ancillary’s type, not its name. See posts 503 to 511:
    http://www.twcenter.net/forums/showt...269194&page=26

  19. #19

    Default Re: "GeneralWithAncKilled" condition not working?

    Great thread guys!

    I think there is the same problem in 3rdAge:
    A 'GeneralWithAncDied' trigger shall give you the ONE RING after you killed the enemy general who had it (same for some other relics).

    The trigger is built like the 'lance'-trigger the op posted first.
    Yet after numerous battles against ringbearers, I've noticed this trigger probably doesn't work.

    Thus I've created a trigger in the liking of the one Augustus posted above.

    ;----------------------------------------------
    Trigger one_ring_battletrigger
    WhenToTest PostBattle
    Condition WonBattle
    and not I_WorldwideAncillaryExists one_ring
    and AgentType = named character
    and I_TurnNumber > 6 ;the ring always appears on turn5 afaik

    AcquireAncillary one_ring chance 100

    ;----------------------------------------------
    Do you see any problems with it (the ring being a singular anc)?
    In a quick test it seemed to work perfectly and my log is empty.

    Regards,
    confused



    EDIT: I have now already included this and other triggers in a post in the TA suggestion thread.
    Last edited by confused german; April 08, 2010 at 03:21 PM.
    "Do you want Total War?"

  20. #20
    konny's Avatar Artifex
    Join Date
    Jul 2007
    Location
    Germania Inferior
    Posts
    3,631

    Default Re: "GeneralWithAncKilled" condition not working?

    Try this

    ;----------------------------------------------
    Trigger one_ring_battletrigger
    WhenToTest PostBattle
    Condition WonBattle
    and not I_WorldwideAncillaryExists one_ring
    and AgentType = named character
    and IsGeneral
    and I_TurnNumber > 6 ;the ring always appears on turn5 afaik

    AcquireAncillary one_ring chance 100

    ;----------------------------------------------

    Team member of: Das Heilige Römische Reich, Europa Barbarorum, Europa Barbarorum II, East of Rome
    Modding help by Konny: Excel Traitgenerator, Setting Heirs to your preference
    dHRR 0.8 beta released! get it here
    New: Native America! A mini-mod for Kingdoms America

Page 1 of 4 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •