Jump to content

Changing NPC attitude


Recommended Posts

For all the great scripting minds out there, or anyone who has any clue about creature scripts. I'm struggling lately with creating a creature script that corresponds with a potion or even a wand for that matter, that can change the attitude of the creature.


Currently I've tried creating a scen state that sets a flag, once the flag is set, I created a call in the creature script to change the attitude.


Everything works, up until the creature script. This is what it looks like:



beginstate INIT_STATE;


if (get_flag(50,1) == 1)




For some reason, START_STATE doesn't recognise the get_flag call. So it wont work in there.

This seems to work in the INIT_STATE, but only before entering a town with that creature. But if I enter a town, and then use the supposed item which changes the flag, it won't have an effect on the creature's attitude until i leave and come back.


Does anyone have a work around? or solution to this matter? perhaps an alternative method? or even a cookie?

Link to comment
Share on other sites

Alright, i'll have to have another look a that. Each time I put a SDF call in the START_STATE it would come up with an error. And if i cut and pasted the exact same thing into the INIT_STATE it would suddenly work.


EDIT: Ok I realise now that in the START_STATE it only recognises get_sdf rather than get_flag. Thanks for that guys.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...