Disable PushActorAway Script?

Post » Fri Mar 04, 2011 2:02 pm

Hi, I have made a bow with PushActorAway with a value of 50 (sends enemies flying quite far) but for realism I want larger enemies (like ogres) to be unaffected by it.

Does anyone know how I might do this?

Would I need to attach a spell to the creature's spell list for instance? Or would this need to be done in some other way?

I'm stumped and need advice. Thanks
User avatar
carla
 
Posts: 3345
Joined: Wed Aug 23, 2006 8:36 am

Post » Fri Mar 04, 2011 10:33 pm

Something like this would probably work:

Set Target to GetSelfIf ( Target.GetIsID [Ogre] == 1 )   ; Do Something else, perhapsElse  Player.PushActorAway Target 50EndIf


Basically, just check if the Target cannot be affected by the Spell.
User avatar
Suzie Dalziel
 
Posts: 3443
Joined: Thu Jun 15, 2006 8:19 pm

Post » Fri Mar 04, 2011 10:51 pm

Something like this would probably work:

Set Target to GetSelfIf ( Target.GetIsID [Ogre] == 1 )   ; Do Something else, perhapsElse  Player.PushActorAway Target 50EndIf


Basically, just check if the Target cannot be affected by the Spell.


Thanks but I couldn't get that script to work. Was Ogre meant to be in brackets? [ ] ?

I am absolutely confused on this and just can't figure it out.

Here is my regular pushactoraway script that I attached to my bow (this works and pushes all actors away by a factor of 50):

scn pushactorawaybowscript

begin scripteffectstart

ref target

set Target to getself
If Target != Player
Player.PushActorAway Target 50
endif
end


Is there a way I can add an exceptions to the rule within my script?? What could I add to it to make ogres not affected by the pushactoraway effect?
User avatar
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

Post » Sat Mar 05, 2011 12:49 am

