Jump to content

So you can put a creature's name in Object?


temnix

Recommended Posts

Yes, but it needs to be its death variable, filename is only used when you spawn a new actor. That said, you can certainly set creature's DV to match its filename, to minimize confusion.

 

If you have many, the latest spawned will be used. So you can spawn a cre, ActionOverride() it to go north, then spawn another and AO() it to go south, but once you have the second, you won't be able to rely on DV to call the first one.

The first<->latest order changes when the game is saved and loaded, so it won't always be possible to tell one from another either.

Link to comment

You need to open the BEOWULF.CRE with NI and edit the field at 0x280. Click on Options and set "Show Hex Offsets" on, if you haven't already, then go to the "Edit" tab of the open file and scroll down until you the offset. As Avenger says, it is actually called script name there, not death variable, though I think pretty much everyone calls it DV..? Whatever.

Set it to whatever name you want to use in the scripts - in this case, beowulf - it doesn't have to match the filename, but it makes scripting more convenient when it does. It's case insensitive, so both Beowulf and BEOWULF will work fine if you try to call it in the script.

 

One thing to remember - since the engine uses this name to generate the death global by appending SPRITE_IS_DEAD to it, and the fact that variable's total length is limited to 32 characters, this means you only have 18 characters to use, otherwise extras will be truncated, which may or may not result in Dead("beowulf") triggers returning false when they should be true.

Link to comment

So for BEOWULF.cre I can put SPRITE_IS_DEADBEOWULF in Object, and it will work? Or can I change the death variable somehow to whatever I want, from a script I mean?

What it means is the cre's scriptname at offset 280 is Beowulf, It creates a global Glonal("SPRITE_IS_DEADBEOWULF","Gloabal",1) if Beowulf is dead, while Glonal("SPRITE_IS_DEADBEOWULF","Gloabal",0) means he is alive. Scrits or dialogues like IF Dead("Beowulf") would trigger if the global is set to 1 etc..

To assign a new script name to a creature you would use your tp2 with an entry like

 

COPY_EXISTING ~beowulf.cre~ ~override~

WRITE_ASCII 0x280~Beowulf~

 

If you use this assignment make sure a) that there is not yet an entry at 280, b) the script name you use is not yet assigned to another cre c) For compatibility with other mods use the cre name here as well (if possible).

 

Ps Avengers remark was a bit of history reminding us why the script name was often (wrongly) referred to as death variable in tutorials etc.I think also older versions of NI used that phrase.

Link to comment

Well, this discussion has veered off into parts unknown. All I wanted to know is whether I can peg a creature inside the game somehow, by its filename or something else.

Link to comment

If you want to go by the "something else", you can also set it a unique 'specific' Identifier. ChangeSpecifics. This can be done in script, repeatedly with different values, and all object references would be able to "peg the creature".

For example:

IF

....

THEN
RESPONSE #100
ChangeSpecifics(Myself,40)
END

 

Note: IESDP still uses a 2 bytes value, but in fact, this can be only a single byte.

 

You can also set the specifics field from any editor/weidu.

Link to comment

Thanks for the suggestion. Since posting the question I've learned to peg creatures. The best way all around is a custom spell state. Specifics are not so useful because creatures appear to ignore them, at least I haven't been able to get them to react. Perhaps they are more useful for spell effects. But then, I was very inexperienced with setting targets in scripts when I tried. Also a creature can have only one Specifics value at a time, and shamans' spirits, for instance, have the SPIRIT value assigned to them.

 

Another way to mark a creature is through token objects, could be useful, but that one is a total mystery.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...