A guide to scripting methods

Discussion and help with using the in-game editor
goonsquad
Posts: 539
Joined: Fri Aug 19, 2005 11:01 am

Postby goonsquad » Wed Aug 15, 2007 6:26 am

This thread contains extremely useful information, may I respectfully request that it be stickied?

goonsquad
Posts: 539
Joined: Fri Aug 19, 2005 11:01 am

Postby goonsquad » Wed Aug 22, 2007 10:18 pm

Hieronymus wrote:CloseTradeRoute(uint inRouteIndex)
This closes the trade route identified by its world site index in the XML file. Example use:
game.CloseTradeRoute(7);
This closes world site 7. This can be used when certain specified conditions are met or randomly to reflect periodic disruptions to trade. If the site is visible then the player can re-open the trade route again by paying the appropriate price. If invisible, then it can only be opened again through OpenTradeRoute (described below). Note that trade route closure by this route does not take immediate effect - traders only stop appearing when a new year starts.


Something else I noticed when using this command is that number of units traded does not reset at year's end when the trade route is closed. So if it is re-opened during a subsequent year it will already indicate the number of units traded in the year the route was closed, thus reducing trade potential in the year it re-opens.

Correction to this: it does reset, but only when the route re-opens.
Last edited by goonsquad on Thu Aug 23, 2007 12:15 am, edited 1 time in total.

goonsquad
Posts: 539
Joined: Fri Aug 19, 2005 11:01 am

Postby goonsquad » Thu Sep 20, 2007 8:53 am

Hieronymus wrote:
StopInvasion(ref string inInvasionName, bool inStopFutureRecurrences)
This seems to perform a similar function, but is aimed at the identified invasion. The additional effect is (potentially) to stop this invasion recurring again, as directed by the Boolean flag. For example:
String invasion = mGame.RunInvasion;
bool bStop = true;
game.StopInvasion(ref invasion, bStop);


I have used this functuin in The Final Deception, and it causes the invaders to immediately stop attacking and leave the city, or else prevents the invasion arriving at all if it hasn't arrived yet.

Hieronymus
Posts: 537
Joined: Fri Dec 08, 2006 9:10 am
Location: Londinium, with the insane parakeets

Postby Hieronymus » Thu Sep 20, 2007 11:25 am

Yes I'm using in it too in Pulchritudo Vincit to stop a recurring invasion from happening again, once a particular condition is met. I'm also trying out a bit of code to limit the "circus exploit".

Norm35
Posts: 750
Joined: Wed Jun 17, 2009 2:22 am
Location: U.S.

Postby Norm35 » Fri Oct 02, 2009 6:35 pm

Does anyone know if the script techniques described in this thread apply only to Caesar 4 or to other games as well?

I tried to send a PM to Hieronymus but was unable to.

Does anyone know how I can get in touch with him?
Last edited by Norm35 on Mon Oct 05, 2009 1:02 am, edited 1 time in total.

goonsquad
Posts: 539
Joined: Fri Aug 19, 2005 11:01 am

Postby goonsquad » Mon Oct 26, 2009 9:33 pm

I think only C4. CotN uses scripting as well, Azeem's your man there, I think it is substantially different to how C4 is done. Significantly, Azeem is most proficient in CotN but won't touch C4 (AFAIK) and Hiero is the opposite, so this points to the two being very different. There may be other non-TM games using a similar scripting model.

Since many of the commands come from files within the C4 engine, I'd suggest what you read here applies only to C4. Other games using C# would use similar syntax but I'd think often different command lines.

You may be able to raise Hieronymus on CBC.
Last edited by goonsquad on Mon Oct 26, 2009 9:46 pm, edited 3 times in total.


Return to “Editing”

Who is online

Users browsing this forum: No registered users and 2 guests