Chittering Clawbug Vox Posted September 8, 2013 Share Posted September 8, 2013 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) set_attitude(ME,3); break; 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? Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk nikki. Posted September 9, 2013 Share Posted September 9, 2013 Can't you call a town state from the START_STATE of the creature's script? That way you can use the get_flag call. Quote Link to comment Share on other sites More sharing options...
Chittering Clawbug Vox Posted September 9, 2013 Author Share Posted September 9, 2013 Technically yes, but I would need to have it in every town, and it wouldn't work for outdoor encounters. Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Kelandon Posted September 9, 2013 Share Posted September 9, 2013 For some reason, START_STATE doesn't recognise the get_flag call. So it wont work in there. Um, what? This can't possibly be true, can it? Quote Link to comment Share on other sites More sharing options...
Seasoned Roamer Old MikeS Posted September 9, 2013 Share Posted September 9, 2013 From a quick look at some of the older scenarios, it looks like 'A Perfect Forest' uses several creature scripts with 'get_sdf' calls in the START_STATE. At least both 'necrophil.txt' and 'pspirit.txt' use flags within the start state. They might be good references to setup what is being attempted. Quote Link to comment Share on other sites More sharing options...
Chittering Clawbug Vox Posted September 10, 2013 Author Share Posted September 10, 2013 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.