Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Weapon Pushback Script


JulianSull
 Share

Recommended Posts


scn aaaZombieHealthBrute


short DoOnce

short Health1

ref self


begin GameMode


if (DoOnce == 0)


	set Health1 to 40(Player.GetLevel*6)

	set DoOnce to 1

	SetActorValue  Health Health1


endif


end


;#########################################


begin OnHitWith aaaGraveAxe


set self to GetSelf

Player.PushActorAway self 500


end

I want it so that when this actor is hit by my special weapon, it gets knocked way back. What is wrong with this code? Also, how can I make this work in reverse for a future boss fight I was planning?

Link to comment
Share on other sites

Pushactoraway

Your setup looks correct.

I have an issue with using the Reference variable name 'self'. I would change it to mySelf or something more unique.

To reverse the push, you trade 'player' with 'self' in the command.

I have also not seen this kind of 'set' command. Is this OBSE or something?

set Health1 to 40(Player.GetLevel*6) 
Perhaps you mean this?
set Health1 to ( 40 * (Player.GetLevel * 6 ))

Link to comment
Share on other sites

Pushactoraway

Your setup looks correct.

I have an issue with using the Reference variable name 'self'. I would change it to mySelf or something more unique.

To reverse the push, you trade 'player' with 'self' in the command.

I have also not seen this kind of 'set' command. Is this OBSE or something?

set Health1 to 40(Player.GetLevel*6) 
Perhaps you mean this?
set Health1 to ( 40 * (Player.GetLevel * 6 ))

I just figured it out actually. And I also noticed that that didn't work correctly. I hit the zombie with my sword once, did 43 damage and it died =). Also the reason it didn't work was because my OnHit Block was after my GameMode Block so the CS said "Let's screw with him". It then completely ignored that entire block until I moved it above. Nice to know that now. Also yes, 500 was way too much, I just wanted to be sure that it was not in fact working. Some message prints helped find that out. Apparently 50 was too. It's at 10 now.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. 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.

Guest
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.

 Share

×
×
  • Create New...