Jump to content

How to get reference?


Recommended Posts

I can remove the p that it added to the:

GlobalVariable Property PATaAH_GlobalVariable Auto Const Mandatory
but not the const.
Adding: If (akFurniture.getbaseobject() is Terminal)
Results in compile error Terminal is a form type.
Papyrus Compiler Version 2.8.0.4 for Fallout 4
Copyright © ZeniMax Media. All rights reserved.
Starting 1 compile threads for 1 files...
Compiling "ATaAH_Quest_Script.psc"...
H:\SteamLibrary\steamapps\common\Fallout 4\Data\Scripts\Source\User\ATaAH_Quest_Script.psc(13,7): a property cannot be used directly on a type, it must be used on a variable
H:\SteamLibrary\steamapps\common\Fallout 4\Data\Scripts\Source\User\ATaAH_Quest_Script.psc(13,7): GetPlayer is not a property on script game or one of its parents
H:\SteamLibrary\steamapps\common\Fallout 4\Data\Scripts\Source\User\ATaAH_Quest_Script.psc(13,17): none is not a known user-defined script type
No output generated for ATaAH_Quest_Script.psc, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on ATaAH_Quest_Script.psc
Link to comment
Share on other sites

No you messed something. As I said already, just read what errors say. you are missing () after getplayer as it is method not property. The script bellow compiles without problems.


GlobalVariable Property ATaAH_GlobalVariable Auto
Perk Property ATaAH_Perk Auto
 
Event OnInit()
  RegisterForRemoteEvent(Game.getplayer(),"OnGetUp")
  Game.getplayer().addperk(ATaAH_Perk)
endevent
 
Event Actor.OnGetUp(Actor akSender, ObjectReference akFurniture)
  if (akFurniture.getbaseobject() is Terminal)
    Game.GetPlayer().SetScale(ATaAH_GlobalVariable.GetValue())
  endif
endEvent
Link to comment
Share on other sites

Yeah, still learning to read the cryptic error messages.

 

But on the positive side it half works.

 

The quest script adds the perk, I am resized to 1 when I activate the terminal.

 

Unfortunately I am not resized on leaving the terminal.

I used console commands to check the global variable and it has not been changed by the perk to my characters new size.

 

Can the const be stopping the variable being updated? I have checked everything is named correctly.

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment
Scriptname Fragments:Perks:PRKF_ATaAH_Perk_01000F9A Extends Perk Hidden Const

;BEGIN FRAGMENT Fragment_Entry_00
Function Fragment_Entry_00(ObjectReference akTargetRef, Actor akActor)
;BEGIN CODE
If !(Game.GetPlayer().GetScale() == 1)
	ATaAH_GlobalVariable.setvalue(Game.GetPlayer().GetScale())
       Game.GetPlayer().SetScale(1.0)
	akTargetRef.Disable()
	akTargetRef.Enable()
	akTargetRef.Activate(Game.GetPlayer())
EndIf
;END CODE
EndFunction
;END FRAGMENT

;END FRAGMENT CODE - Do not edit anything between this and the begin comment

GlobalVariable Property ATaAH_GlobalVariable Auto Const Mandatory

Edited by stonefisher
Link to comment
Share on other sites

Ok, that's probably what causes problem as you cannot change values of Const properties and also can't add other than Const properties on perk fragment as fragment itself is Const too. Gonna suggest a workaround, attach this script on perk itself NOT on perk entry:

GlobalVariable Property ATaAH_GlobalVariable Auto

Event OnEntryRun(int auiEntryID, ObjectReference akTarget, Actor akOwner)
	if (auiEntryID == 0)
		ATaAH_GlobalVariable.setvalue(Game.getplayer().GetScale())
	endif
endevent
Edited by shavkacagarikia
Link to comment
Share on other sites

WOOHOOOO.

 

Thanks alot shavkacagarikia. Works a treat and I learned more about how to use the creation kit. Now I can play as a giant or a midget.

Just need to tweak the script so you can still use terminals at normal size and add some size change pills and I can share it with the public too.

Link to comment
Share on other sites

Well, Had a bug reported and been working on it for hours and hours with no success.

 

Seems this mod breaks: Fragments:Quests:QF_PlayerHackSuccess_00211C2C

 

Which seems to be the part responsible for showing hacking difficulty of the terminal.

 

Cant add it to my script which means I have to move the perk script fragment which all it is now is resizing the player to 1 when the terminal is activated.

 

Maybe i can have it show both activation options but you cannot choose the hack button? but I do not know how to do that.

Link to comment
Share on other sites

I suppose it's because, the perk fragment label overides default activation label. I don't think we can fully fix that. But I have some ideas. We can make it like, when terminal is locked, a new label will be added instead of overiding so difficulty level will be visible. But the problem here is that if it is activated with default key your script won't be fired.

The other tow options are almost similar to each other.

1) we add second entry point and when it pressed it will show lock level as notification

2) you add line in script which will show lock level as notification when terminal is activated (but this is worst variant in my opinion)

both variants will use GetLockLevel to check how much terminal is locked. https://www.creationkit.com/index.php?title=GetLockLevel_-_ObjectReference

Edited by shavkacagarikia
Link to comment
Share on other sites

  • Recently Browsing   0 members

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