Page 1 of 1

Adding bonus or object during play?

Posted: Fri Apr 06, 2012 12:29 pm
by louism
Is it possible to add or remove a bonus during play (ex: removing artillery bonus after a side lose an observation point)
If so, what is the script command or the script mechanics?
Maybe there is something to be done with SetBonusBaseValue(name, side, value)? I must admit that I do not understand how that command is supposed to work...


Same thing for objects. Is it possible to place or remove an object on the map during play (ex: to randomize the position of some objects during the prebattle setup)? If yes, what is the script command?

I read the STUB_Engine_docs and searched the forum for that topics and could not find it. I also cannot recall any scenario that does it. I am not very optimistic on that one...

Thanks.

Re: Adding bonus or object during play?

Posted: Fri Apr 06, 2012 9:03 pm
by pipfromslitherine
Check out the Merr random map scenarios. They contain code by Merr and Amaris that does exactly what you are thinking about - there are a number of functions for programatically adding tiles or objects. Link below.

To turn on and off bonuses, you would need to tweak the bonus script in your own campaign and have it check a flag (using either Get/SetScriptGlobal or using a universal variable) to determine whether to show or disable the onscreen icon.

The most up to date script command documentation can always be found in the My Documents/My Games/BBCBA/AUTODOCS folder in the BattleScript.txt file. This is generated by the game and is thus always up to date.

viewtopic.php?f=105&t=28686

Cheers

Pip

Re: Adding bonus or object during play?

Posted: Sat Apr 07, 2012 12:50 pm
by louism
Thanks about the AUTODOCS tip!
There are new (?) commands that do exactly what I needed (PlaceObject, DeleteObject)