Jump to content

need help whit scripting


heroko

Recommended Posts

soo the other day i found out id try making myeslf an mod and made myself an island and stuff.
but then i figured id try scripting and have an button conected to an Xmarker that is conected to some crates for enabling and disabling em.
where did i go wrong? since atm the button doesnt do annything

Scriptname iinntriger extends ObjectReference  

ObjectReference property iinnmarker1 auto

Event OnActivate(ObjectReference akActionRef)

    if(iinnmarker1.isenabled())
    iinnmarker1.disable()
    
    else
    iinnmarker1.enable()
    endif
endevent




 

Link to comment

The script looks good.

But probably the object you attached the script to does not support the activation.

 

Create or duplicate in CK an activable object.

Then you can alter is NIF to point to the nif used by the object you want to replicate (Nordic button?)

 

Attach your script to the base object and place it somewhere.

 

It should work.

 

And remember to fill the property, better if you fill it in the ObjectReference and not in the base form, so you can reuse the object in different cells to enable/disable different objects.

Link to comment

The script looks good.

But probably the object you attached the script to does not support the activation.

 

Create or duplicate in CK an activable object.

Then you can alter is NIF to point to the nif used by the object you want to replicate (Nordic button?)

 

Attach your script to the base object and place it somewhere.

 

It should work.

 

And remember to fill the property, better if you fill it in the ObjectReference and not in the base form, so you can reuse the object in different cells to enable/disable different objects.

 

i ment imperial changed it for an dwemerbutton and it worked.

 

yea atm im at the point where im following darkfox's toturials on youtube got the idea for this script from his lightswitch.

 

and i just found ur guide soo im thinking of having an look at that tomorow :P need full focuse for that.

 

btw if i conect more boxes to the xmarker now and put them at oposit will that change those i already have conected to it?

 

Link to comment

also 1 think iv been wondering about is it possible to make an soultrap like teleport spell that teleports the enemy to an spot upon death and ressurects em in an slave like faction ?
i could always just use fire and forget teleport and then force em into another faction but sending dead people to another plane to serve seems soo much better :P

Link to comment

soo im trying myself as scripting again and i have no idea what im doing but i think im at the right track soo if somone could help me out it would be awsome :P

 

this is my script :D i want to add an npc to be an follower after she gets down to 10% hp :D
Scriptname AddtoFaction extends ObjectReference  

Actor property ACTORref_01 auto

Faction property Faction_01 auto
Faction property Faction_02 auto
Faction property Faction_03 auto


    Float Function GetActorValuePercentageEX(Actor ACTORref_01, String asValueName)
      Float CurrentHealth =ACTORref_01.GetActorValue(asValueName)
    Float BaseHealth =  ACTORref_01.GetBaseActorValue(asValueName)
 
      Float HealthPercent = (CurrentHealth / BaseHealth) * 100
    return HealthPercent
EndFunction
    GetActorValuePercentageEX(Game.GetACTORref_01(), "health")
    if
     (GetActorValuePercentage("health") < 0.1)
    isinn()

    else

endif

function isin
bool Function IsInFaction(Faction akFaction) native
    
    if Actorref_01.isinfaction(Faction_01)
    
    else Actorref_01.AddToFaction

    if Actorref_01.isinfaction(Faction_02)

    else Actorref_02.AddToFaction

    if Actorref_01.isinfaction(Faction_03)

    else Actorref_03.AddToFaction
    endif
endfunction
endfunction

Link to comment

Archived

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

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use