Jump to content

Need help figuring out Event References.


Recommended Posts

Working on a new Race that is a direct copy of "HumanRace" but I want to foolproof it for whenever some settings are changed(IE: Player Scaling). Issue with player scaling is in events such as Terminals the camera is oriented on the Face Bone and will either be higher or lower than the screen, somewhat the same for LooksMenu except the camera is at a set height. I want to call upon the Events that trigger entering and exiting both scenes.

 

(Example)

 

 

Event OnLooksMenuEvent(Actor PlayerREF) ;Not sure if this is the actual Event, the wiki sends me to a gateway error and there is nothing for terminals.
  if PlayerREF.GetScale != 0.98
    PlayerREF.SetScale = 0.98
  Else
    PlayerREF.GetScale == 0.98
  EndIf
EndEvent

 

 

 

Same thing for Terminal and get it to set it back to Race Default upon exit.

 

 

Next is calling upon the armor/clothing equipping, which I already understand which event defines it but would like someone to take a look at it as there is an issue with the script and if I am doing something wrong. Figured this one out.

 

 

 

Scriptname aaClothesSwitchTest extends ObjectReference Conditional Const

Armor Property PlayerClothing Auto Const
Armor Property RegClothing Auto Const
Actor Property PlayerRef Auto Const

Event OnEquipped(Actor PlayerREF)
if PlayerREF.EquipItem(RegClothing)
PlayerREF.AddItem(PlayerClothing, absilent=true)
PlayerREF.EquipItem(PlayerClothing, absilent=true)
PlayerREF.RemoveItem(RegClothing, absilent=true)
Else
PlayerREF.EquipItem(PlayerClothing)
EndIf
EndEvent

 

 

 

Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "aaClothesSwitchTest"...
C:\Users\*****\AppData\Local\Temp\PapyrusTemp\aaClothesSwitchTest.psc(8,2): cannot cast a void to a bool to perform a condition check
No output generated for aaClothesSwitchTest, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.

 

 

 

 

Edited by Guest
Link to comment
Share on other sites

Event OnLooksMenuEvent(Actor PlayerREF)

is incorrect. It should be:

 

Event OnLooksMenuEvent(int aiFlavor)

=====

 

  Else
    PlayerREF.GetScale == 0.98
  EndIf

What is that ^^ supposed to do? Not logical.

 

Why not simply add keyword FurnScaleActorToOne to your furniture?

 

  if PlayerREF.EquipItem(RegClothing)

EquipItem does not return anything, so you cannot use it as a boolean operator in an IF statement.

 

HOWEVER, by putting EquipItem within OnEquipped you are basically creating an INFINITE LOOP because equipping something will fire OnEquipped, which will force player to do the EquipItem, which will fire OnEquipped, which will force the player to EquipItem, which will fire OnEquipped.... :rolleyes:

Edited by steve40
Link to comment
Share on other sites

Event OnLooksMenuEvent(Actor PlayerREF)

is incorrect. It should be:

 

Event OnLooksMenuEvent(int aiFlavor)

=====

 

  Else
    PlayerREF.GetScale == 0.98
  EndIf

What is that ^^ supposed to do? Not logical.

 

Why not simply add keyword FurnScaleActorToOne to your furniture?

 

  if PlayerREF.EquipItem(RegClothing)

EquipItem does not return anything, so you cannot use it as a boolean operator in an IF statement.

 

HOWEVER, by putting EquipItem within OnEquipped you are basically creating an INFINITE LOOP because equipping something will fire OnEquipped, which will force player to do the EquipItem, which will fire OnEquipped, which will force the player to EquipItem, which will fire OnEquipped.... :rolleyes:

 

Thank you for the helpful advice on the LooksMenu and key idea for the keywords is clever! The script I put up was a quick mock up as an example of what I was trying to do. As for the armor script I already got a working script and it helped me learn a lot on how the scripting works in the engine. Improving upon it will take some time but it's starting off well!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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