|
Development Forum |
 |
| 
Ettina
 
|
10/28/2011 | |
OK, here's an idea I had. An agent that at various intervals (which can be set by the user) will scan the minds of all norns and output a file in the world's journal indicating what everyone was thinking. You know, like 'eat food', 'express machinery', that sort of thing. I'd like that for statistical analysis purposes.
On a related note, I'd also like a thing that printed out the X and Y coordinates of each norn at specified intervals, too.
How hard would those be to make? I took a peek at the Wolfling Monitor, and it looks really complicated.
By the way, I don't care if anyone steals my ideas for their own work, as long as you don't try to stop me from making my own stuff. Many ideas I mention are things I don't have the time or skill to actually do. |
 Peppery One
Papriko
    
|
10/28/2011 | |
Actually it sounds not too hard. Basically you open or create a text file in your Journal folder. You can do this with ingame commands too. Don't know which, never needed it.
Then ENUMerate through all Creatures of your choice (that way you can specify species and gender too if you'd like to) and write it to said file.
The actual thought you get this way. The following code is a minimally altered version of the one used in the CRC. We simply assume you already selected a creature:sets va00 ""
doif decn > 0
sets va00 read "Creature Actions" decn
else
sets va00 "<nothing>"
endi
adds va00 " "
doif catx attn <> ""
adds va00 catx attn
else
adds va00 "<nothing>"
endi | When you execute this, va00 contains now the current thought of your creature in the format "verb noun" in the default language your game runs at. It also replaces invalid actions and targets (such as NULL as agent the creature looks at or being asleep) are replaced with <nothing>. This nice string can be now written into your previously created file. Do not forget to include endlines, else you get one enormous single line.
Positions can be received with various commands. For Creatures you can use DFTX and DFTY which return the absolute X and Y positions of the feet.
In case the file commands can not handle numbers as input to write, VTOS to convert it from a number to a string.
Lets play plants! Photosynthesis... Photosynthesis... Photosynthesis... |
|