Page 1 of 2 12 LastLast
Results 1 to 20 of 28

Thread: Stealing enemy tech WIP

  1. #1
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Stealing enemy tech WIP

    I am going to have a crack at implementing something I thought up last year. I had so much to do already with DLV that the extra work of carrying out this idea just put me off.

    Basically it goes as follows:

    I want to give the player the choice of researching units from another faction.

    I want the time it takes to research something to be prohibitive. In effect this means that the player will not be able to research units from all factions during a campaign but instead will have to focus on 1 or 2 factions to get anything from it. I do not want this feature to ruin replayability the way I feel AORs usually do.

    There would be many ways a player can accumulate research points for a specific faction, like alliance, combat, conquest, espionage, etc.

    But because the research takes time, the player is provided with an incentive to keep that faction alive.

    An alliance with (and a load of spying on) a faction would not get results as fast as constant war with them but it would be easier to keep them alive. Maintaining the alliance while your spies and assassins are getting caught in the act might be tricky though.

    So it seems to offer some nice gameplay elements unseen in M2TW and mods so far (AFAIK).

    I'd appreciate some input though:

    What should earn research points?

    Which kinds of units should be allowed to be researched? Any ideas on specific units you would like to be able to research?

    Oh yeah and feel free to tell me if you think the whole idea is crap, just provide some reasoning please.

    edit:

    I've just got it working for england's yeoman archers and heavy billmen. Now any faction can have them if they make enough effort spying, warring and allying with the english.

    I can appreciate that this is 'unhistorical' but then so is the lack of influence between factions.

    Am I the only person that thinks this is even mildly exciting?

    edit: Well, 41 views and no response. I'll just forget about it then ...
    Last edited by Taiji; August 26, 2009 at 06:31 PM.

  2. #2
    Tiro
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    218

    Default Re: My idea, what do you reckon?

    Industrial espionage eh?
    Sounds interesting and I would like to see how it would perform in long term campaign. Thing like that would spice up even really boring unit roster. Also I think that to prevent of unfair exploiting this feature by player, those "stolen" units should be expensive as hell, just to make them nice addition - not the backbone of your armies.

  3. #3
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    Aha! A response! Thanks Slon80

    Good point about restricting them. I can't see a way to raise their price but perhaps they could require a new building to be built... military research institute or something... and that could be expensive. Plus they could be slow to produce and take many turns for a recruit pool to replenish.

    Use of these units should be heavily restricted, I don't want to see them replace a faction's native units, merely supplement.
    Last edited by Taiji; August 18, 2009 at 11:30 AM.

  4. #4

    Default Re: My idea, what do you reckon?

    Haven't we already got Militay Academys? (sorry I haven't really played DLV much, I always get errors downloading the installers)

    This is a very good Idea, there are quite a few units that immediatly spring to mind when you say this though and if possible wouldn't it be better to implement certain 'researchable' units for different factions but make some universally availible?

    Gothic Knights for example I would always believe to be researchable, Swordstaff Militia, Cataphratii (or whatever there called in this mod) Lancers etc.

    I believe though that the higher end units should be maybe more open because until quite later in the game, most of the units for factions are quite carbon.

    Maybe Muslim and Christian Factions should research differently? I can't see Crusader's copying Egyptian Armies but I can definately see an Egyptian Army picking up more 'western qualities' as they fight against more European factions.

    I believe Battle, Spying, maybe Sabotage but only if it targets specific buildings.

  5. #5
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    Thanks Kasrkin, you've made some really good points there.

    I'm beginning to think this idea cannot be done well with DLV as it is.

    The idea that certain units should only be researchable by certain factions...

    Really I need an extra 30-60 spaces free in the EDU to make new unit entries. This would allow for the researched versions of units to be not as good as the original. It would also allow me to make more them more neutral in terms of terrain bonuses. Egyptian gothic knights (as a somewhat crazy example) should not be good in snow...

    This idea is getting more and more horrible by the moment. Horrible because of the sheer amount of work it demands from one lazy person (me).

    Also I'm hitting a barrier with scripting. So far I've failed to find any useful tutorials...

  6. #6
    Leonnidas's Avatar Semisalis
    Join Date
    Nov 2006
    Location
    Azores
    Posts
    420

    Default Re: My idea, what do you reckon?

    I like the idea, portuguese and spaniards did it, they use units that are inspired by the moors, so I can't others factions!

    But like you sais it wont be easy to do it, good luck, if you decide to do it

  7. #7
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    Precisely, Leonnidas. I think it's realistic to 'deviate from history' in this way.

    The real problem is that I can't see a way to do it really well.

    Units shared this way would be identical, even down to the uniform. The graphics I don't care about but having the same capability is a bit annoyingly unrealistic.

    I'm thinking that the way to reduce the impact of this is to choose units that are around level 4, 5 or 6 in my BB system. These units are not the top units. They're not nobility. Units like men at arms, militia pikes, halberds, swordsmen, billmen, swordstaff, voulgiers, etc., units that offer a capability that some factions lack but are not ultimate units.

    Perhaps with some units we could have the rebel textures, but I think many lack these or battle_models has been done by someone more lazy than me. If they have these textures they are not yet set up for them.

    On the other hand I imagine that some nations will be able to share units and use their own textures, because they already use similar texture sets.

    So, units will perform the same no matter which faction owns them - that's bad and unavoidable with the EDU full as it is.

    It's OK though, it doesn't put me off. It doesn't seem to put people off AOR's...

  8. #8

    Default Re: My idea, what do you reckon?

    would greek firethrowers be included?

  9. #9
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    For anyone that's interested, here is where I am with the script so far:
    Code:
    declare_counter england_points
    declare_counter england_level_1
    declare_counter england_level_2
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		historic_event research true
    	end_monitor
    
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 4
    		and ProbabilitySuccess < 15
    		inc_counter england_points 1
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 4
    		and ProbabilitySuccess < 5
    		inc_counter england_points 2
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 5
    		and ProbabilitySuccess < 15
    		inc_counter england_points 1
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 5
    		and ProbabilitySuccess < 5
    		inc_counter england_points 2
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 6
    		and ProbabilitySuccess < 25
    		inc_counter england_points 1
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 6
    		and ProbabilitySuccess < 15
    		inc_counter england_points 2
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 6
    		and ProbabilitySuccess < 5
    		inc_counter england_points 3
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 7
    		and ProbabilitySuccess < 25
    		inc_counter england_points 1
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 7
    		and ProbabilitySuccess < 15
    		inc_counter england_points 2
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 7
    		and ProbabilitySuccess < 5
    		inc_counter england_points 3
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess < 30
    		inc_counter england_points 1
    	end_monitor
    		monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess < 20
    		inc_counter england_points 2
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess < 10
    		inc_counter england_points 3
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess < 5
    		inc_counter england_points 4
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess < 30
    		inc_counter england_points 1
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess < 20
    		inc_counter england_points 2
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess < 10
    		inc_counter england_points 3
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess < 5
    		inc_counter england_points 4
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 35
    		inc_counter england_points 1
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 25
    		inc_counter england_points 2
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 15
    		inc_counter england_points 3
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 10
    		inc_counter england_points 4
    	end_monitor
    	monitor_event MissionFinished AgentType spy
    		and I_EventCounter research_accepted = 1
    		and MissionSuccessLevel > partly_successful
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 5
    		inc_counter england_points 5
    	end_monitor
    
    	monitor_event LeaderDestroyedFaction TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal
    		inc_counter england_points 35
    	end_monitor
    	monitor_event GeneralCaptureSettlement TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal
    		and SettlementBuildingExists citadel
    		inc_counter england_points 18
    	end_monitor
    	monitor_event GeneralCaptureSettlement TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal
    		and SettlementBuildingExists fortress
    		inc_counter england_points 16 
    	end_monitor
    	monitor_event GeneralCaptureSettlement TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal
    		and SettlementBuildingExists castle
    		inc_counter england_points 14
    	end_monitor
    	monitor_event PostBattle TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal 
    		inc_counter england_points 4
    	end_monitor
    	monitor_event FactionTradeAgreementMade TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal 
    		inc_counter england_points 1
    	end_monitor
    	monitor_event FactionAllianceDeclared TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal 
    		inc_counter england_points 15
    	end_monitor
    	monitor_event FactionBreakAlliance TargetFactionType england
    		and I_EventCounter research_accepted = 1
    		and FactionIsLocal 
    		inc_counter england_points -13
    	end_monitor
    
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and DiplomaticStanceFromFaction england allied
    		inc_counter england_points 1
    	end_monitor	
    	
    	monitor_event PreFactionTurnStart FactionIsLocal
    		if I_CompareCounter england_points >= 100
    		and I_EventCounter england_level_1 = 0
    		historic_event england_level_1
    		end_if
    		if I_CompareCounter england_points >= 200
    		and I_EventCounter england_level_2 = 0
    		historic_event england_level_2
    		end_if
    	end_monitor
    It's a load of triggers that add points to some counters, that then fire off events, which will allow production of new troops... roughly.

    I'm glad I've had Repman's stuff to look at but Azim has just given me some great help. I was trying to make a system where spys would win more research points for success on more dangerous missions. I'd made a proper mess of it by the time Azim gave me help and advice in the modding forums, saved me

    So I think I've got it working and basically it means you will want to find a difficult mission for your spy to get maximum research points. The higher the level of spy, the more research points gained. Level 3 and below need more training to even attempt 'research theft', level 4 is the minimum for any result and the harder the mission, the better.

    Example:

    A level 10 agent can earn 5 research points if he is succesful on a mission with less than 5% chance, 4 points for < 10%, 3 for <15%, 2 for < 25% and less than 35% probability of success.

    Thinking about that example... maybe I should raise the amount this level 10 spy can earn...

    Either way you get the idea. What it doesn't do, which would be nice, is check if target is not an assassin or other agent, whether the target is a settlement which has a specific target.

    The whole script should really depend on the target of research being able to produce the unit already. I don't want the player to be able to field the unit before the AI can, that's just dumb.

  10. #10
    Kjertesvein's Avatar Remember to smile
    Join Date
    Nov 2007
    Location
    Miðaldir
    Posts
    6,679
    Tournaments Joined
    1
    Tournaments Won
    0

    Default Re: My idea, what do you reckon?

    When i first read this, the mercenary building came to mind. hmmm, not a scripter my self, but I think included something similar...(slap me if im to far out in the field on this one). This idea sound really ground breaking btw, keep it up!
    Thorolf was thus armed. Then Thorolf became so furious that he cast his shield on his back, and, grasping his halberd with both hands, bounded forward dealing cut and thrust on either side. Men sprang away from him both ways, but he slew many. Thus he cleared the way forward to earl Hring's standard, and then nothing could stop him. He slew the man who bore the earl's standard, and cut down the standard-pole. After that he lunged with his halberd at the earl's breast, driving it right through mail and body, so that it came out at the shoulders; and he lifted him up on the halberd over his head, and planted the butt-end in the ground. There on the weapon the earl breathed out his life in sight of all, both friends and foes. [...] 53, Egil's Saga
    I must tell you here of some amusing tricks the Comte d'Eu played on us. I had made a sort of house for myself in which my knights and I used to eat, sitting so as to get the light from the door, which, as it happened, faced the Comte d'Eu's quarters. The count, who was a very ingenious fellow, had rigged up a miniature ballistic machine with which he could throw stones into my tent. He would watch us as we were having our meal, adjust his machine to suit the length of our table, and then let fly at us, breaking our pots and glasses.
    - The pranks played on the knight Jean de Joinville, 1249, 7th crusade.













    http://imgur.com/a/DMm19
    Quote Originally Posted by Finn View Post
    This is the only forum I visit with any sort of frequency and I'm glad it has provided a home for RTR since its own forum went down in 2007. Hopefully my donation along with others from TWC users will help get the site back to its speedy heyday, which will certainly aid us in our endeavor to produce a full conversion mod Rome2.

  11. #11

    Default Re: My idea, what do you reckon?

    Hi, Firstly, i apologize for the long post (have a habit of that)...
    I'm more of a lurker on these forums and tend to pop in and out of the different forums to keep upto date on whats being done script wise in the various mods. I have never actually played DLV but what ive read on this forum it does sound impressive.

    When i read this particular thread it got my attention because ive always been a firm believer that research is not included in most mods as it should be, and espionage isnt used enough. I like to think of the EDB as a tech tree so to speak.

    Your approach is quite interesting and i think i could give you some ideas to help fine tune your script. Firstly, you have a lot of monitors which could easily be reduced into carefully set out if statements. Take this part of your code...
    Spoiler Alert, click show to read: 


    Code:
     
    monitor_event MissionFinished AgentType spy
            and I_EventCounter research_accepted = 1
            and MissionSuccessLevel > partly_successful
            and FactionIsLocal
            and SpyMission
            and TargetFactionType england
            and Attribute Subterfuge = 4
            and ProbabilitySuccess < 15
            inc_counter england_points 1
        end_monitor
        monitor_event MissionFinished AgentType spy
            and I_EventCounter research_accepted = 1
            and MissionSuccessLevel > partly_successful
            and FactionIsLocal
            and SpyMission
            and TargetFactionType england
            and Attribute Subterfuge = 4
            and ProbabilitySuccess < 5
            inc_counter england_points 2
        end_monitor
     
    your other moniters here that do the same thing with a slightly different result...
    You could reduce that by using if statements like this...
    NOTE I highlighted what i changed...
    Code:
     
    monitor_event MissionFinished AgentType spy
     
         if I_EventCounter research_accepted = 1
            and MissionSuccessLevel > partly_successful
            and FactionIsLocal
            and SpyMission
            and TargetFactionType england
            and Attribute Subterfuge = 4
            and ProbabilitySuccess < 16
             and ProbabilitySuccess > 5
                 inc_counter england_points 1
        end_if
     
         if I_EventCounter research_accepted = 1
            and MissionSuccessLevel > partly_successful
            and FactionIsLocal
            and SpyMission
            and TargetFactionType england
            and Attribute Subterfuge = 4
            and ProbabilitySuccess < 6
                inc_counter england_points 2
       end_if
     
    Other if statements
     
    end_monitor
    That way you get those 20+ monitors into 1 monitor (which will help speed up the end turn when using the script). Notice i added the less than greater than part <>. Which is to help direct the script really.

    You could probrably make the if statements smaller with careful planning and fine tuning...


    You could also take an approach similar to the way guilds work, reducing the research points earned every turn so the player must ACTIVELY be attempting to research.

    And i assume that your using the EDB to set conditions for when the unit actually becomes available? like and requires england_research_2

    And you stated you dont want the player to be able to recruit the unit before the factions that owns the original unit, you could set a condition that stops the player from reaching a certain research level until AFTER the original faction has trained atleast a few of those units. For example, the player has 199 research points and getting to 200 gets him to level 2 research which will allow him to train 'heavy billman' < just an example... But the original faction has not built any of them yet (write a script, one monitor, that reduces the research points to 199 if over 200 until a condition has been met), write another script that counts how many of the unit has been trained and terminate the monitor when it reachs 3 (faction has trained 3 billman) setting a condition as met, now the research can go above 200 and reach level 2 and you can train those heavy billman. Does that make sense?

    Anyway, great idea, nice script. Just wanted to throw my 2 cents in.

    Cheers...
    ...longbows, in skilled hands, could reach further than trebuchets...

  12. #12
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    That's really fantastic, Tsarsies. I think I understand what you are suggesting, it's brilliant to get your feedback and I very much appreciate it.

    There is one bit in particular where I am stuck and could do with advice...
    Code:
    	monitor_event PreFactionTurnStart FactionIsLocal
    		and DiplomaticStanceFromFaction england allied
    		inc_counter england_points 1
    	end_monitor
    That bit seems to cause a point increase with no alliance in place. I'm having to remove it to test other things and I have no idea what is wrong with it... any ideas?

    Thanks again, I don't know much at all about scripting and I'm too impatient to learn and then try, I want to try right now!

    Especially as I feel I've made plenty of direct progress already. I have my edb stuff, my events, even some of the battle_models stuff is done, it's just the scripting holding me back. Azim has given me an idea of where to find good info on scripting, but getting answers to specific questions I feel the need to ask and having my errors pointed out is the best way for me to learn.

    If you have time to help further I would be most grateful

  13. #13

    Default Re: My idea, what do you reckon?

    Would you get more research points if you're spying a capital?

  14. #14
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    That's a great idea Miniwally, thanks for that

    As for firethrowers, I think perhaps they should be left out of any sharing deal. They are obscenely powerful and one of the top tier units for Byz. If they were to be made accessible I think they would have to require a huge amount of points. For now I just want to focuse on some simple units. It might be something I'll look at later though.

  15. #15
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    After Tsarsies very excellent advice, I've had a crack at improving it and now have:

    Code:
    	monitor_event MissionFinished AgentType spy
    		and FactionIsLocal
    		and SpyMission
    		and TargetFactionType england
    		and MissionSuccessLevel > partly_successful
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 4
    		and ProbabilitySuccess =< 15
    		and ProbabilitySuccess > 5
    		inc_counter england_points 1
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 4
    		and ProbabilitySuccess =< 5
    		inc_counter england_points 2
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 5
    		and ProbabilitySuccess =< 15
    		and ProbabilitySuccess > 5
    		inc_counter england_points 1
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 5
    		and ProbabilitySuccess =< 5
    		inc_counter england_points 2
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 6
    		and ProbabilitySuccess =< 25
    		and ProbabilitySuccess > 15
    		inc_counter england_points 1
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 6
    		and ProbabilitySuccess =< 15
    		and ProbabilitySuccess > 5
    		inc_counter england_points 2
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 6
    		and ProbabilitySuccess =< 5
    		inc_counter england_points 3
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 7
    		and ProbabilitySuccess =< 25
    		and ProbabilitySuccess > 15
    		inc_counter england_points 1
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 7
    		and ProbabilitySuccess =< 15
    		and ProbabilitySuccess > 5
    		inc_counter england_points 2
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 7
    		and ProbabilitySuccess =< 5
    		inc_counter england_points 3
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess =< 30
    		and ProbabilitySuccess > 20
    		inc_counter england_points 1
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess =< 20
    		and ProbabilitySuccess > 10
    		inc_counter england_points 2
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess =< 10
    		and ProbabilitySuccess > 5
    		inc_counter england_points 3
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 8
    		and ProbabilitySuccess =< 5
    		inc_counter england_points 4
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess =< 30
    		and ProbabilitySuccess > 20
    		inc_counter england_points 1
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess =< 20
    		and ProbabilitySuccess > 10
    		inc_counter england_points 2
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess =< 10
    		and ProbabilitySuccess > 5
    		inc_counter england_points 3
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 9
    		and ProbabilitySuccess =< 5
    		inc_counter england_points 4
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess =< 35
    		and ProbabilitySuccess > 25
    		inc_counter england_points 1
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess =< 25
    		and ProbabilitySuccess > 15
    		inc_counter england_points 2
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess =< 15
    		and ProbabilitySuccess > 10
    		inc_counter england_points 3
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess =< 10
    		and ProbabilitySuccess > 5
    		inc_counter england_points 4
    		end_if
    		if I_EventCounter research_accepted = 1
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess =< 5
    		inc_counter england_points 5
    		end_if
    	end_monitor
    Which seems a much more elegant solution.

    Still I have problems getting an alliance to register properly, so far it seems to give points whether allied or not
    Last edited by Taiji; August 19, 2009 at 10:38 AM.

  16. #16

    Default Re: My idea, what do you reckon?

    great idea Taiji!

  17. #17

    Default Re: My idea, what do you reckon?

    yeh fair enough bout firethrowers i just want some though

  18. #18
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    Bah now the whole thing isn't working...

    I guess I start again... this scripting stuff is kinda fun, like lego but not so obvious

    edit:
    Code:
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge = 2
    		and ProbabilitySuccess =< 95
    		and ProbabilitySuccess > 5
    		and I_EventCounter research_accepted = 1
    		inc_counter england_points 4
    	end_monitor
    Lots of those will do the job. I can't see another way to do it. I haven't found an 'if' statement that can work yet. In the example above there needs to be no irrelevant interuption between everything until 'inc_counter england_points 4'. I can't vary them on an eventcounter because an event does not provide the info the next line needs.... apparently...

    edit:

    I had a nice extra idea when I saw this condition: GeneralWithAncKilled

    We could have AI only ancillaries that have names like 'important documents', which gives them a big bonus to personal security but gives you a large reward of research points should you manage to kill him in battle. Just an idea...

    Conditions like InEnemyLands and IsBesieging could be good for a trait or anc that affects personal security too...

    edit:

    Unfortunately 'lots of those' is a massive understatement. I'd need 420 of those to do what I want with spying missions. And that's totally ignoring the object of the spying beyond it's faction and difficulty. Bonus for spying on a settlement which has X building and so many of Y units... there is so much to add to this, thinking about subtracting from it at this stage is ing annoying.

    420 monitors might impact performance (yep I'm clueless) so I might need to scrap the whole section and think of a different way to approach it.

    edit:

    So far I'm at this point:
    Code:
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 3
    		and Attribute Subterfuge < 6
    		and ProbabilitySuccess < 41
    		and ProbabilitySuccess > 20
    		inc_counter england_points 1
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 3
    		and Attribute Subterfuge < 6
    		and ProbabilitySuccess < 21
    		inc_counter england_points 2
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 5
    		and Attribute Subterfuge < 8
    		and ProbabilitySuccess < 41
    		and ProbabilitySuccess > 20
    		inc_counter england_points 1
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 5
    		and Attribute Subterfuge < 8
    		and ProbabilitySuccess < 21
    		and ProbabilitySuccess > 10
    		inc_counter england_points 2
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 5
    		and Attribute Subterfuge < 8
    		and ProbabilitySuccess < 11
    		inc_counter england_points 3
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 7
    		and Attribute Subterfuge < 10
    		and ProbabilitySuccess < 41
    		and ProbabilitySuccess > 25
    		inc_counter england_points 1
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 7
    		and Attribute Subterfuge < 10
    		and ProbabilitySuccess < 26
    		and ProbabilitySuccess > 10
    		inc_counter england_points 2
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 7
    		and Attribute Subterfuge < 10
    		and ProbabilitySuccess =< 21
    		and ProbabilitySuccess > 15
    		inc_counter england_points 3
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge > 7
    		and Attribute Subterfuge < 10
    		and ProbabilitySuccess < 6
    		inc_counter england_points 4
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 41
    		and ProbabilitySuccess > 30
    		inc_counter england_points 1
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 31
    		and ProbabilitySuccess > 20
    		inc_counter england_points 2
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 21
    		and ProbabilitySuccess > 10
    		inc_counter england_points 3
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 11
    		and ProbabilitySuccess > 5
    		inc_counter england_points 4
    	end_monitor
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		and Attribute Subterfuge = 10
    		and ProbabilitySuccess < 6
    		inc_counter england_points 5
    	end_monitor
    And just waiting to hear whether 420 event monitors will cause performance problems before moving on to the next bits. However correct it turns out to be, it would be foolish to assume performance problems (like I have been doing) or test for them if someone can tell me.

    edit:

    I've just worked out that I've hit 690 event_monitors, not 420

    Well that sucks, if this scripting stuff can't achieve exactly what I want then I will change what I want as required...
    Last edited by Taiji; August 20, 2009 at 03:14 PM.

  19. #19

    Default Re: My idea, what do you reckon?

    I wonder why the if statements arent working. I have not tested the script myself, only suggested things id personally try doing. I guess a little research is in order... -Checks the docudemons-... I think i may have found the culprit...or culprits as the case may be...

    The event you are monitoring is MissionFinished. Which exports (meaning the condition must have the trigger requirement of) faction, mission_details... Where as you are using AgentType (Which has a trigger requirement of character_record)... Actually you are using multiple conditions such as:

    AgentType spy
    and FactionIsLocal
    and SpyMission
    and TargetFactionType england
    and MissionSuccessLevel

    All of which must have the trigger requirement of either faction or mission_details. The following shows you each one that will work...

    AgentType uses character_record
    FactionIsLocal uses faction
    SpyMission <<<<<< This is an EVENT not a condition...
    TargetFactionType uses faction
    MissionSuccessLevel uses mission_success_level

    As you can see, only 2 of them will work with MissionFinished. monitoring the event MissionFinished is severely limited for this script. You can not use all those conditions with it. The mission_details only allows TWO conditions (MissionID & PaybackID)... there are numerous conditions that can use faction... It is kind of strange that MissionFinished and MissionSuccessLevel cant be used together... Logicaly you would think they should, both ARE referring to a mission are they not, one to a mission being finished and one to the success of a finished mission... LOL... but they do not work together...

    So what to do... I would suggest, if you havent already, download GED's ultimate docudemons. They supply everything you need. If you need help understanding how to use it, just let me know.

    Now back to your scipt... I have added comments in colour above each line it refers to to help explain the reasoning...

    Try...

    Ok, we are going to monitor a SpyMission, which exports nc_character_record, character_record, faction, region_id, character_type, target_faction, mission_success_level, target_religion (- Every condition in the monitor event MUST use one of those requirements)
    monitor_event SpyMission AgentType spy
    I just want to add that it should be possible to remove the AgentType spy simply because if we are already only monitoring a spying mission who else is going to undertake it other than a spy?... if you catch my drift...

    Lets make sure that only spies owned by the player are affected (we can always work on the script later for the AI)... this requires character trigger... so is good to use with SpyMission
    and CharacterIsLocal

    This condition will now only trigger true if the players faction is conducting a spying mission against england (you would simply re-create the entire script for each faction you wish to incorporate into your script)... This requires faction which is fine with SpyMission
    and TargetFactionType england

    Only spy missions that are greater then partly successful will trigger the script with this... this requires mission_success_level which is exported by SpyMission...
    and MissionSuccessLevel > partly_successful

    The first of our if statements. The way you had them is fine. Both conditions Attribute and ProbabilitySuccess require character_record which is one of the triggers that our monitor_event exports (SpyMission)
    if I_EventCounter research_accepted = 1
    and Attribute Subterfuge = 4
    and ProbabilitySuccess < 15
    and ProbabilitySuccess > 5
    inc_counter england_points 1
    end_if

    You will note that any condition beginning with I_ uses NO trigger requirements. Simply because they are suppose to be used for IF statements. You can use them elsewhere as normal conditions, but thoroughly test the script when you do)... Basically, the I_EventCounter can be used in any monitor because it relies on no requirement to be used like other conditions...

    So the script without the explanations...

    monitor_event SpyMission AgentType spy
    and CharacterIsLocal
    and TargetFactionType england
    and MissionSuccessLevel > partly_successful
    if I_EventCounter research_accepted = 1
    and Attribute Subterfuge = 4
    and ProbabilitySuccess < 15
    and ProbabilitySuccess > 5
    inc_counter england_points 1
    end_if
    the rest of your if statements...
    end_monitor

    Now before you test this... test it with just one IF statement. if it doesnt work, test it by removing one condition at a time until it does work... I have not tested it, but there i see no reason why it shouldnt...

    Let me know how that works out. And i hope it helps you out...

    Cheers.
    ...longbows, in skilled hands, could reach further than trebuchets...

  20. #20
    /|\/|\/|\/|\/|\/|\/
    Join Date
    Jun 2005
    Posts
    10,770

    Default Re: My idea, what do you reckon?

    OK, wow! I really appreciate the effort you've gone to there, thankyou!

    Certainly helps me understand stuff better

    The problem with this:

    monitor_event SpyMission AgentType spy
    and CharacterIsLocal
    and TargetFactionType england
    and MissionSuccessLevel > partly_successful
    if I_EventCounter research_accepted = 1
    and Attribute Subterfuge = 4
    and ProbabilitySuccess < 15
    and ProbabilitySuccess > 5
    inc_counter england_points 1
    end_if
    the rest of your if statements...
    end_monitor

    Is that the IF statement doesn't seem to carry through the character record or details of the mission, so attribute and probability have nothing to go on. I can't remember what the error code says exactly but it's something like "i_eventcounter does not export a report". Maybe I should try using I_comparecounter... just occured to me... but I am babbling... I'll shut up...

    Edit:

    To clarify, I've found with this

    monitor_event SpyMission FactionIsLocal
    and TargetFactionType england
    and MissionSucceeded
    and Attribute Subterfuge = 10
    and ProbabilitySuccess < 6
    inc_counter england_points 5
    end_monitor

    it works perfectly but

    monitor_event SpyMission FactionIsLocal
    and TargetFactionType england
    and MissionSucceeded
    if I_EventCounter research_accepted = 1
    and Attribute Subterfuge = 10
    and ProbabilitySuccess < 6
    inc_counter england_points 5
    end_if
    end_monitor

    will return the error about 'attribute' requiring a character record.

    I wonder if this will work or if I have tested it already and found it hasn't... (I have done a hell of a lot of unsuccessful testing and I don't keep much in the way of notes.)

    monitor_event SpyMission FactionIsLocal
    and TargetFactionType england
    and MissionSucceeded
    if I_EventCounter research_accepted = 1
    and spymission
    and Attribute Subterfuge = 10
    and ProbabilitySuccess < 6
    inc_counter england_points 5
    end_if
    end_monitor

    At least I know that event has what attribute needs... I will test it (probably for the second time lol).

    edit:

    Computer says no. Or rather it says:

    'Condition parser doesn't recognise this token: SpyMission'

    So that's not gonna work, let's try without spymission again...

    Ah no it flags the error anyway; '<character_record> is unavailable from event <>' is what it says about the line which 'inc_counter england_points 5' is on. The previous lines require a character record.

    I'll try without the added SpyMission to make sure...

    edit:

    So with

    monitor_event SpyMission FactionIsLocal
    and TargetFactionType england
    and MissionSucceeded
    if I_EventCounter research_accepted = 1
    and Attribute Subterfuge = 10
    and ProbabilitySuccess < 6
    inc_counter england_points 5 (this is line 54377 in the error code below)
    end_if
    end_monitor

    Computer says...

    15:49:50.156 [game.script] [error] Script execution error for <if>, at line 54377, in mods/DLV_ext/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    <character_record> is unavailable from event <>
    when testing <Attribute> condition

    Or 'no' in other words.

    edit:

    I tried this:

    Code:
    	monitor_event PreFactionTurnStart FactionIsLocal
    		if I_EventCounter research_accepted = 1
    			set_counter research 1
    		end_if
    	end_monitor
    
    	monitor_event SpyMission FactionIsLocal
    		and TargetFactionType england
    		and MissionSucceeded
    		if I_CompareCounter research = 1
    			and Attribute Subterfuge = 2
    			and ProbabilitySuccess < 99
    				inc_counter england_points 5
    		end_if
    	end_monitor
    But it said this:

    16:27:52.906 [game.script] [error] Script execution error for <if>, at line 54384, in mods/DLV_ext/data/world/maps/campaign/imperial_campaign/campaign_script.txt:
    <character_record> is unavailable from event <>
    when testing <Attribute> condition

    So i_comparecounter makes no difference, same issue with no report for attribute to work with....
    Last edited by Taiji; August 21, 2009 at 10:30 AM.

Page 1 of 2 12 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
  •