Scripting an item/shape

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
Donfrow
Posts: 308
Joined: Thu May 14, 2020 1:34 pm

Scripting an item/shape

Post by Donfrow »

Now that I've been playing around with scripting a lot more there are some things I want to do but am unable to figure out how.

One of these is scripting a shape #.

My understanding is that the code of

script item
{
whatever
}

will consider the item to be where ever the code is located, so if I have it called an a NPC it would make the NPC do the script, or if I had it in a shape# it would make the shape do whatever, such as cycling through the BG wounded man frames.

However, how would I go about scripting a shape #, such as the wounded man animation, if it's called from something else? Something such as scripting the avatar walk over to loc X and loc Y, upon arriving, cause a script to go through the wounded man frames (ignoring si_path_run_usecode for now as what I actually want to do is not possible this way... I think).

A rough example would be something like this.

script AVATAR
{

script to move avatar to loc X and loc Y, then upon arriving

script WOUNDED_MAN
{
cycle through frames
}

}

I can get everything working except scripting the wounded man, since I do not know what I should actually put in the place of the text WOUNDED_MAN. I know it should be an object reference, and not a shape number, but I do not know how to actually get the object reference, unless it was within the actual shape code of the wounded man.

I also tried script wounded_man, where wounded_man is the actual name (such as wounded_man shape#(1300)() ). Can you have script blocks within script blocks?

I hope this made sense... thanks
Locked