Help with a couple of events

Discuss and post your mods and scenarios here for others to download.

Moderator: Vic

Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

Help with a couple of events

Post by Grymme »

I need help with a couple of events in my supersized sovietafghan war scenario.

Event nr 1
The resistance coalition didnt use much armoured material. What they had they mostly aquired through defecting government units and capturing soviet material.

To simulate this i would like an event that checks if soviet losses in armour are smaller than existing resistance coalition armoured forces. If the resistance has more armour than the soviets have lost the building of armour for the soviets become expensive/impassable. The problem i am having is that there is and exe-disable-itemgroup but there is no check-itemgroup-losses. I can check-regime-specific sft-losses or check-regime-total-losses. But i want the event to follow through inspite of research.

So.... any thoughts?

Event nr 2
There are some 13 peoplegroups in the scenario. Pashtuns, tajiks, turkmens, uzbeks, pachai, baloch etc. I want there to be a war for the "hearts and minds" of the different peoples. So i want the soviets to be able to influence the "fight-fore" and "produce for" of the respective peoples. But if the Soviets influence one people it should at the same time influence the people to produce worse for the other side". Also there seems only to be exec-change-percent of a peoples battle/prod there doesnt seem to be an exec-change-percent unit command.

So any thoughts?

Also other ideas are welcome. So far the events include
1. Sabotage in the larger cities
2. provincial uprisings
3. political reprocutions from intrusion into pakistan/iran
4. Winter weather
4. Trying to influence Hezbollah to declare war on the invaders
5. a monthly resistance intelligence briefing
6. Declaring Jihad
7. Establishingg the Sarandoy militia
8. USSR policy change
9. US aid to Mujaheddin
10. Joining of 2 different guerilla movements that are AI controlled at the start
11. USSR military advisors performing Intel OPs in the different provinces.

But i would like a rich tapestry of events. So any other ideas (especially with thoughts on implementing them would be welcome. (will cross post this in the afghan mod thread).

My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
User avatar
Barthheart
Posts: 3080
Joined: Tue Jul 20, 2004 3:16 pm
Location: Nepean, Ontario

RE: Help with a couple of events

Post by Barthheart »

Hmmmm...

For the first one there is a way to keep track of losses with a RegimeVar. In each SFType under Statistics 1 near the bottom of the list there is a command to increment a regimevar every time one of that SFTypes is destroyed. Just set that for all types/levels of Soviet armour to the same regimevar of the coalition.

Is that clear?[X(]

As for the second I'm not sure what you want to have happen when....
Life is not a journey to the grave with the intention of arriving safely in a pretty & well preserved body,
but rather to skid in broadside, totally worn out & proclaiming "WOW, what a ride!"
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

I think so. I have changed all of them from -1 to 1. Then i have set the Resistance Coalition Regimevar 1=1
 
Can i then set a 1 in the  itemtype regimeslot cost needed?
 
I will explain 2 when i get 1 :) Thanks for your help so far.
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

delete that. I instead let producing a light tank add 1 to regimeslot 2 which i named Deployed armour. Then i check if destroyed armour is bigger than deployed armour. If not then tanks cannot be produced. Will check if it works.
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

hmm.. the regime variables seem to work. But maybe not the event that checks and changes the itemgroup availability. here is a screenshot.

Image
Attachments
event.jpg
event.jpg (144.96 KiB) Viewed 291 times
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
User avatar
Barthheart
Posts: 3080
Joined: Tue Jul 20, 2004 3:16 pm
Location: Nepean, Ontario

RE: Help with a couple of events

Post by Barthheart »

[;)]
You have line 1 and 2 written backwards:

SETVAR: TempVar1 = Resistance Coalition_Destroyed armour(#1) <--- This is the way it should be. Your way your are clearing the regimevar with an empty TempVar.
Life is not a journey to the grave with the intention of arriving safely in a pretty & well preserved body,
but rather to skid in broadside, totally worn out & proclaiming "WOW, what a ride!"
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

Thanks guys. I might do something about that poppy thing also. Maybe when there is early winter it also results in a bad poppy harvest impacting production for the resistance coalition.
&nbsp;
As for the armour cost event.&nbsp;The counting works now. And the disabeling. Unfortunatly the enabling back doesnt work.&nbsp;It seems&nbsp;that the "exec-set-itemtype-by people group only&nbsp;allows a people to produce an&nbsp;itemtype. But since there is a command that disallows&nbsp;the&nbsp;production of it altogether it doesnt help.
&nbsp;
I need&nbsp;something that either enables it back or makes the disablement temporary. Any thoughts?&nbsp;&nbsp;
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Lunaticus_matrixforum
Posts: 834
Joined: Wed Dec 31, 2008 3:50 pm
Location: Germany

RE: Help with a couple of events

Post by Lunaticus_matrixforum »

Hi Grymme,
as per the docs you can use ExecSetItemByPeopleGroup to allow individual items be allowed to be produced (1) or forbid this(0). It might however be some work to implement for a lot of items. Also you need to set up different peoplegroups, too....
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

Thanks lunaticus.
&nbsp;
Actually it doesnt seem so bloody. There is a setting for all peoples. There was only 19 SFTs and i turn them all of during resistance turn (if conditions are met) and then turn them on again during USSR/DRA turn. Testing the event now.
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

So, i think i got the opium event down, sort of. Now i need another event.

The purposte of the event is to simulate the effect of resistance propaganda on government troops.

The thought is something like this

Check if number of units with Mullahs in certain province is bigger than number of units with Military advisors (this i have done.
Check random percent (no problem)
- Punish troops from certain regime and certain type of unit and/or people (government units have both special SFTs and special peoples) by reducing readiness/morale or removing some SFTs.

So what i basicly need is some sort of loop that only reduces the readiness of a certain regimes peoples or SFTs in a certain area. Any thoughts?

My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Lunaticus_matrixforum
Posts: 834
Joined: Wed Dec 31, 2008 3:50 pm
Location: Germany

RE: Help with a couple of events

Post by Lunaticus_matrixforum »

Mmmh the event you describe is possible I think but will need a trick afaik.
The easier command is ExecReadinessLossByArea where you can set the Slot for a whole provice occupied by a regime and hit all of them with a certain percentage and probability of readiness loss.
The other option you might like to try is the command ExecLTReadinessLoss(regnr, pplnr, rdnloss%, Terrain Type Nr#) to effect a readiness loss for units of a certain regime and a certain peoplo on a certain Terrrain Type. This will probably only work if you set up a dummy area type and convert the hexes you want to hit temporarily to this dummy terrain, hit the hex and then switch back the terrain.
Might be easier to use the first and maybe check for each hex if it belongs to the regime in question and check if the Mullahs have enough influence and check if there are some units of the people who are influenced are present and then hit the whole hex but the result would be slightly different...
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

Thanks Lunaticus. Have i mentioned that you are credited in my briefing for the Vietnam Scenario. Much more deserved than your credit to me in the space mod scenario. You will surely earn a credit in the Afghan one as well.&nbsp;
&nbsp;
The first sollution seems simple, but it doesnt have a button for regime, so it would effect all units, not only regime controlled. Do you know how to only check for regime controlled hexes?
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Lunaticus_matrixforum
Posts: 834
Joined: Wed Dec 31, 2008 3:50 pm
Location: Germany

RE: Help with a couple of events

Post by Lunaticus_matrixforum »

Thanks Grymme. As I said I very much enjoyed the Vietnam scenario, feels very atmospheric and plays very intense and differently from other scenarios. And I am looking forward to see how this plays. And you should not underestimate the importance of the graphical advice, I think it made the game much better. Sometimes the most important thing is to understand what flies and what does not. I also know at least 5 things I am going to change after the first testgame and still collecting...

As to how to use the first event it might be done as follows:
Loop tempvar 1 from 0 to checkmapwidth
Loop tempvar 2 from 0 to checkmaphight
&nbsp; setvar tempvar 3 = checkslot (x,y, a) ( with a being the slot describing provinces)
&nbsp; checkSFType in area (a, tempvar3, sftype, regime) > checkSFType in area (a, tempvar3, sftype, regime) (more Mullahs than Military advisors)
&nbsp; checkHexOwner (x,y) = Soviet
&nbsp; execsetslot (x,y,9,1) (assuming 9 is an unused slot)
&nbsp; checkUnitsfrom (9,1,Soviet, Soviet) > 0 (here some logic might be needed depending on when the readiness loss should apply. You will need to calculate how many units from&nbsp;&nbsp;&nbsp; troublesome people are there but with this command you have direct access to the hex in question)
&nbsp; &nbsp; &nbsp; ExecReadinessLossByArea (9,1, loss, probability)
Endcheck
&nbsp; execsetslot (x,y,9,0)
&nbsp; endcheck
&nbsp;endcheck
endloop
endloop
&nbsp;
Good Luck modding
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

Ahh. i think wat i was missing was the check units from command.

Here is where i am at for now.

Image
Attachments
burjakevent.jpg
burjakevent.jpg (109.61 KiB) Viewed 291 times
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Lunaticus_matrixforum
Posts: 834
Joined: Wed Dec 31, 2008 3:50 pm
Location: Germany

RE: Help with a couple of events

Post by Lunaticus_matrixforum »

Two quick comments:
In line 9 you check the whole province for units, not an individual hex.
Similarly with the Execreadinessloss you hit the whole province. This is done once for each unit so 100% readiness loss if the soviets have at least for hexes.

If you want to go for damage on individual hexes I think you need to set a slot which you set to 1 for the hex in question, then do things for the hex and set the slot back to 0....

Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

Thanks. What i dont understand from your description is what to put in the place of X and Y in lines 5,6 and 10.

Also when in the end you set it to 9,1 and 9,0 i guss you just create a temporary area and remove it. am i right?

I hate coding, it just doesnt come naturally tom me :(. But i like the result.

Here is my latest atempt, just filled it in as you describet, except dont know what to put in those X and Y places.

Image
Attachments
burjak event.jpg
burjak event.jpg (154.16 KiB) Viewed 291 times
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
User avatar
Barthheart
Posts: 3080
Joined: Tue Jul 20, 2004 3:16 pm
Location: Nepean, Ontario

RE: Help with a couple of events

Post by Barthheart »

Put your Looper vars - TempVar1 is X and TempVar2 is Y.

The loopers are stepping through each hex on the map. When you get to a hex that you want to affect ie at TempVar1,Tempvar2 then you have your map coordinates for your actions.
Life is not a journey to the grave with the intention of arriving safely in a pretty & well preserved body,
but rather to skid in broadside, totally worn out & proclaiming "WOW, what a ride!"
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

Thanks (when i think about it i probably knew that)

Here is what it looks like now. Will check it out.

I guess i could use the same 9:1 and 9:0 slots for all provinces since they are only temporary slots. Right?



Image
Attachments
burjak event.jpg
burjak event.jpg (160.33 KiB) Viewed 291 times
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Lunaticus_matrixforum
Posts: 834
Joined: Wed Dec 31, 2008 3:50 pm
Location: Germany

RE: Help with a couple of events

Post by Lunaticus_matrixforum »

Yes, looks good. If you reset slot 9 you can reuse it for all provinces (or events)...
Grymme
Posts: 1776
Joined: Sun Dec 16, 2007 5:06 pm
Contact:

RE: Help with a couple of events

Post by Grymme »

Tried it, it seemed to check for the entire country. Round took like 5 minutes to check (without any AI). Any thoughts on what could be wrong?

End the event code looks strange. You set a tempvar3. But you never use it anywhere.
My Advanced Tactics Mod page
http://atgscenarios.wordpress.com

30+ scenarios, maps and mods for AT and AT:G
Post Reply

Return to “Mods and Scenarios”