Jump to content

Quick Questions, Quick Answers


Mattiewagg

Recommended Posts

@Darkxenoth: Thanks for looking at this. I'm totally baffled. I know it's something ridiculous that I'm just not thinking about.

 

Here is what I have now. With properties set to armor, additem() no longer functions. Maybe it is because I'm using the Reference Editor IDs and not the base IDs ? But how else would one choose specific instances in game ?

ObjectReference Property CSBJailChestID auto
Armor Property PrisonerOutfitCSB01  auto
Armor Property PrisonerOutfitCSB02  auto
ObjectReference Property PrisonerOutfitCSB03  auto

Event OnTriggerEnter(ObjectReference akActionRef)
    Game.GetPlayer().RemoveAllItems(CSBJailChestID)
    Game.GetPlayer().AddItem(PrisonerOutfitCSB01)
    Game.GetPlayer().AddItem(PrisonerOutfitCSB02)
    Game.GetPlayer().AddItem(PrisonerOutfitCSB03)
    utility.wait(1.25)
    Game.GetPlayer().EquipItem(PrisonerOutfitCSB01, False, True)
    utility.wait(1.25)
    Game.GetPlayer().EquipItem(PrisonerOutfitCSB02, False, True)
    utility.wait(1.25)
    Game.GetPlayer().EquipItem(PrisonerOutfitCSB03, False, True)
EndEvent

EDIT: I've tried using playerRef instead of game.getplayer. Properties are filled out properly. I have no idea what I'm doing wrong.

Edited by csbx
Link to comment
Share on other sites

  • Replies 2.6k
  • Created
  • Last Reply

Top Posters In This Topic

I've noticed a few mods have managed to alter jump height on the fly with new abilities and menu editing. How do they do that? Jumping bonus doesn't seem to work at all and I'm not sure how to use fJumpHeightMin.

 

Edit: Skse function: Game.SetGameSettingFloat("fJumpHeightMin", X)

Edited by Elias555
Link to comment
Share on other sites

@Darkxenoth: Thanks for looking at this. I'm totally baffled. I know it's something ridiculous that I'm just not thinking about.

 

 

Here is what I have now. With properties set to armor, additem() no longer functions. Maybe it is because I'm using the Reference Editor IDs and not the base IDs ? But how else would one choose specific instances in game ?

ObjectReference Property CSBJailChestID auto
Armor Property PrisonerOutfitCSB01  auto
Armor Property PrisonerOutfitCSB02  auto
ObjectReference Property PrisonerOutfitCSB03  auto

Event OnTriggerEnter(ObjectReference akActionRef)
    Game.GetPlayer().RemoveAllItems(CSBJailChestID)
    Game.GetPlayer().AddItem(PrisonerOutfitCSB01)
    Game.GetPlayer().AddItem(PrisonerOutfitCSB02)
    Game.GetPlayer().AddItem(PrisonerOutfitCSB03)
    utility.wait(1.25)
    Game.GetPlayer().EquipItem(PrisonerOutfitCSB01, False, True)
    utility.wait(1.25)
    Game.GetPlayer().EquipItem(PrisonerOutfitCSB02, False, True)
    utility.wait(1.25)
    Game.GetPlayer().EquipItem(PrisonerOutfitCSB03, False, True)
EndEvent

EDIT: I've tried using playerRef instead of game.getplayer. Properties are filled out properly. I have no idea what I'm doing wrong.

 

I created a quick test mod to test your script, in my own way, and it worked fine with some minor adjustments...Here's the script I wrote to test your function:

 

scriptName DarkxTestScript extends ObjectReference

ObjectReference Property DarkxTestChest auto ;would be CSBJailChestID not DarkxTestChest
Armor Property DarkxOutfitTest1  auto ;would be PrisonerOutfitCSB01 not DarkxOutfitTest1
Armor Property DarkxOutfitTest2  auto ;would be PrisonerOutfitCSB02 not DarkxOutfitTest2
Armor Property DarkxOutfitTest3  auto ;would be PrisonerOutfitCSB03 not DarkxOutfitTest3
Armor Property DarkxTestRing auto ;just what I'm using to trigger my script
Message Property DarkxTestMenu auto ;just something I use often

Event OnEquipped(Actor akActor) ;this script is attached to DarkxTestRing, so this is my trigger
	if(akActor == Game.GetPlayer())
		Game.DisablePlayerControls()
		Utility.Wait(0.1)
		akActor.UnequipItem(DarkxTestRing, false, true)
		TestMenu()
		Utility.Wait(0.1)
		Game.EnablePlayerControls()
	endIf
EndEvent
;you can ignore the following...
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
	if(akOldContainer == Game.GetPlayer())
		Utility.WaitMenuMode(0.1)
		akNewContainer.RemoveItem(DarkxTestRing, 1, true)
		akOldContainer.AddItem(DarkxTestRing, 1, true)
	endIf
EndEvent
;the above was just something I did to ensure I don't lose this item, to avoid having to use console
Function TestMenu()
	int iButton = 0
	while(iButton != 2) ;lets you stay in the menu until you exit it
		iButton = DarkxTestMenu.Show()
		if(iButton == 0)
			TestFunction()
			Utility.Wait(0.1)
			Debug.Notification("Completed TestFunction") ;just telling you it finished
		elseIf(iButton == 1)
			DarkxTestChest.RemoveAllItems(Game.GetPlayer(), false, false)
			;Return the items from DarkxTestChest to the player
			Debug.Notification("Items Retrieved") ;just to let you know
		else
			iButton = 2 ;Exit
		endIf
	endWhile
