Jump to content

Scamp Staff Item Script Help


Recommended Posts

Hello, so i am trying to make an item that function similarly to what the Staff of the Everscamp does, but changing a few thing around to make it helpful rather than annoying

after taking a look at how the Quest/Scamps i have a basic idea on how the scamps work, but its the item part that i am going to have issues with, Since the original script is just to progress the quest and not in a way affecting the scamps, its not very helpful for me, so here is the idea for what i thought the item could do;

while the item is in the inventory, the scamps will follow the player, and attack enemies if they are attacking the player, and if the player accidentally hits them, they wont be aggressive to the player.

so i already have an idea for the scamps being initially being disabled, and then when the player, grabs the staff from a container, the scamps get enabled and moved to them, but i just need help on two parts in particular, "while the item is in the inventory" and the "if the player accidentally hits them, they wont be aggressive to the player" parts, as i do not know how to go about doing this

Link to comment
Share on other sites

3 minutes ago, LenaWolfBravil said:

Use the function SetIgnoreFriendlyHits on each scamp to achive it, and add the scamps to the PlayerFaction.

so since the scamps have a script they all share, just put

SetIgnoreFriendlyHits 1

in the gamemode block, and that will prevent them from attacking the player?

Link to comment
Share on other sites

You must also add the scamps to the PlayerFaction. This is important.

But don't put this command into the GameMode block! It really should not run every frame! You only need to run it once for each scamp, like during the initialisation of your quest.

Link to comment
Share on other sites

i am not using a quest, i am just using an item and the script for the creature itself

and i think i can i just need to make it only run once so i could put in the gamemode block

if (everscampRef.GetIgnoreFriendlyHits == 0)
 SetIgnoreFriendlyHits 1
endif

just a basic concept for now, but the idea is that it will grab the persistent reference of the scamp, and check it if it isnt ignoring hits, and if it isnt ignoring hits, change it so that it is, and it doesnt have to be on the scamps itself, i could put it on the staff.

and yes they are in the player faction

Link to comment
Share on other sites

But with this script GetIgnoreFriendlyHits function will run every frame, which is also wholly unnecessary. Why not put SetIgnoreFriendlyHits into OnLoad or OnReset block of the scamp itself? You'd need to test it, but I think that would be enough.

Link to comment
Share on other sites

2 minutes ago, LenaWolfBravil said:

But with this script GetIgnoreFriendlyHits function will run every frame, which is also wholly unnecessary. Why not put SetIgnoreFriendlyHits into OnLoad or OnReset block of the scamp itself? You'd need to test it, but I think that would be enough.

so like this then?

Spoiler
Scriptname AXMCreatureEverscampScript

Float Timer
Short Dead

Begin OnDeath
 Set Timer to 10
 Set Dead to 1
 ModDisposition Player 100
 StopCombat
end

Begin OnLoad
 if (AXMEverscampRef01.GetIgnoreFriendlyHits == 0) || (AXMEverscampRef02.GetIgnoreFriendlyHits == 0) || (AXMEverscampRef03.GetIgnoreFriendlyHits == 0) || (AXMEverscampRef04.GetIgnoreFriendlyHits == 0)
  SetIgnoreFriendlyHits 1
 endif
End

Begin Gamemode
 if Dead == 1
  if (GetInSameCell Player == 0)
   Set Timer to 0
  endif
  if Timer > 0
   Set Timer to Timer - GetSecondsPassed
  else
   Set Dead to 0
   Resurrect 1
   EvaluatePackage
   PlayMagicEffectVisuals BABO
  endif
 endif
end

 

 

Link to comment
Share on other sites

You don't need to check GetIgnoreFriendlyHits within OnLoad, you can just directly issue the command SetIgnoreFriendlyHits.

Also, may I ask why you have StopCombat inside the OnDeath block? They are already dead, there is no combat when dead... 🙂 Thank goodness for that! 😮 😄  

Link to comment
Share on other sites

Posted (edited)

ok so after an initial test, i ran into a few issues, first is that the item is behind a Teleport Spell area, and the scamps do not travel to the player after they use a teleport spell to leave the area, and my item script works, but i dont think the follow package is doing that great considering that they dont really follow the player that well, and if your not in combat, and ignore hits is there, are they suppose to attack you?, because the is that they dont attack you no matter what

Edit: and apparently adding the item through the console just crashes the game

Edited by bomo99
Link to comment
Share on other sites

  • Recently Browsing   0 members

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