Jump to content

Script making


Mareca

Recommended Posts

Hi guys.I need a script on armor (i will add it on some)that when you are at low health healing spell activates (you create some that heal a lot costs little)and fireball script same when you are low on health.Can someone do it?I will give him kudos :biggrin: :thumbsup: !
Link to comment
Share on other sites

I answered this same post in the Mod Requests section.

 

The healing script I gave you there should work as I explained. Now that I know what the script is for, I think i may be able to create a fireball script for you.

 

As I said, the fireball can not be cast by the player and so will have no target. Without OBSE, the targeting process is quite difficult and not always efficient. I suggest that you allow 8 fireballs to come off of the player, each going in a different direction. It will be more cinematic and will probably hit anyone close to you or slightly further away without complicated targeting, plus it is easier to script without OBSE.

 

Would that be ok? If so, I will get onto it a little later.

Link to comment
Share on other sites

that is preety damn good!I gave you a kudos :thumbsup: Edited by Mareca
Link to comment
Share on other sites

Thanks :)

 

Few extra details I may be able to code for you...

 

Does the effect have to recharge?

Will the fireballs work at the same time as the healing?

 

If there is anything else you specifically want, let me know.

 

Also just realised that the healing script will activate even if the player isnt wearing the armour. Ill be able to fix it properly when I get home, but for now, a temporary fix would be:

 

 Scn AutoHealSCRIPT

Float fQuestDelayTime 
Short LowHP

Begin GameMode

Set fQuestDelayTime to 1 ;The script will check every second to see if you need healing.

If player.getequipped <editor id of armour here> == 0
     return
Endif

Set LowHP to ( ( Player.GetBaseAv Health ) * 0.2 ) ;You will be healed at 20% health or lower.

If Player.GetAv Health > LowHP 
     Return 
Else
    Player.Cast <EditorID of healing spell goes here> ;Forces the player to cast spell 
endif

End

Edited by WarRatsG
Link to comment
Share on other sites

hey.for the fireball it doesnt need to work in the same time.And i dont know for recharging i think few seconds (5 yea) And i dont know what healing spell to use so can you set some id for it? Thats all thanks! I will send you an PM if i wanna some new scripts :biggrin: :thumbsup: Thanks again!I will upload that mod later and i will give you credits! :biggrin:

 

PS:the mod doesn't give new armor just that script that you gave me!

Edited by Mareca
Link to comment
Share on other sites

You could make your own custom healing spell?

Same with armour. You can make a duplicate form of armour, then add a script to it.

 

If you have any trouble doing that, I would recommend looking at the CS wiki. It has tutorials for making your own spells and stuff like that.

 

For the record, the fireball script and healing script will have to be combined, or you will have to make 2 sets of armour - one that shoots and one that heals. When I say make a set of armour, I mean create a duplicate form.

Any preference? Will there be 1 set of armour with both effects or 2 sets with one effect each?

 

EDIT: First pass at a fireball script...

 

 

 

SCN AutoFireballSCRIPT

Short IsEquipped
Short LowHP
Float Timer

Ref Activator1                    ;Casts the spell
Ref Activator2                    ;Is the "target" for the spell

Begin OnEquip

Set LowHP to ( ( Player.GetBaseAv Health ) * 0.2 )              ;Takes effect after player goes below 20% health
Set IsEquipped to 1
Set Activator1 to <ReferenceID of activator goes here>
Set Activator2 to <ReferenceID of activator goes here>

End

Begin OnUnequip

Set IsEquipped to 0

End

Begin GameMode

If IsEquipped == 0
     Return
Else

     If Timer > 0
           Set Timer to ( Timer - GetSecondsPassed )
           return
     Else

           If Player.GetAv Health > LowHP
                 Return            
           Else           

                 Activator1.MoveTo Player 0, 10, 0
                 Activator2.MoveTo Player 0, 1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots directly ahead of player

                 Activator1.MoveTo Player 0, -10, 0
                 Activator2.MoveTo Player 0, -1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots directly behind of player
     
                 Activator1.MoveTo Player 10, 0, 0
                 Activator2.MoveTo Player 1000, 0, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 90 degrees right of player

                 Activator1.MoveTo Player -10, 0, 0
                 Activator2.MoveTo Player -1000, 0, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 90 degrees left of player

                 Activator1.MoveTo Player 10, 10, 0
                 Activator2.MoveTo Player 1000, 1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 45 degrees right of player

                 Activator1.MoveTo Player -10, 10, 0
                 Activator2.MoveTo Player -1000, 1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 45 degrees left of player

                 Activator1.MoveTo Player -10, -10, 0
                 Activator2.MoveTo Player -1000, -1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 135 degrees left of player

                 Activator1.MoveTo Player 10, -10, 0
                 Activator2.MoveTo Player 1000, -1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 135 degrees right of player

                 Set Timer to 5
           endif
     endif