It can be done much easier, just create an ability in CS with name "Big Creature" and give it any effect (for example feather 20 or something it doesn't matter), and then give this ability to every creature you consider big and don't want to be affected by pushing away and do this:

Set Target to GetSelfIf ( Target.HasSpell BigCreature == 0 )  Player.PushActorAway Target 50EndIf

User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

Post » Fri Mar 04, 2011 1:19 pm

It can be done much easier, just create an ability in CS with name "Big Creature" and give it any effect (for example feather 20 or something it doesn't matter), and then give this ability to every creature you consider big and don't want to be affected by pushing away and do this:

Set Target to GetSelfIf ( Target.HasSpell BigCreature == 0 )  Player.PushActorAway Target 50EndIf



That's actually a damn good idea, thank you! I will be trying this out later today.

Would you mind if I asked you to explain the process as to how this works please?

Thanks
User avatar
naome duncan
 
Posts: 3459
Joined: Tue Feb 06, 2007 12:36 am

Post » Fri Mar 04, 2011 2:57 pm

That's actually a damn good idea, thank you! I will be trying this out later today.

Would you mind if I asked you to explain the process as to how this works please?

Thanks

Well everything is obvious, for example you want ogres, trolls, minotaurs, boars and bears to be immune to your push away effect.
Go to "Creature" in Object Window and press on "Model" filter to make alphabetical order dependant on creature's model, and add this ability to everyone who has models of listed above creatures (for example).
So now, everytime the script applies to the creature it'll check if it has an ability.
If a creature doesn't have an ability it'll be pushed away.
If a creature has an ability script will do nothing, so creature will be unaffected.



Also other way is to make endurance+strenth check of ceature and even make it random roll.
For example:
short rollshort strenshort endurshort resultSet Target to GetSelfset roll to GetRandomPercentset stren to Target.GetActorValue Strengthset endur to Target.GetActorValue Enduranceset result to roll-(stren+endur)/2if result > 0  Player.PushActorAway Target resultEndIf



With this script you'll always push actor with random power which depends on target's endurance and strength and just roll.
If target has high strength and endurance in most cases it'll not be affected.
If target is weak and not endure it'll be affected and pushed at long distance.
User avatar
Matthew Warren
 
Posts: 3463
Joined: Fri Oct 19, 2007 11:37 pm

Post » Fri Mar 04, 2011 2:37 pm

Well everything is obvious, for example you want ogres, trolls, minotaurs, boars and bears to be immune to your push away effect.
Go to "Creature" in Object Window and press on "Model" filter to make alphabetical order dependant on creature's model, and add this ability to everyone who has models of listed above creatures (for example).
So now, everytime the script applies to the creature it'll check if it has an ability.
If a creature doesn't have an ability it'll be pushed away.
If a creature has an ability script will do nothing, so creature will be unaffected.



Also other way is to make endurance+strenth check of ceature and even make it random roll.
For example:
short rollshort strenshort endurshort resultSet Target to GetSelfset roll to GetRandomPercentset stren to GetActorValue Strengthset endur to GetActorValue Enduranceset result to roll-(stren+endur)/2if result > 0  Player.PushActorAway Target resultEndIf



With this script you'll always push actor with random power which depends on target's endurance and strength and just roll.
If target has high strength and endurance in most cases it'll not be affected.
If target is weak and not endure it'll be affected and pushed at long distance.


Thanks, interesting info. I'm not sure I understand the models and alphebetical order part. I only started using the construction set at the weekend so forgive my ignorance.

Also, I got a slightly more tricky question, and one I'm hoping you know the answer to:

I have 3 bows, one with a pushactoraway value of 50 (that I mentioned in my OP), another at 75 and another at 100, is there a script to cater for all 3? Do you need seperate scripts for this? Are there any drawbacks to several such scripts or any conflict issues?

Sorry for the numerous questions, you seem like you're a pro and I need the best advice I can get :)
User avatar
Sammykins
 
Posts: 3330
Joined: Fri Jun 23, 2006 10:48 am

Post » Fri Mar 04, 2011 10:12 pm

Thanks, interesting info. I'm not sure I understand the models and alphebetical order part. I only started using the construction set at the weekend so forgive my ignorance.

Also, I got a slightly more tricky question, and one I'm hoping you know the answer to:

I have 3 bows, one with a pushactoraway value of 50 (that I mentioned in my OP), another at 75 and another at 100, is there a script to cater for all 3? Do you need seperate scripts for this? Are there any drawbacks to several such scripts or any conflict issues?

Sorry for the numerous questions, you seem like you're a pro and I need the best advice I can get :)

You can use this: http://cs.elderscrolls.com/constwiki/index.php/GetEquippedObject
To check what exactly bow you're holding in the hands now, and then make it in "If" function.
So you can merge 3 scripts into one, but I don't see any problem to make 3 separate scripts for every bow.
User avatar
James Baldwin
 
Posts: 3366
Joined: Tue Jun 05, 2007 11:11 am

Post » Fri Mar 04, 2011 10:33 pm

You can use this: http://cs.elderscrolls.com/constwiki/index.php/GetEquippedObject
To check what exactly bow you're holding in the hands now, and then make it in "If" function.
So you can merge 3 scripts into one, but I don't see any problem to make 3 separate scripts for every bow.


Ok thanks. Btw, what's the difference between an ability and a spell? Will a regular spell work? If not, can you tell me how I make an ability (just point me in the right direction as I'm looking at the CS now and can't figure it out).

Thank you once again btw, I am grateful for all your advice.
User avatar
ZzZz
 
Posts: 3396
Joined: Sat Jul 08, 2006 9:56 pm

Post » Sat Mar 05, 2011 1:37 am

Ok thanks. Btw, what's the difference between an ability and a spell? Will a regular spell work? If not, can you tell me how I make an ability (just point me in the right direction as I'm looking at the CS now and can't figure it out).

Thank you once again btw, I am grateful for all your advice.

When you make a spell. You can either make it a Spell, Lesser Power or Ability.
User avatar
:)Colleenn
 
Posts: 3461
Joined: Thu Aug 31, 2006 9:03 am

Post » Fri Mar 04, 2011 4:14 pm

Ok thanks. Btw, what's the difference between an ability and a spell? Will a regular spell work? If not, can you tell me how I make an ability (just point me in the right direction as I'm looking at the CS now and can't figure it out).

Thank you once again btw, I am grateful for all your advice.

Ability is a constant effect, spell is a thing you can cast to get such effect or apply it on target.

For your script will be better to use ability to prevent creatures from casting any spells they not suppose to cast.
User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm

Post » Fri Mar 04, 2011 9:02 pm

Thanks fellas :) you gave good info and I thank you for it greatly.

I will try the script out now and report back if I run into any problems.
User avatar
neen
 
Posts: 3517
Joined: Sun Nov 26, 2006 1:19 pm

Post » Sat Mar 05, 2011 12:52 am

Update: line 5 is not being recognised: it says it doesn't understand 'target.hasspell'. It says it is an unknown variable/function. Help!

Also, I had to make some adjustments by adding 'ref target' as without that it didn't understand the 'set target' part. I also had to add another 'end' after endif. I hope I'm on the right track as this is only my second script to date lol.

Anyway, here's my current script:

