Jump to content

Scripting Questions


Dahak

Recommended Posts

1. The call set_state is pretty much only useful in a creature or terrain script. There, it will run the state on the next turn. In any other script, as far as I know, it just ends everything.

 

2. I don't know. I wouldn't count on it.

 

3. As far as I know, it's 10 total.

 

4. As far as I know, it spawns in the same place as the original creature was placed. If you want to place a monster that doesn't do that, use place_monster.

Link to comment
Share on other sites

BoE's item-dropping percentages were mildly broken; maybe the same is true of BoA. Try giving it a 120% chance of carrying the item and see if that works.

 

Of course, the surefire way to do it would be to give the monster a custom creature script and put some code in the DEAD_STATE that places the item on its current location.

Link to comment
Share on other sites

Memory cell values are persistant if you save and load a game while in the town. If you leave the town and then return, then memory cells will reset.

 

If you are using basicnpc for your monster, or some other common script, you don't have to make a new script entirely. Just edit basicnpc (or whatever script you are using). In DEAD_STATE, add an if-then statement which checks an unused memory cell.

 

If the memory cell is 0, no item should be placed. When the memory cell is set to 1, then place the item. If you have more than one creature that you need to drop an item, you can just add a different memory cell value for the item. This way, you don't have to have 20 different scripts if you have 20 monsters that need to drop 20 different items.

 

Couple this with other scripts and you can have the monster drop a different item based on stuff-done flags, just by setting a different memory cell, provided that you call the script within the same town and before the fight begins.

 

Of course, if you're using a custom script for the monster anyway, it's best to just take Thuryl's suggestion.

Link to comment
Share on other sites

A scenario's custom objects script is the file in the scenario folder named [scenario short name]data.txt. The scenario's short name is the name of the base file (the one ending .bas) after you remove the .bas file extension. So for example, the short name for Valley of Dying Things is valleydy, and its custom objects script is valleydydata.txt.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...