Purchase Script

Please post here for questions and discussion about modding for Strategic Command.
Post Reply
User avatar
Gilber
Posts: 253
Joined: Wed Jun 13, 2018 10:16 am
Location: Luxembourg

Purchase Script

Post by Gilber »

Hello,

For purchase scripts.
In what order does the AI ​​perform its tests?
The AI ​​starts with a percentage test for # UNIT_ID_0 = HQ then goes to # UNIT_ID_1 = Garrison and so on and stops when there is no MPP left?

Gilles
Gilles
User avatar
Hubert Cater
Posts: 5861
Joined: Mon Jul 22, 2013 11:42 am
Contact:

RE: Purchase Script

Post by Hubert Cater »

Hi Gilber,

It actually randomizes the list of UNIT types or IDs each time it reads a PURCHASE event and then goes through the event with the randomized list. This way it doesn't go in order from HQs to Garrison as you thought, and ensures a more even/random set of purchases each time through.

Beyond that the only priorities it sets is on any unit with an '*' in its name as it means this unit is re-purchaseable at a discount etc.

Hubert
User avatar
sPzAbt653
Posts: 9936
Joined: Thu May 03, 2007 7:11 am
Location: east coast, usa

RE: Purchase Script

Post by sPzAbt653 »

If I am playing as the Axis against the computer run Allies, and I switch sides in 1944 and see that the USA has 15,000 MPP's and lots of unbuilt units, would you suggest to increase the percentage that those unbuilt units might be built in the Purchase Script, or is there something else that has an influence? [This is with 653N, but it uses all of the original scripts from the stock 1939 campaign].
User avatar
Hubert Cater
Posts: 5861
Joined: Mon Jul 22, 2013 11:42 am
Contact:

RE: Purchase Script

Post by Hubert Cater »

Yes, as long as the % chance is greater than 0 then those units will have a chance of being built.
User avatar
Gilber
Posts: 253
Joined: Wed Jun 13, 2018 10:16 am
Location: Luxembourg

RE: Purchase Script

Post by Gilber »

Hello,

Thanks hubert for your answer.


I would like to do one or more scripts to buy 6 Corpsand that stops definitely after.
The difficulty is that we do not know when we are trying to buy if there is enough MPP.
And using # SKIP_FUNDS_CHECK = 0 is unsatisfactory because it comes down to buying without spending MPP.
Someone would have any idea ?

Gilles
Gilles
User avatar
sPzAbt653
Posts: 9936
Joined: Thu May 03, 2007 7:11 am
Location: east coast, usa

RE: Purchase Script

Post by sPzAbt653 »

Decision Event to Purchase Corps for 150 MPP's each, if YES then Unit Script for Unit(s) to arrive. Any good ?
Post Reply

Return to “Scenario Design and Modding”