Scn aaResistPushActorAwayBowScript
Ref target
Begin ScriptEffectStart
Set target to getself
If (Target.HasSpell aaResistPushActorAwayBowAbility == 0)
Player.PushActorAway Target 50
EndIf
End

User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm

Post » Fri Mar 04, 2011 9:00 pm

I also looked online and saw someone say similar:

http://cs.elderscrolls.com/constwiki/index.php/User:DragoonWraith/ThreadArchiveTest

Go to edit>find>then type 'hasspell' and you'll see someone complaining this command doesn't work on creatures. Is there an alternative?
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Post » Sat Mar 05, 2011 3:39 am

IsSpellTarget seems to work, but I need to test it out in-game.

Sorry for all these updates guys I'm thinking/typing out loud as I go along! :)
User avatar
mishionary
 
Posts: 3414
Joined: Tue Feb 20, 2007 6:19 am

Post » Fri Mar 04, 2011 9:23 pm

I also looked online and saw someone say similar:

http://cs.elderscrolls.com/constwiki/index.php/User:DragoonWraith/ThreadArchiveTest

Go to edit>find>then type 'hasspell' and you'll see someone complaining this command doesn't work on creatures. Is there an alternative?

Well then you can make an unplayable item then and add it to every creature's inventory.

Just go to Items->Clothing, then "New", call it with any ID name, ingame name can be left blank, no biped objects, no nif, no dds, no value, no weight and remove tick from "Playable", so player can't see this item.

And then make the same in script but change HasSpell to GetItemCount *********** > 0
User avatar
NIloufar Emporio
 
Posts: 3366
Joined: Tue Dec 19, 2006 6:18 pm

Post » Fri Mar 04, 2011 8:24 pm

Well then you can make an unplayable item then and add it to every creature's inventory.

Just go to Items->Clothing, then "New", call it with any ID name, ingame name can be left blank, no biped objects, no nif, no dds, no value, no weight and remove tick from "Playable", so player can't see this item.

And then make the same in script but change HasSpell to GetItemCount *********** > 0


Ok, I'll also try that.

btw, do you know how to just give a generic resist pushactoraway effect? would I just replace 50 with 0? So far, with using the IsSpellTarget command (mentioned earlier) I am able to get the CS to accept the script as a legit piece of code, but when I try it out in-game, it's not working.

Out of curiosity, have you tried this out?
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm

Post » Fri Mar 04, 2011 5:57 pm

If it makes any difference, I have a mod loaded (the pushactoraway bow) and another mod that has loaded a giant ogre (who is scaled at 1.50). I attached the ability to him. Could there be an issue with the mods not recognising each other??

The mods don't conflict and are blue on my OBMM. So I don't really know why the CS is accepting the mod but in-game the ogre still falls when hit.
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Fri Mar 04, 2011 3:38 pm

btw, do you know how to just give a generic resist pushactoraway effect? would I just replace 50 with 0? So far, with using the IsSpellTarget command (mentioned earlier) I am able to get the CS to accept the script as a legit piece of code, but when I try it out in-game, it's not working.

May be because your spell has effect only on 1 second or something? But I'm not sure.
About generic resistance to that effect... Hey, just look at Creatures' stats. Do you see Personality on the right? I don't think it's so important how beautiful the creature is.
You can use this value as resistance... Just make it 0 for creatures with no resistance and any number for resistance, and then deduct from 50.
For example rat has 0 personality, 50-0=50, so it'll be pushed with 50 power, minotaur has 50 personality, 50-50=0, set to script if result is 0 to ignore it at all, like if result > 0 then action, else do nothing.


Out of curiosity, have you tried this out?

No.
User avatar
Prue
 
Posts: 3425
Joined: Sun Feb 11, 2007 4:27 am

Post » Fri Mar 04, 2011 11:17 pm

I am trying to work out what you mean by 'personality' and how this would have any bearing on the script. I'm new at this so I need it breaking down a bit.

Also, please read my post #18 in this thread as I need to know your opinion :)
User avatar
Wayland Neace
 
Posts: 3430
Joined: Sat Aug 11, 2007 9:01 am

Post » Sat Mar 05, 2011 1:49 am

I am trying to work out what you mean by 'personality' and how this would have any bearing on the script. I'm new at this so I need it breaking down a bit.

http://img10.imageshack.us/img10/8256/99750964.jpg

http://cs.elderscrolls.com/constwiki/index.php/Stats_List
there's list of all values, but I'm not sure will Personality work with creature type actors...


Also, please read my post #18 in this thread as I need to know your opinion :)

