scripting a fighting pit

Post » Thu Jun 21, 2012 7:04 pm

Im having alot of trouble trying to come up with an essential script for a mod im working on to create a sparticus inspired fighting pit, im trying to write something that i could put into either a quest stage or a dialogue that would get the armor the player is wearing to ensure the correct raiment is worn and to prevent the player from removing until the fight is over, my problem is i cant seem to come up with anything to get the equiped armor or to prevent the player from unequipping, im still relavtively new to scripting so if anyone can help me out or point me to a tutorial i would really appreciate it, or if anyone has an idea for a simplified script that would work in this situation that would be awesome
User avatar
josh evans
 
Posts: 3471
Joined: Mon Jun 04, 2007 1:37 am

Post » Thu Jun 21, 2012 6:43 pm

I have no idea about these things so do be gentle if I am saying something stupid, but maybe have a look at the arena from Oblivion and see if you can build from there.
User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm

Post » Thu Jun 21, 2012 1:15 pm

Unless using SKSE, there's not currently a way to get what apparel items are equipped, but you can pull it off with the new UnequipItemSlot function on a Player alias.

Spoiler
  • Fight preparation script
    Bool bReadyToRumbleInt iIndexObjectReference rApparelItemActor Property PlayerREF AutoArmor Property ArenaARMO AutoFormList Property EmptyFLST AutoYourArenaModPlayerAliasScript Property PlayerAliasScript AutoEvent SomeEvent()	If bReadyToRumble ; Change clothing		PlayerAliasScript.Strip()		Utility.WaitMenuMode(1) ; Give other script time to catch the items		PlayerREF.EquipItem(ArenaARMO, True) ; Disallow unequip. Will give the armor at the same time.	Else		PlayerREF.RemoveItem(ArenaARMO)		iIndex = BagOfHoldingDroppedItemFLST.GetSize()		While iIndex > 0			iIndex -= 1			rApparelItem = EmptyFLST.GetAt(iIndex) As ObjectReference			rApparelItem.Enable()			rApparelItem.Activate(PlayerREF)			PlayerREF.EquipItem(rApparelItem.GetBaseObject(), False, True)		EndWhile	EndIfEndEvent
  • Player Alias
    ScriptName YourArenaModPlayerAliasScript extends ReferenceAliasActor Property PlayerREF AutoFormList Property EmptyFLST AutoState Catch	Event OnObjectUnequipped(Form akBaseObject, ObjectReference akReference)		ObjectReference rObject = EmptyFLST.AddForm(PlayerREF.DropObject(akBaseObject))		If rObject			rObject.Disable()		EndIf	EndEventEndStateFunction Strip(Int aiSlot = 44, String asInitialState = "")	asInitialState = GetState()	GoToState("Catch")	While aiSlot > 30		aiSlot -= 1		PlayerREF.UnequipItemSlot(aiSlot)		Utility.WaitMenuMode(0.01)	EndWhile	GoToState(asInitialState)EndFunction
User avatar
hannaH
 
Posts: 3513
Joined: Tue Aug 15, 2006 4:50 am

Post » Thu Jun 21, 2012 10:36 pm

that was my first thought but i just recently started playing on pc and apparently none of my friends have oblivion for pc
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am

Post » Thu Jun 21, 2012 11:34 pm

wow, thanks alot justinother, i can say almost for sure i never would have come up with that on my own, i really appreciate it
User avatar
marie breen
 
Posts: 3388
Joined: Thu Aug 03, 2006 4:50 am

Post » Thu Jun 21, 2012 3:40 pm

wow, thanks alot justinother, i can say almost for sure i never would have come up with that on my own, i really appreciate it
No problem :) I'm assuming you want to strip the player, force equip arena armor for the duration of the fight, then later remove the arena armor and re-equip whatever the player had on before the fight? If so, that'll work.
User avatar
Rachie Stout
 
Posts: 3480
Joined: Sun Jun 25, 2006 2:19 pm

Post » Thu Jun 21, 2012 7:58 pm

yeah that definitley works, will the force equip prevent the player from re-equiping while in combat though? or will i have to remove their inventory (like when you go to jail) for the duration of the fight?
User avatar
Alyesha Neufeld
 
Posts: 3421
Joined: Fri Jan 19, 2007 10:45 am

Post » Thu Jun 21, 2012 9:56 pm

yeah that definitley works, will the force equip prevent the player from re-equiping while in combat though? or will i have to remove their inventory (like when you go to jail) for the duration of the fight?
With the abPreventRemoval flag set to 'True' for EquipItem, the player will be forced to wear the item until !bReadyToRumble. The items the player is wearing will be out of the player's inventory for the duration of the fight, disabled after getting dropped one by one to be re-enabled, taken, then re-equipped post arena match.
User avatar
(G-yen)
 
Posts: 3385
Joined: Thu Oct 11, 2007 11:10 pm

Post » Thu Jun 21, 2012 4:11 pm

awesome thanks alot man
User avatar
Bellismydesi
 
Posts: 3360
Joined: Sun Jun 18, 2006 7:25 am


Return to V - Skyrim