Javascript API documentation
Re: Javascript API documentation
We have a new alliancesType constant, which is ALLIANCES_UNSHARED; it describes a new game mode that is similar to ALLIANCES_TEAMS but research is no longer shared or transfered between allies.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
- Shadow Wolf TJC
- Regular
- Posts: 1047
- Joined: 16 Apr 2011, 05:12
- Location: Raleigh, NC
Re: Javascript API documentation
It's OK. Development of Contingency is currently focusing on the more stable 3.1 versions. It hasn't been ported to 3.2 yet, and from the looks of things, I may have to wait for 3.2 to stabilize before porting it over.aubergine wrote:rules.js uses alliancesType for victory conditions - so things like Enhanced SitRep Mod and Contingency Mod might be affected, but it should be trivial to make them adapt to the change. Speaking of which, what exactly is the change - been frantic IRL recently and not been keeping up with the qtscript changes...
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
Re: Javascript API documentation
23da1f18915bd0e7c811672fffb3f39944ab5669 probably wasn't a good idea i was sure i was fixing a typo, and then i thought that 3.1 users need to be able to read the docs too
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
There will probably be more people learning the scripting stuff and the docs when 3.2 is releasedNoQ wrote:23da1f18915bd0e7c811672fffb3f39944ab5669 probably wasn't a good idea i was sure i was fixing a typo, and then i thought that 3.1 users need to be able to read the docs too
Re: Javascript API documentation
Two new scripting functions added to support temporary vision (like the scanner sweep in starcraft 2):
addSpotter(x, y, player, range, type, expiry) -- Add an invisible viewer at a given position for given player that shows map in given range. type is zero for vision reveal, or one for radar reveal. The difference is that a radar reveal can be obstructed by ECM jammers. expiry, if non-zero, is the game time at which the spotter shall automatically be removed. The function returns a unique ID that can be used to remove the spotter with removeSpotter.
removeSpotter(id) -- Remove a spotter given its unique ID.
addSpotter(x, y, player, range, type, expiry) -- Add an invisible viewer at a given position for given player that shows map in given range. type is zero for vision reveal, or one for radar reveal. The difference is that a radar reveal can be obstructed by ECM jammers. expiry, if non-zero, is the game time at which the spotter shall automatically be removed. The function returns a unique ID that can be used to remove the spotter with removeSpotter.
removeSpotter(id) -- Remove a spotter given its unique ID.
- Shadow Wolf TJC
- Regular
- Posts: 1047
- Joined: 16 Apr 2011, 05:12
- Location: Raleigh, NC
Re: Javascript API documentation
Neat, though is there going to be a way for modders to create their own custom support powers or superweapons? Perhaps an eventStructureActivated() function would be needed whenever a support power or superweapon (including a LasSat Command Post) is activated? I'd imagine that the source code would also need to be modified to allow modders to create additional support/superweapon structures, each with their own powers or weapons (such as a massive EMP blast).
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
Re: Javascript API documentation
Yes. I'm working toward it.Shadow Wolf TJC wrote:Neat, though is there going to be a way for modders to create their own custom support powers or superweapons?
Re: Javascript API documentation
9ac0e6ae4c87b877982564dfc479b3cb61dc24ab <=== does it mean i need to re-lecture the AIs on how to produce cyborgs? Should be quite possible, just asking.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
Hmm. Yes. I did not think of that. No way around it, though.NoQ wrote: 9ac0e6ae4c87b877982564dfc479b3cb61dc24ab <=== does it mean i need to re-lecture the AIs on how to produce cyborgs? Should be quite possible, just asking.
Re: Javascript API documentation
Maybe we can make aliases for items in ini files?
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
Something likeand add one more add-on to the wzconfig wrapper
Code: Select all
[CybRotMgGrd]
aliasFor = CyborgLightBody
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
May be you need just js objectNoQ wrote:Something likeand add one more add-on to the wzconfig wrapperCode: Select all
[CybRotMgGrd] aliasFor = CyborgLightBody
Code: Select all
var aliases = {'CybRotMgGrd': 'CyborgLightBody'}
http://addons.wz2100.net/ developer
Re: Javascript API documentation
I think maintaining aliases in ini files is easier than maintaining a complicated separate js file that overrides multiple API functions. I'd also surely go with js if i need to make my scripts work on both versions, but the idea is mostly about the base game: since we aim at "scripts never break", i thought it would be a useful way of keeping AIs sane after balance changes that involve adding or removing stuff.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Javascript API documentation
Wouldn't it be easier to just pass in a list of bodies to buildDroid(), with CybRotMgGrd etc as the first, and CyborgLightBody / CyborgHeavyBody as the second?
I believe it will just spit out a warning if it is given a body that does not exist, then select the next one in the list...
I believe it will just spit out a warning if it is given a body that does not exist, then select the next one in the list...
Re: Javascript API documentation
I repeat, I have no problem with fixing my scripts. I'm having problems with the fact that they need to be fixed every time things like that happen.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam