Jump to content

Making creature melee with magical ability


yusukenl

Recommended Posts

I am on the progress of making the pushaway to have area effect via the activator

(using the idea of Call Lightning spell in CS Wiki tutorial) which

I make a spell(with area effect 10 ) to let activator cast on the creature and push other actor away.

But from this I encounter few problems. Here are the script that I used

 

ScriptName NKKMagicalMeleeScript 
;This script makes the actor push the combat target away 
;and activate the area effect spell

Ref HitTarget ; the reference for combat target
Ref Hitter   ; the reference for actor
Ref Source ;the reference for activator

begin GameMode
 if IsInCombat == 1
  Set HitTarget to GetCombatTarget
  Set Hitter to GetSelf
   if Hitter.IsAttacking == 1
     source.MoveTo hitter, 0, 0, 1
     Hitter.PushActorAway HitTarget 100
     source.cast NKKStompSpell Hitter
     StopCombat ; To make the creature seek for another 
closer actor, not chasing the flying one
    endif
 endif
End

 

scriptname NKKStompSpellScript
;The script for the spell which the activator cast

ref me	;holds a reference to the actor who affected by this spell
ref source	;holds a reference to the activator

Begin ScriptEffectStart
 ;get a reference to this actor
 set me to GetSelf
 ;have the activator cast the  at the affected actor
 source.pushactoraway me 50
End

 

The problem is that I dunno way to get the hitter reference in

MeleeScript and use it in the StompSpellScript. So I can't make s

ome code on preventing the spell script affects on the the creature

(if I add a damage effect on the spell, it will kill the creature real quick)

 

The other problem is the positioning on activator(I think).

Since I am actually using the activator to push actor away,

so even when I stand very far from the creature, I still got pushed away sometime.

 

Please give me some advice, :thanks:

Link to comment
Share on other sites

Firstly, PushActorAway only accepts actors for the pusher as well as the pushee, so you'd more likely need a dummy actor or a quest script to "hold" the pushing creature for the spell script. If you're going to push the HitTarget away anyway in the melee script, you also might want to add a GetDistance check.
Link to comment
Share on other sites

Please give me some advice, :thanks:

This goes into my whole question of what you are trying to make this effect for? How many creatures do you want to use this? If it is only 1 or 2 creatures (the standard gatekeepers, or a summon) then you don't need to go through the added trouble of trying to figure out who is using this spell, you can just tailor the effect to work off the persistant references in game (using some conditions to verify which one is active). If you're trying to do this with some sort of random created one, like through a leveled list, then you have alot more complicated scripting which is needed.

Link to comment
Share on other sites

so you'd more likely need a dummy actor or a quest script to "hold" the pushing creature for the spell script.

 

the dummy actor is actually the activator in my code with the name source as a presistant reference who cast the stomp spell and act as the pusher, just that the code that I wrote didn't seems to be able to follow the creature efficiently ( I guess)

 

This goes into my whole question of what you are trying to make this effect for? How many creatures do you want to use this?

 

I was planning to make a dungeon which this gatekeeper as a mini boss has some push away effect (and may be some magical effect on its HtH attack). But I don't wanna just mke the effect for this dungeon or for this creature only. I am trying "generalize" the script effect so that I can make use of it easily on other creatures in the future :biggrin:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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