Help - Search - Members - Calendar
Full Version: Making creature melee with magical ability
The Nexus Forums > Specific Games > Oblivion > Oblivion Modifications > General Mod Talk
yusukenl
I wanna make a gatekeeper which can hit others with magical melee attack, I know the easiest way is make a enchanted weapon for him.
But here is the concern,
on the model that gatekeeper has, I can make the gatekeeper equipped with weapon on hiss appearance. So will there be a conflict when I make the gatekeeper equipped with weapon and give him a sword to wield with ?

Also, if I want him to have knock back effect on its melee attack, how should I edit this script(I found it in the Oblvion.esm)
scn SE02GatekeeperScript
Ref HitTarget
short PushAwayForce

if PushAwayForce == 0
set PushAwayForce to 35
endif

If SECrime.GatekeeperHit == 1
PushActorAway HitTarget PushAwayForce
; Message "Called PushActorAway"
Set SECrime.GatekeeperHit to 0

EndIf


I actually don't quite get the yellow part, or should I just put
scn SE02GatekeeperScript
Ref HitTarget
PushActorAway HitTarget 35


How far is "35" actually ?

thanks.gif
Vagrant0
You can't make creatures have enchanted attacks like weapons without giving them a weapon, and only some creatures have the nodes setup properly to allow weapons. There are no script blocks which run when the thing being scripted attacks something. Your best option would be to make a lesser power, on touch, with a scripted effect and a damage health/fatigue component. Although I'm sure there may be some other options with OBSE functions, they are likely too complicated, and won't be as effective. If a creature does not have a cast touch animation, they should use their normal attack animation.
yusukenl
I see, I have made some spell for it already
but when I make the .esp file(activated in game already)
I tried to summon that creature via PlaceAtMe for testing, it didn't work
the console said "Item XXXX was not found for parameter ObjectID, Complied Script was not saved" What does that mean... I saved the .esp file already
Vagrant0
QUOTE(yusukenl @ Aug 26 2008, 03:35 AM) *
I see, I have made some spell for it already
but when I make the .esp file(activated in game already)
I tried to summon that creature via PlaceAtMe for testing, it didn't work
the console said "Item XXXX was not found for parameter ObjectID, Complied Script was not saved" What does that mean... I saved the .esp file already

You shouldn't try using console to add anything added by a mod unless you care to write down form numbers and figure out what index your mod is loaded in. It's really much easier to just make a quest script or place the actual creature somewhere to test it. Doing so also encourages people to learn a wider range of basic CS skills.
yusukenl
thx Vagrant0
I have found that the IsAttacking cmd in OBSE seems to do the job

then tried to make an object script and add to the creature which I want it to have pushaway effect on its attack
QUOTE
ScriptName MagicalMeleeScript

Ref HitTarget
Ref Hitter

begin OnStartCombat
Set HitTarget to GetCombatTarget
Set Hitter to GetSelf

if Hitter.IsAttacking == 1
Hitter.PushActorAway HitTarget 100
HitTarget.ModAv2 Fatigue - 100
endif
End


and after that I am the game test
It doesn't seems to be work .... I have no idea why though blink.gif


LoginToDownload
Wouldn't "OnStartCombat" mean it would only run if, as soon as combat is initiated, he was attacking? That also doesn't factor in if they're attacking but missing, and hitter isn't necessary if it's just calling itself for PushActorAway.
yusukenl
ummm, do u mean the "if" statement in "begin - end" statement will only check the condition for once ?
if that's so, how to make the statement keep checking the condition until the battle ends ?

On attacked but missed part, my first idea was to make creature which sends everyone around it into the sky whenever it attacks, so I didn't make a missiing check on it.tongue.gif
LoginToDownload
The Begin-End statement would only run when the creature enters combat. Not the creature is in combat, just the frame where it starts. If you made it Begin GameMode and checked if IsInCombat, it might work better. Though you'd need a way to stop it tearing a target's Fatigue to shreds. (It would run every frame the creature was attacking, and could quite likely damage fatigue 500 or more) For that you could have a DoOnce variable that makes sure the Fatigue is only damaged when it's 0, is set to 1 when the Fatigue is damaged, and set to 0 when the creature isn't attacking/isn't in combat.
Vagrant0
Are you wanting to make it every attack or something? That's probably a bad idea since it will currently affect whoever the current combat target is, no matter what (distance, blocking, godmode, whatever). And as you are making it use pushactoraway, once an actor is hit, they will likely not recover until they are dead as each and every hit will make them go ragdoll and reduce their stamina.

I still think you are making this more complicated than it needs to be. Just make a touch Lesser Power with 0 cost, novice, and give it the following effects;
Damage fatigue 100, radius 5 over 1 second
Scripted spell effect radius 5 over 1 second

Then with the scripted effect attach a simple script

CODE
scn yusukPushactoreffectscript01213145945712047

ref target

begin scripteffectstart
set target to getself
target.pushactoraway target -25
end


The only downside is that it will make the actor hit fall to the ground when hit, not knocked back. To make the actor move back you will need a persistant reference or declare such a reference in a quest scipt. The real question is if you are wanting this to apply to a single creature, or if you are trying to make it work with several creatures. If using a single creature, or atleast a few, specific creatures, this method will probably work out better for you in the long run.

The main difference is that in this method, the effect is used instead of a normal attack, rather than every time the creature attacks. This makes it less predictible, but still controllable through other scripts. Although the same thing could probably be achieved by a getrandompercent condition within the "happens every attack" script, such an effect is harder to control and may still occur too often.
yusukenl
I finally made the effect works !!
but it is kinda different from what I expected though
the pushactoraway function didn't "push" npc away horizontally, instead the function just "throw" the npc into sky vertically or make them fall to the ground
is it what this function will do only ... ?
LoginToDownload
How did you do it? If you did use Pusher.PushActorAway PushVictim, I can't see why it would knock them upwards. They get thrown upwards or downwards only if they try to push/pull themselves away.
yusukenl
I see, coz I was using Vagrant0's spell to test it, now I know where I did wrong ^^" thx
yusukenl
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

CODE
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


CODE
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.gif
LoginToDownload
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.
Vagrant0
QUOTE(yusukenl @ Aug 28 2008, 02:35 PM) *
Please give me some advice, thanks.gif

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.
yusukenl
QUOTE(LoginToDownload @ Aug 28 2008, 03:06 PM) *
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)

QUOTE(Vagrant0 @ Aug 28 2008, 04:47 PM) *
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.gif

LoginToDownload
You might get more mileage out of a Quest variable than an actor. The dummy doesn't seem to have any inherent advantages... It would be just as effective (or maybe moreso) for keeping track of more than one of the things at once.
yusukenl
I am sorry to ask... how to make a quest variable ? sweat.gif
LoginToDownload
You make a quest and give it a script with the variable you want... It's not ideal, especially for something as comparatively small as this, but it's the only way I know of to hold "ref" variables outside a specific script.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.