Because plugin of plugin doesn't add everything from plugged plugin!
You need to merge them into one or recreate that ogre in your plugin, that's why it'll be better to try to use personality value.. the only problem that any other custom creature will have it value probably at 10 or 50 (deffault), so it'll only affect creatures from your mod and vanilla, that's why you need to make it dependant on creature's strength or endurance or both of them, so it'll be universal.
User avatar
{Richies Mommy}
 
Posts: 3398
Joined: Wed Jun 21, 2006 2:40 pm

Post » Fri Mar 04, 2011 4:29 pm

http://img10.imageshack.us/img10/8256/99750964.jpg

http://cs.elderscrolls.com/constwiki/index.php/Stats_List
there's list of all values, but I'm not sure will Personality work with creature type actors...



Because plugin of plugin doesn't add everything from plugged plugin!
You need to merge them into one or recreate that ogre in your plugin, that's why it'll be better to try to use personality value.. the only problem that any other custom creature will have it value probably at 10 or 50 (deffault), so it'll only affect creatures from your mod and vanilla, that's why you need to make it dependant on creature's strength or endurance or both of them, so it'll be universal.


Before I begin, let me just say you're a legend. You are very helpful and you have great ideas, I hope others reading will agree too :)

Now, this is a very good idea about using another value, so my question is this:

Do I need to attach a script to a bow that says if an Npc/creature has personality (or luck might be better perhaps) of 0, then they will NOT be pushed away?

If so, can you please add your code to my bow script? Here is my script again for my custom bow:

scn pushactorawaybowscript
begin scripteffectstart
ref target
set Target to getself
If Target != Player
Player.PushActorAway Target 50
endif
end

User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Sat Mar 05, 2011 6:10 am

scn pushactorawaybowscript

ref target
short selfthrow
short power

begin scripteffectstart

set Target to getself
set SelfThrow to Target.GetActorValue Personality
set Power to 50 - SelfThrow
If (Target != Player) && (Power > 0)
Player.PushActorAway Target Power
endif

end

This script will push actor if it has less than 50 personality with power of 50-Personaliy.
So if creature has 0 personality it'll be pushed on 50,
10 personality - on 40,
50 personality - ignore script.


If you don't want different power, then you can just make personality 0 and 1 and do this:
scn pushactorawaybowscript

ref target
short selfthrow

begin scripteffectstart

set Target to getself
set SelfThrow to Target.GetActorValue Personality
If (Target != Player) && (SelfThrow == 0)
Player.PushActorAway Target 50
endif

end

User avatar
Katy Hogben
 
Posts: 3457
Joined: Mon Oct 30, 2006 12:20 am

Post » Sat Mar 05, 2011 2:45 am

Thanks man.

Question: does this script work on percentages?

You said:

This script will push actor if it has less than 50 personality with power of 50-Personaliy.
So if creature has 0 personality it'll be pushed on 50,
10 personality - on 40,
50 personality - ignore script.


Is there a way to JUST make the script work if an actor has a personality of 5?

Say I want to exempt all ogres and minataurs, and set their personality at 5, would you be able to hit everything else with pushactoraway EXCEPT them?

Is there a way to make this a fixed figure instead of a percentage-calculated script?

Also, what does 'short' mean in the script?

And how did you get so knowledgable on scripting? I'm digging your info :)
User avatar
Bek Rideout
 
Posts: 3401
Joined: Fri Mar 02, 2007 7:00 pm

Post » Sat Mar 05, 2011 12:28 am

Is there a way to JUST make the script work if an actor has a personality of 5?

Yes, just make this:
scn pushactorawaybowscriptref targetshort selfthrowbegin scripteffectstartset Target to getselfset SelfThrow to Target.GetActorValue PersonalityIf (Target != Player) && (SelfThrow != 5)Player.PushActorAway Target 50endifend

With this script your pushing will affect everyone except for creatures/actors who has personality of 5.


Also, what does 'short' mean in the script?

http://cs.elderscrolls.com/constwiki/index.php/Short


And how did you get so knowledgable on scripting? I'm digging your info :)

I like more to create than to use created ;p
I was making scripts almost at every game where it was possible from strategies like Warcraft 3 to Morrowind and Oblivion, so interest of creating something unique what was never created before leads me to know everything about scripting ;p
I making scripts for Oblivion not so much time really... may be it's 2nd month, but i have CS wiki and OBSE, that's all you need to make anything you want in Oblivion, and yes, also your imagination.
User avatar
Marina Leigh
 
Posts: 3339
Joined: Wed Jun 21, 2006 7:59 pm

Next

Return to IV - Oblivion