Jump to content

How to write a script for invulnerable dodges?


AgentOrange

Recommended Posts

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

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

Thank 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

Ah 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

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

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 by AgentOrange
Link to comment
Share on other sites

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...