AgentOrange Posted March 11, 2021 Share Posted March 11, 2021 I wish to make a script to have actors invulnerable while dodging. I think the secret to this is in the SetGhost function https://cs.elderscrolls.com/index.php?title=SetGhost I am a total noob at scripting. I have OBSE and have done a little tweaking of scripts but I don't know how the syntax for this needs to be at all. I think should involve if/then statements and animation groups but that as far as I got looking at the wiki. Are any experienced modders able to show me how this script should look? Thank you :sweat: Link to comment Share on other sites More sharing options...
Mishkax Posted March 11, 2021 Share Posted March 11, 2021 player.setghost 1 player.setghost 0 first one turns on ,second one turns off i think,alternatively,if that doesnt work try player.SetGhost IGhostFlag 1 player.SetGhost IGhostFlag 0 Link to comment Share on other sites More sharing options...
AgentOrange Posted March 11, 2021 Author Share Posted March 11, 2021 player.setghost 1 player.setghost 0 first one turns on ,second one turns off i think,alternatively,if that doesnt work try player.SetGhost IGhostFlag 1 player.SetGhost IGhostFlag 0Thank you. This is about as far as I got. I think the next step is to check the animation group that the actor is playing? Link to comment Share on other sites More sharing options...
AgentOrange Posted March 11, 2021 Author Share Posted March 11, 2021 (edited) I am looking at this now. Getting closer I think https://cs.elderscrolls.com/index.php?title=AnimGroups Edit - How do you check if the actor is in one of these animation states? Edited March 11, 2021 by AgentOrange Link to comment Share on other sites More sharing options...
KatsAwful Posted March 11, 2021 Share Posted March 11, 2021 https://cs.elderscrolls.com/index.php?title=Category:Animation_FunctionsOne of them in here should help Link to comment Share on other sites More sharing options...
AgentOrange Posted March 11, 2021 Author Share Posted March 11, 2021 https://cs.elderscrolls.com/index.php?title=Category:Animation_Functions One of them in here should helpAh I think IsAnimGroupPlaying is what I need https://cs.elderscrolls.com/index.php?title=IsAnimGroupPlaying So I have all the pieces now I think: IsAnimGroupPlaying(DodgeLeft/Right ect) and SetGhost. Now I just need to figure out how to put it all together :wacko: Link to comment Share on other sites More sharing options...
Mishkax Posted March 11, 2021 Share Posted March 11, 2021 welp,the idea is that you need to check first whats going on then administer the state so isanimgroupplaying would go before setghost for instance,if isanimgroupplaying equals 1,then you set setghost to 1, if isanimgroupplaying is 0,then put setghost at 0 with of course 1 being on and 0 being off Link to comment Share on other sites More sharing options...
AgentOrange Posted March 11, 2021 Author Share Posted March 11, 2021 (edited) scriptName AAADodgeInvuln Begin GameMode if (Player.IsAnimGroupPlaying DodgeForward == 1) Player.SetGhost 1 elseif (Player.IsAnimGroupPlaying DodgeLeft == 1) Player.SetGhost 1 elseif (Player.IsAnimGroupPlaying DodgeRight == 1) Player.SetGhost 1 elseif (Player.IsAnimGroupPlaying DodgeBack == 1) Player.SetGhost 1 endif End This is what I came up with but on testing it did not work. :sad: Does anyone see what I did wrong? Edited March 11, 2021 by AgentOrange Link to comment Share on other sites More sharing options...
Mishkax Posted March 11, 2021 Share Posted March 11, 2021 well i see one of the things you did wrong. you made the part for if the dodge was taking place,but not for the afterwards.the way your script is now the moment the dodge happens setghost wont shut off if it does work at all. you also need these,example if (player.isanimgroupplaying Dodgeback == 0 )player.setghost 0 and remember,if this doesnt work player.setghost 1 try player.SetGhost IGhostTag 1 Link to comment Share on other sites More sharing options...
Mishkax Posted March 11, 2021 Share Posted March 11, 2021 and also the way the script is written its probably just sitting there we need to find some way to attach the script to some ingame function "game mode" function comes to mind, i think its begin OnGameMode but id avise checking the cs wiki to make sure of the syntax Link to comment Share on other sites More sharing options...
Recommended Posts