shavkacagarikia Posted July 19, 2016 Share Posted July 19, 2016 (edited) Hello, i try player to be equipped with another item when player draws any weapon and main item is equipped. here is my script Scriptname aaaBaseAspectRingScript extends ObjectReference Armor Property RingPower Auto Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() if (Game.Getplayer().IsWeaponDrawn() == true) Debug.MessageBox("Player equip weapon") Game.GetPlayer().EquipItem(RingPower) elseif (Game.Getplayer().IsWeaponDrawn() == false) Game.GetPlayer().UnEquipItem(RingPower) endif endif endEvent but I think IsWeaponDrawn isn't working any ideas what's the problem? Edited July 19, 2016 by shavkacagarikia Link to comment Share on other sites More sharing options...
maniczombie Posted July 19, 2016 Share Posted July 19, 2016 Think the issue is the event On equip only firing before the player has chance to draw the weapon. Try a different event such as an update loop or on a registered animation event Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 19, 2016 Author Share Posted July 19, 2016 register for update isn't working inside onequipped event, because it's member function or something like that, and i haven't heard about animation events can you give me more hints about them? Link to comment Share on other sites More sharing options...
NexusComa Posted July 19, 2016 Share Posted July 19, 2016 I take it this script is on the weapon in question.Just guessing here on this code ... but it should be right. Scriptname aaaBaseAspectRingScript extends ObjectReference Armor Property RingPower Auto Event OnEquipped(Actor akActor) Game.GetPlayer().EquipItem(RingPower)endEvent Event OnUnEquipped(Actor akActor) Game.GetPlayer().UnEquipItem(RingPower)endEvent Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 19, 2016 Author Share Posted July 19, 2016 I take it this script is on the weapon in question.Just guessing here on this code ... but it should be right. Scriptname aaaBaseAspectRingScript extends ObjectReference Armor Property RingPower Auto Event OnEquipped(Actor akActor) Game.GetPlayer().EquipItem(RingPower)endEvent Event OnUnEquipped(Actor akActor) Game.GetPlayer().UnEquipItem(RingPower)endEvent no i want the item to be equipped when the weapon is out, not equipped, and no this script is on another ring, when you have it equipped and draw any weapon another ring should be equipped on player Link to comment Share on other sites More sharing options...
NexusComa Posted July 19, 2016 Share Posted July 19, 2016 (edited) Guess #2 ... True = -1 to a code, you're looking for a 1 or not a 1 Scriptname aaaBaseAspectRingScript extends ObjectReference Armor Property RingPower Auto Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() if (Game.Getplayer().IsWeaponDrawn() == 1) Debug.MessageBox("Player equip weapon") Game.GetPlayer().EquipItem(RingPower) elseif (Game.Getplayer().IsWeaponDrawn() != 1) Game.GetPlayer().UnEquipItem(RingPower) endif endifendEvent Wait I can see a problem already it will continuously keep putting the ring away or on like this ... you just want it to do that once so ... 1 second Edited July 19, 2016 by NexusComa Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 19, 2016 Author Share Posted July 19, 2016 that works when i already have weapon equipped and then equip the ring, but i want to somehow check everytime when player equips the weapon Link to comment Share on other sites More sharing options...
NexusComa Posted July 20, 2016 Share Posted July 20, 2016 (edited) Guess #3 ... not sure how to test for "item is equipped" without a huge loop so this will do. Scriptname aaaBaseAspectRingScript extends ObjectReference Armor Property RingPower Auto int RingState = 0 Event OnEquipped(Actor akActor) if akActor == Game.GetPlayer() if (Game.Getplayer().IsWeaponDrawn() == 1) if(RingState == 0) Game.GetPlayer().EquipItem(RingPower) RingState = 1 endif elseif (Game.Getplayer().IsWeaponDrawn() != 1) if(RingState == 1) Game.GetPlayer().UnEquipItem(RingPower) RingState = 0 endif endif endifendEvent Event OnUnEquipped(Actor akActor) Game.GetPlayer().UnEquipItem(RingPower) RingState = 0endEvent Edited July 20, 2016 by NexusComa Link to comment Share on other sites More sharing options...
shavkacagarikia Posted July 20, 2016 Author Share Posted July 20, 2016 no as previous one works only when i equip ring on already drawn weapon Link to comment Share on other sites More sharing options...
NexusComa Posted July 20, 2016 Share Posted July 20, 2016 (edited) I think my problem here is the Event OnEquipped(Actor akActor)Only triggers one time as you equip the item. Without going to the kit and building this I am just guessing ... Edited July 20, 2016 by NexusComa Link to comment Share on other sites More sharing options...
Recommended Posts