I'm also looking for a way to find out how many modules a structure has.aubergine wrote:How do I find out if a given droid object is a VTOL or not? I know it will be defined in the .droidType property, but can't find a list of possible values for that property :s
Help with creating an AI using JS
Re: Help with creating an AI using JS
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Help with creating an AI using JS
Anyhow, here's my current progress.
I wasn't yet able to figure out how to make modules properly (so don't read module building code plz ), and i was too lazy to add VTOL code, but here's a hopefully-working non-cheating javascript AI that is able to defeat a medium Nexus bot in certain cases (:
I wasn't yet able to figure out how to make modules properly (so don't read module building code plz ), and i was too lazy to add VTOL code, but here's a hopefully-working non-cheating javascript AI that is able to defeat a medium Nexus bot in certain cases (:
- Attachments
-
- nullbot-0-1.wz
- Works with latest git, install to mods/multiplay
- (4.59 KiB) Downloaded 219 times
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Help with creating an AI using JS
Do you know if there's any way to get information about the map - eg. it's size? -- Just spotted the mapWidth and mapHeight globals in the JS API docs.
Also is there any way to set the factory properties - eg. when you right click a factory you can set it so that all units it makes are "fire at long range", etc. And on units you can set them to patrol, etc.
Also is there any way to set the factory properties - eg. when you right click a factory you can set it so that all units it makes are "fire at long range", etc. And on units you can set them to patrol, etc.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Help with creating an AI using JS
The function isVTOL(droid). It is not set in .droidType. The .droidType values are now defined in the documentation.aubergine wrote:How do I find out if a given droid object is a VTOL or not? I know it will be defined in the .droidType property, but can't find a list of possible values for that property :s
Re: Help with creating an AI using JS
I just added that to relevant structures as the 'modules' property.NoQ wrote:I'm also looking for a way to find out how many modules a structure has.
Re: Help with creating an AI using JS
Would it be worth doing something similar to droid objects - eg. someDroid.isVTOL ?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Help with creating an AI using JS
@NoQ: Found an issue with Nullbot - if there is a turret near an uncaptured oil resource, nullbot churns out endless numbers of trucks and sends them to their death rather than building an army to attack with - it might make a few tanks, but doesn't reach MIN_ATTACKERS because it's too busy churning out truck lemmings.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
Re: Help with creating an AI using JS
Agreed, it needs to check for threats before building derricks.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Help with creating an AI using JS
After a git pull, nullbot-0-1.wz has started to crash with the following Floating Point Exception at the moment it is just about to complete its first lab (or maybe rather when it was just completed). What am i missing? What has changed?
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
Re: Help with creating an AI using JS
Not exactly sure why, but for some reason a feature has zero health when it is presented to the script. Don't have time to investigate much, but I have fixed the symptom, so it should no longer crash.NoQ wrote:After a git pull, nullbot-0-1.wz has started to crash with the following Floating Point Exception at the moment it is just about to complete its first lab (or maybe rather when it was just completed). What am i missing? What has changed?
Re: Help with creating an AI using JS
This must have been an oil derrick ... Ok (:
upd: working now, yeah.
upd: working now, yeah.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam