nice update! I still have a lot of 7DRLs to review but I wanted to poke around with the updates. GUI seems a good deal less buggy (though, I didn’t tinker with the terminal much).
I have some theories on how the scripting + uploading works, let me know if I’m off base..
- the entire entity script is executed again (either always for all entities, or at least at the time of upload)
- Each round when the enemies move, the
stepfunction of an entity receives as args a entity (“self”?) and a list of tiles the entity can see. - I don’t really understand how the wander code works, it seems like there’s a bit of magic sauce in there to produce a random selection of adjacent, walkable tiles.
stepreturns a map, which gives a game action (like “heal” or “attack”) and a tile coordinate to do it to.
Which means:
- you can change the entity’s target tag (first line, usually, “player” -> some other enemy type) and they’ll pursue those instead.
- enemies can’t pursue their own type, because they’ll find themselves at the center of their own FOV, and never move. I tried changing the tag for the hacked entity at the start of each call to
step(“spideybro” or the like) but I must have done it wrong orentis read only. - You can stop a food from despawning, but you can’t change the value restored (seemingly an update from the 7DRL, the health restoration value isn’t an argument the foods have anymore). (I hacked drink and dog, if it still was then I missed it.)
- enemies can heal you instead of hit you, by changing the action they perform when in their “attack” mode.
I’m looking forward to some other interactions (maybe docs for the cmd output map? Could my entities perhaps use the steps, and resume their hacked programs automatically once I follow them down?)
I imagine I would eventually write scripts for an enemy to follow me as long as only “bros” (turned enemies) are around, but engage others. I’d also like to do some stuff like “langston’s ant” or “bugs barfing pheromones onto the map” to try to literally stand wherever I spawn until somebody finds the exit. It may not require adding info to the map (just follow the left-hand-on-the-wall rule?) but multiple entities could split the search work if they had a way to communicate. An actual “wifi” or “shared map” for entities would enable other advanced behavior.
[edit:] I guess my specific requests for this idea are: some spawn ability (maybe take a filename as an argument, so I can write a ‘pheremone.:’ script) and an example for either reading/writing variables from an entity in fov, or another map passed as a variable to step which is shared by every entity and persists between rounds.
I doubt any of this would ever be necessary to win the game, but that’s not how sandboxes work…!