szef Posted October 27 Posted October 27 (edited) I have created an item that has an abillity/effect: set ai script, as below: IF Global("G-SKINNING_SET","GLOBAL",0) Dead("AW1") THEN RESPONSE #100 PickUpItem("guts1") CreateCreature("Skinner",[0.0],0) Wait(1) PlaySequence(ANIM_ATTACK1) DisplayString(Myself,19256) ActionOverride("Skinner",DestroySelf()) SetGlobal("G-SKINNING_SET","GLOBAL",1) Continue() END Creates an invisible cre to help with skinning. Script: IF Global("G-INVISIBLE_SKINNER","GLOBAL",0) Dead("AW1") THEN RESPONSE #100 ActionOverride(Player1,PickUpItem("guts1")) TakeItemReplace("TTAC1","guts1",Player1) DestroyItem("guts1") SetGlobal("G-INVISIBLE_SKINNER","GLOBAL",1) END There are two problems one in the video (imgur link). First it seems fine, but then I can click/use item anywhere (on dead actor) and it still skins. https://imgur.com/a/zaMJxrF The second is that the script from .itm only starts once, and cannot be used afterwards. My approach is wrong? It seems so, i have no idea how to do it better way. Edited October 28 by szef Quote
jmerry Posted October 27 Posted October 27 55 minutes ago, szef said: The second is that the script from .itm only starts once, and cannot be used afterwards. Well, yes. Your scripting depends on global variables; they need to be un-set to run, and those variables are set in the process of running the "skinning" script. If you want it to be possible to skin something again, you need to un-set those variables somehow (set them back to zero). Another thing I should note: the "wait" action is dangerously easy to interrupt. That first script had better not be assigned to anything a player can issue commands to, or it'll be likely to break. Which resets it and has that run again, spawning another "skinner" ... Quote
szef Posted October 27 Author Posted October 27 (edited) I can give a second effect to .itm, a delayed script that resets the first one to zero. It should work, only problem is I'm not sure how to reset variables. On 10/27/2024 at 7:53 PM, jmerry said: Another thing I should note: the "wait" action is dangerously easy to interrupt. Without "wait" it won't work. The first script is only triggered when the loot is clicked.... Hmmm. E: I have resolved the issue with the dialogue. Only drawback is that you have to do separate cutscenes. https://imgur.com/a/0okDVJY Edited October 29 by szef Quote
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.