endif

end

 

 

 

What this will do is make 8 fireballs shoot in 45 degree increments from the player's position. They are not technically relevant to the direction the player faces though, but will always originate from the player's position (about 10cm away from it, technically speaking, so that they are in no danger of hitting the player). Also, they will still hurt allies, but you will not be "blamed" for the attack. The fireballs will appear once when you drop below 20% health, and will not fire again for 5 seconds.

 

I have used activators to shoot the spells, which have to be a persistent reference, labelled with a reference ID. If you are not sure make or use them, feel free to ask.

 

I have a feeling that this may not work properly this time round, seen as "MoveTo" has so many bugs. Feel free to give it a try and see if it works as intended though.

 

I'm assuming that this is on a separate set of armour than the healing effect. If not, then please let me know so that I can combine them.

Edited by WarRatsG
Link to comment
Share on other sites

i like itttttt! you are good!I am thinking now that i add it on some NPC and that he has that armour with script effects (i have one script that you are at low health you automacilly get all your health but i dont use it,so that npc would be immortal (only i would kill him with a mehrunes razor!) yeaa that is cool and to have all your scripts on him he will be some BOSS yea!)

 

PS: i will do it tommorow now is late!When i finish it i will upload it !

Edited by Mareca
Link to comment
Share on other sites

it will be on the armor.Is it possible to set that when i kill him i take that armor and have that script working?
Link to comment
Share on other sites

This code should allow anyone to wear the armour and have fireballs come off of them when they are below 20% health (5 second recharge time).

 

 

 

 

SCN AutoFireballSCRIPT

Short IsEquipped
Short LowHP
Float Timer

Ref Activator1                    ;Casts the spell
Ref Activator2                    ;Is the "target" for the spell
Ref Container                    ;The person wearing the armour

Begin OnEquip

Set Container to GetContainer
Set LowHP to ( ( Container.GetBaseAv Health ) * 0.2 )              ;Takes effect after player goes below 20% health
Set IsEquipped to 1
Set Activator1 to <ReferenceID of activator goes here>
Set Activator2 to <ReferenceID of activator goes here>

End

Begin OnUnequip

Set IsEquipped to 0

End

Begin GameMode

If Container.GetDead == 1                 ;A dead character has less than 20% health. They may shoot fireballs.
     Return
endif

If Timer > 0
     Set Timer to ( Timer - GetSecondsPassed )
     Return
Else

     If IsEquipped == 0
           return
     Else

           If Container.GetAv Health > LowHP
                 Return            
           Else           

                 Activator1.MoveTo Container 0, 10, 0
                 Activator2.MoveTo Container 0, 1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots directly ahead of player

                 Activator1.MoveTo Container 0, -10, 0
                 Activator2.MoveTo Container 0, -1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots directly behind of player
     
                 Activator1.MoveTo Container 10, 0, 0
                 Activator2.MoveTo Container 1000, 0, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 90 degrees right of player

                 Activator1.MoveTo Container -10, 0, 0
                 Activator2.MoveTo Container -1000, 0, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 90 degrees left of player

                 Activator1.MoveTo Container 10, 10, 0
                 Activator2.MoveTo Container 1000, 1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 45 degrees right of player

                 Activator1.MoveTo Container -10, 10, 0
                 Activator2.MoveTo Container -1000, 1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 45 degrees left of player

                 Activator1.MoveTo Container -10, -10, 0
                 Activator2.MoveTo Container -1000, -1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 135 degrees left of player

                 Activator1.MoveTo Container 10, -10, 0
                 Activator2.MoveTo Container 1000, -1000, 0
                 Activator1.Cast <Editor ID of Fireball spell goes here> Activator2                 ;Shoots 135 degrees right of player

                 Set Timer to 5
           endif
     endif
endif

end

 

 

 

 

And for the healing effect, which will heal when you drop below 20% health (also 5 second recharge time)...

 

 

 

Scn AutoHealSCRIPT

Short LowHP
Short IsEquipped
Float Timer

Ref Container
Ref Activator

Begin OnEquip

Set Container to getContainer
Set Activator to <ref ID of activator>
Set LowHP to ( ( Container.GetBaseAv Health ) * 0.2 )
Set IsEquipped to 1

End

Begin OnUnequip

Set IsEquipped to 0

End

Begin GameMode

If Timer > 5
     Set Timer to ( Timer - GetSecondsPassed )
     Return
endif

If IsEquipped == 0
     return
Endif

If Container.GetAv Health > LowHP 
     Return 
Else
    Activator.MoveTo Container
    Activator.Cast <EditorID of healing spell goes here>                       ;Automatically healed.
    Set Timer to 5
endif

End

 

 

 

Hopefully that should work. If you need them combined, let me know ;)

Edited by WarRatsG
Link to comment
Share on other sites

  • Recently Browsing   0 members

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