EndFunction
;the following is your code copied and fixed, using my property names, with comments and notifications xD
Function TestFunction()
	Debug.Notification("Removing items...") ;just so you know it did something
	Game.GetPlayer().RemoveAllItems(DarkxTestChest, true, false)
	;move all items, other than quest items, from the player's inventory to DarkxTestChest,
	;with the player retaining ownership
	Utility.Wait(0.1)
	Debug.Notification("Adding new items...") ;again, just so you know it is doing something
	Game.GetPlayer().AddItem(DarkxOutfitTest1, 1, true)
	Game.GetPlayer().AddItem(DarkxOutfitTest2, 1, true)
	Game.GetPlayer().AddItem(DarkxOutfitTest3, 1, true)
	;adds 1 of each of the items to the player's inventory silently
	Utility.Wait(0.1)
	Debug.Notification("Equipping new items...") ;and again...
	Game.GetPlayer().EquipItem(DarkxOutfitTest1, False, True)
	Game.GetPlayer().EquipItem(DarkxOutfitTest2, False, True)
	Game.GetPlayer().EquipItem(DarkxOutfitTest3, False, True)
	;Forces the player to equip the items, allowing them to be removed later, silently
EndFunction

 

I know it isn't exactly the same as your's, since I'm triggering mine with the equipping of a ring and not OnTriggerEnter, but still... Hope it helps! Otherwise, I don't know what the problem is to be honest.

Link to comment
Share on other sites

ActorBase Property MyActor Auto
ObjectReference ActorStore 

Event OnEffectStart(Actor akTarget, Actor akCaster)

	ActorStore = game.getPlayer().placeAtMe(MyActor)
        Debug.Notification("fired") ;doesn't even get to here

EndEvent

Why isn't this placing the actor at the player or firing the notification? Script, FF, self. It's a lesser power, set to voice.

Link to comment
Share on other sites

If the notification isn't triggering then chances are the event isn't even firing. Are you testing this on a new save or a save that has not seen your mod yet? Sometimes the game won't use updated aspects but rather what was baked into the save file.

 

Also, I think you might want to consider using PlaceActorAtMe instead of PlaceAtMe.

Link to comment
Share on other sites

If the notification isn't triggering then chances are the event isn't even firing. Are you testing this on a new save or a save that has not seen your mod yet? Sometimes the game won't use updated aspects but rather what was baked into the save file.

 

Also, I think you might want to consider using PlaceActorAtMe instead of PlaceAtMe.

Yep, that was correct. Thanks!

 

Another 2 questions.

 

I have an actor that the player controls temporarily and I need 2 things from to happen and I can't quite figure out the correct events and syntax. This code is on the actor that is being controlled.

Event OnActivate(ObjectReference akActionRef)

	If akActionRef == PlayerRef ;If the player is being activated

		Self.Disable()

	ElseIf akActionRef == !PlayerRef ;If any other Actor is being activated
		
		akActionRef.ShowGiftMenu(true, AllFood)
		
	EndIf

EndEvent
Link to comment
Share on other sites

 

If the notification isn't triggering then chances are the event isn't even firing. Are you testing this on a new save or a save that has not seen your mod yet? Sometimes the game won't use updated aspects but rather what was baked into the save file.

 

Also, I think you might want to consider using PlaceActorAtMe instead of PlaceAtMe.

Yep, that was correct. Thanks!

 

Another 2 questions.

 

I have an actor that the player controls temporarily and I need 2 things from to happen and I can't quite figure out the correct events and syntax. This code is on the actor that is being controlled.

Event OnActivate(ObjectReference akActionRef)

	If akActionRef == PlayerRef ;If the player is being activated

		Self.Disable()

	ElseIf akActionRef == !PlayerRef ;If any other Actor is being activated
		
		akActionRef.ShowGiftMenu(true, AllFood)
		
	EndIf

EndEvent

Did you mean to disable the actor the script is attached to when the player activates them?

Edit: Reworded my question for clarity...

Edited by Darkxenoth
Link to comment
Share on other sites

 

 

If the notification isn't triggering then chances are the event isn't even firing. Are you testing this on a new save or a save that has not seen your mod yet? Sometimes the game won't use updated aspects but rather what was baked into the save file.

 

Also, I think you might want to consider using PlaceActorAtMe instead of PlaceAtMe.

Yep, that was correct. Thanks!

 

Another 2 questions.

 

I have an actor that the player controls temporarily and I need 2 things from to happen and I can't quite figure out the correct events and syntax. This code is on the actor that is being controlled.

Event OnActivate(ObjectReference akActionRef)

	If akActionRef == PlayerRef ;If the player is being activated

		Self.Disable()

	ElseIf akActionRef == !PlayerRef ;If any other Actor is being activated
		
		akActionRef.ShowGiftMenu(true, AllFood)
		
	EndIf

EndEvent

Did you mean to disable the actor the script is attached to when the player activates them?

Edit: Reworded my question for clarity...

 

No, when the actor that is being controlled by the player activates the PlayerRef, I want the actor to disappear so the player can control their own actor once more. Right now, activating doesn't do anything.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...