Scripting Questions

Error message

Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /var/www/pied-piper.ermarian.net/includes/common.inc).
AuthorTopic: Scripting Questions
Infiltrator
Member # 148
Profile #0
1. What is the difference in purpose between set_state(which_state) and end();

2. Are changed memory cells persistent between reloads?

3. I know we can up to 10 events, but it 10 total or 10 per day?

4. How do you determine where spawn_creature spawns?

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
Off With Their Heads
Member # 4045
Profile Homepage #1
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.

[ Tuesday, February 15, 2005 16:12: Message edited by: Kelandon ]

--------------------
Arancaytar: Every time you ask people to compare TM and Kel, you endanger the poor, fluffy kittens.
Smoo: Get ready to face the walls!
Ephesos: In conclusion, yarr.

Kelandon's Pink and Pretty Page!!: the authorized location for all things by me
The Archive of all released BoE scenarios ever
Posts: 7968 | Registered: Saturday, February 28 2004 08:00
Agent
Member # 2820
Profile #2
Remember that any real creature can be moved with other calls, so you can still resurrect any preplaced character that you want at any place desired.

--------------------
Thuryl: I mean, most of us don't go around consuming our own bodily fluids, no matter how delicious they are.
====
Alorael: War and violence would end if we all had each other's babies!
====
Drakefyre: Those are hideous mangos.
Posts: 1415 | Registered: Thursday, March 27 2003 08:00
Infiltrator
Member # 148
Profile #3
How do you make a creature ALWAYS drop a certain item? I tried to add it via the datascript, but it is not always.

--------------------
My ego is bigger than yours.
Posts: 480 | Registered: Thursday, October 11 2001 07:00
...b10010b...
Member # 869
Profile Homepage #4
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.

[ Wednesday, February 16, 2005 18:47: Message edited by: Thuryl ]

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00
Apprentice
Member # 5431
Profile #5
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.

--------------------
People with signature fixation will not know who this is.
Posts: 22 | Registered: Tuesday, January 25 2005 08:00
Apprentice
Member # 5311
Profile #6
where is the costum objects scripts
Posts: 46 | Registered: Monday, December 20 2004 08:00
...b10010b...
Member # 869
Profile Homepage #7
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.

--------------------
The Empire Always Loses: This Time For Sure!
Posts: 9973 | Registered: Saturday, March 30 2002 08:00