Jump to content

Recommended Posts

Posted

A little tiny script request.

 

Can someone teach me how to make a script that will start on "gamestart"

 

that will do this

 

If player race = "this race"

player.additem 

player.equipitem

 

end

 

Thank you

Posted

For what purpose do you need this script?

Basically, if your race is this one

 

It auto adds that race's starting item and equips it.

Posted

If you wish your race have horns\wings\tail\special ears\etc - it be better to add this parts via CreationKit directly to your race (like argonian tail, for example).

 

For "you change your character race and something happens" better to use OnRaceSwitchComplete event, I think.

Posted

If you wish your race have horns\wings\tail\special ears\etc - it be better to add this parts via CreationKit directly to your race (like argonian tail, for example).

 

For "you change your character race and something happens" better to use OnRaceSwitchComplete event, I think.

Its completely different, Its just a basic add item if this is the race used

 

For the characters starting equipment.

Posted

Something like this I think.

Attach this script to passive racial ability.

Scriptname _RaceEquip extends activemagiceffect  

actor property PlayerRef Auto
Race property bRace Auto
Armor property aItem Auto

Event OnRaceSwitchComplete ()
    if PlayerRef.GetRace() == bRace
        PlayerRef.AddItem (aItem, 1, true)
        PlayerRef.EquipItem (aItem)
    else
        PlayerRef.RemoveItem (aItem, 1, true)
    endif
EndEvent

Event OnEffectFinish (Actor akTarget, Actor akCaster)
    PlayerRef.RemoveItem (aItem, 1, true)
EndEvent

Add armor "aItem" to player if his race is bRace and equip it.

If player race is not bRace - then we need to remove this item from player.

Posted

Something like this I think.

Attach this script to passive racial ability.

Scriptname _RaceEquip extends activemagiceffect  

actor property PlayerRef Auto
Race property bRace Auto
Armor property aItem Auto

Event OnRaceSwitchComplete ()
    if PlayerRef.GetRace() == bRace
        PlayerRef.AddItem (aItem, 1, true)
        PlayerRef.EquipItem (aItem)
    else
        PlayerRef.RemoveItem (aItem, 1, true)
    endif
EndEvent

Event OnEffectFinish (Actor akTarget, Actor akCaster)
    PlayerRef.RemoveItem (aItem, 1, true)
EndEvent

Add armor "aItem" to player if his race is bRace and equip it.

If player race is not bRace - then we need to remove this item from player.

Woah thats awesome. Thank you very much.

 

Is it possible to simplify it by using a formlist?

 

kinda like spellform

 

Or there is no additem formlist in CK?

Posted

 

Woah thats awesome. Thank you very much.

 

Is it possible to simplify it by using a formlist?

 

kinda like spellform

 

Or there is no additem formlist in CK?

 

I think it is possible, at least for "additem" part.

Check this manual.

 

Something like

Scriptname _RaceEquip extends activemagiceffect  

actor property PlayerRef Auto
Race property bRace Auto
FormList Property ListOfObjectsFLST Auto

Event OnRaceSwitchComplete ()
    if PlayerRef.GetRace() == bRace
        Int iIndex = ListOfObjectsFLST.GetSize()
        While iIndex
            iIndex -= 1
            ObjectReference kReference = ListOfObjectsFLST.GetAt(iIndex) As ObjectReference
        PlayerRef.AddItem (kReference, 1, true)
        PlayerRef.EquipItem (kReference)
        EndWhile
    EndIf
EndEvent

Event OnEffectFinish (Actor akTarget, Actor akCaster)
        Int iIndex = ListOfObjectsFLST.GetSize()
        While iIndex
            iIndex -= 1
            ObjectReference kReference = ListOfObjectsFLST.GetAt(iIndex) As ObjectReference
    PlayerRef.RemoveItem (kReference, 1, true)
        EndWhile
EndEvent

But I'm not sure how it will work.

Posted

 

 

Woah thats awesome. Thank you very much.

 

Is it possible to simplify it by using a formlist?

 

kinda like spellform

 

Or there is no additem formlist in CK?

 

I think it is possible, at least for "additem" part.

Check this manual.

 

Something like

Scriptname _RaceEquip extends activemagiceffect  

actor property PlayerRef Auto
Race property bRace Auto
FormList Property ListOfObjectsFLST Auto

Event OnRaceSwitchComplete ()
    if PlayerRef.GetRace() == bRace
        Int iIndex = ListOfObjectsFLST.GetSize()
        While iIndex
            iIndex -= 1
            ObjectReference kReference = ListOfObjectsFLST.GetAt(iIndex) As ObjectReference
        PlayerRef.AddItem (kReference, 1, true)
        PlayerRef.EquipItem (kReference)
        EndWhile
    EndIf
EndEvent

Event OnEffectFinish (Actor akTarget, Actor akCaster)
        Int iIndex = ListOfObjectsFLST.GetSize()
        While iIndex
            iIndex -= 1
            ObjectReference kReference = ListOfObjectsFLST.GetAt(iIndex) As ObjectReference
    PlayerRef.RemoveItem (kReference, 1, true)
        EndWhile
    EndIf
EndEvent

But I'm not sure how it will work.

 

I'll test it out, thank you very much, I'm out for work in a bit.

Archived

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

  • Recently Browsing   0 members

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