Skip to content
This repository has been archived by the owner on Sep 29, 2018. It is now read-only.

How is the noSpawn hook supposed to work? #3

Open
crowder opened this issue Aug 13, 2015 · 3 comments
Open

How is the noSpawn hook supposed to work? #3

crowder opened this issue Aug 13, 2015 · 3 comments

Comments

@crowder
Copy link
Contributor

crowder commented Aug 13, 2015

An example in your documentation would be awesome.

@avdg
Copy link
Owner

avdg commented Aug 13, 2015

It's basically a hook that gets triggered when there is nothing to spawn when a spawn can spawn something.

@crowder
Copy link
Contributor Author

crowder commented Aug 13, 2015

Right, but what is it meant to return?

@avdg
Copy link
Owner

avdg commented Aug 13, 2015

No, its just a hook with some parameters to execute the needed information. First being the spawn, the second being a function to spawn a creep even though you can use the spawn itself to make a creep spawn.

The custom spawn function is just to convert role information into a creep, which may need some documentation later on. But for the moment being, there are lots of other stuff I like to tweak as well and things can be very unstable (it's very fresh code).

It's being triggered here:

AI.emit("noSpawn", spawn, function(creep) { return createCreep(spawn, creep); });

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants