Jagger
AGEod Grognard
Posts: 949
Joined: Sat Mar 18, 2006 2:31 pm

Removing units from the force pool

Thu Nov 22, 2007 5:46 am

I have tried to remove unit types from the force pool using the changeunitpool command. I don't want to remove existing units from the pool. I just want to end the ability to purchase certain units.

I have tried the value 0 but apparantly the numbers are cumulative. Then I tried a negative number, -10, to remove units from the force pool. No luck.

Is it possible to remove a unit type from the force pool using changeunitpool command?

Or is there another command I should be using?

User avatar
McNaughton
Posts: 2766
Joined: Wed Mar 21, 2007 8:47 pm
Location: Toronto, Canada

Thu Nov 22, 2007 12:34 pm

A negative value does work, but, it gives some errors (it puts an odd brigade able to be built). I believe that the error happens due to possibly having an incorrect negative rating (you can only get as low as zero, any negative production will give an error). Also, it may have something to do if any units are already on the field. Anyway, I too would like some information on this if it is possible..

User avatar
Pocus
Posts: 25661
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Thu Nov 22, 2007 12:58 pm

I intent to check it yes.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

User avatar
Pocus
Posts: 25661
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Thu Nov 22, 2007 4:23 pm

Can you provide me with an event + a saved game where the situation is not working, a turnkey situation would save me some time: support@ageod.com
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

Jagger
AGEod Grognard
Posts: 949
Joined: Sat Mar 18, 2006 2:31 pm

Thu Nov 22, 2007 4:47 pm

Pocus wrote:Can you provide me with an event + a saved game where the situation is not working, a turnkey situation would save me some time: support@ageod.com


Actually the event I am using is with my modded game including new units and models. So it wouldn't work with your unmodded game.

However here is the event I am using which demonstrates my last attempt to remove units from the force pool. This event using -10. I also tried 0. Note that one of the units picked for removal was the Missouri siege guns with probably no more than 2 or 3 units total in force pool. So -10 should easily remove the total number of siege guns that might be available in the force pool. Although I think -10 is enough to remove all units available in force pool for all gun batteries picked for removal.

SelectFaction = $CSA
SelectRegion = $Prince George's, MD
StartEvent = evt_nam_CSA_62CSAArtBrigades|1|1|NULL|NULL|$Richmond, Va|NULL

Conditions
FixedDate = 1861/05/18 (test date)

Actions
DescEvent = evt_desc_CSA_62CSAArtBrigades
ChangeUnitPool = $uni_CSA_ART6SC;1
ChangeUnitPool = $uni_CSA_ART6NC;1
ChangeUnitPool = $uni_CSA_ART6GA;1
ChangeUnitPool = $uni_CSA_ART6AL;1
ChangeUnitPool = $uni_CSA_ART6LA;1
ChangeUnitPool = $uni_CSA_ART6MS;1
ChangeUnitPool = $uni_CSA_ART3MO;-10
ChangeUnitPool = $uni_CSA_ART4TN;-10
ChangeUnitPool = $uni_CSA_SieMO;-10

EndEvent


I can introduce a similiar event into the original game and send the results to you. Although it will be a few days before I can send it. I am going to be hitting the road in about 10 minutes.

Jagger
AGEod Grognard
Posts: 949
Joined: Sat Mar 18, 2006 2:31 pm

Thu Nov 22, 2007 4:53 pm

McNaughton wrote:A negative value does work, but, it gives some errors (it puts an odd brigade able to be built). I believe that the error happens due to possibly having an incorrect negative rating (you can only get as low as zero, any negative production will give an error). Also, it may have something to do if any units are already on the field. Anyway, I too would like some information on this if it is possible..


I noticed earlier I would sometimes get a Virginia brigade appearing out of nowhere. But I think the problem was related to an alias error. At least, I haven't seen that problem since the alias error was fixed.

User avatar
Pocus
Posts: 25661
Joined: Wed Oct 19, 2005 7:37 am
Location: Lyon (France)

Fri Nov 23, 2007 4:04 pm

No errors for me.
Added this event to USA events:

SelectFaction = $USA
SelectRegion = $Prince George's, MD
StartEvent = evt_nam_fake|1|1|NULL|NULL|$Richmond, Va|NULL

Conditions
MinDate = 1861/01/01

Actions
ChangeUnitPool = $uni_USA_Mar;-100
EndEvent

The code cleared the entry and it got reported by script report:

Line 2335: SelectFactions, 1 Faction selected: Stati Uniti d'America
Line 2337: Started processing event: evt_nam_fake
Line 2337: This event is not yet referenced, base number of allowed occurences 1
Line 2340: Min date evaluated: 1861/01/01 converted to turn 2665 current turn 2695 True
Line 2342: Entering triggered actions for event evt_nam_fake
Line 2343: ChangeUnitPool Stati Uniti d'America New Force Pool for unit (UID/Name) is 237 Marines 0
Line 2344: Finished processing event: evt_nam_fake

The end result, no more marines available (I was in Italian version, don't bother) :

Image

Always check scriptreport, you can get much infos from it.
Image


Hofstadter's Law: "It always takes longer than you expect, even when you take into account Hofstadter's law."

Return to “Modding AGE engine games”

Who is online

Users browsing this forum: No registered users and 8 guests