Jump to content

Script: "ModActorValue is not a function or does not exist"


Recommended Posts

Hello dear modders,

I really don't know what is wrong with this script.
Its extends to "Actor", so I should be able to use ModActorValue or ModAV in my script, isn't it ?

Scriptname WALKBagSetInfiniteScript extends Actor

Actor Property Player auto

Event OnActivate(ObjectReference akActionRef)
    
    Player.ModActorValue("CarryWeight", 9999999)

endEvent

Here is the compiler result

Starting 1 compile threads for 1 files...
Compiling "WALKBagSetInfiniteScript.psc"...
D:\SteamLibrary\steamapps\common\Fallout 4\Data\Scripts\Source\User\WALKBagSetInfiniteScript.psc(7,8): ModActorValue is not a function or does not exist
No output generated for WALKBagSetInfiniteScript.psc, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on WALKBagSetInfiniteScript.psc

It says ModActorValue does not exist anyway.

Thanks for any answer :3

Link to comment
Share on other sites

To set a hard absolute value;

ActorValue Property pCarryWeight Auto Const Mandatory
Actor      Property pPlayerREF   Auto Const Mandatory

Event OnActivate(ObjectReference akActionRef)
   pPlayerREF.SetValue(pCarryWeight, 9999)
EndEvent

To set a relative value (script is n00b longhand to show working);

ActorValue Property pCarryWeight Auto Const Mandatory
Actor      Property pPlayerREF   Auto Const Mandatory

Event OnActivate(ObjectReference akActionRef)
   Float fTargetLimit = 9999
   Float fCurrentLimit = pPlayerREF.GetValue(pCarryWeight)
   Float fDeltaWeight = (fTargetLimit - fCurrentLimit)
   pPlayerREF.ModValue(pCarryWeight,  fDeltaWeight)
EndEvent
Link to comment
Share on other sites

 

To set a hard absolute value;

ActorValue Property pCarryWeight Auto Const Mandatory
Actor      Property pPlayerREF   Auto Const Mandatory

Event OnActivate(ObjectReference akActionRef)
   pPlayerREF.SetValue(pCarryWeight, 9999)
EndEvent

To set a relative value (script is n00b longhand to show working);

ActorValue Property pCarryWeight Auto Const Mandatory
Actor      Property pPlayerREF   Auto Const Mandatory

Event OnActivate(ObjectReference akActionRef)
   Float fTargetLimit = 9999
   Float fCurrentLimit = pPlayerREF.GetValue(pCarryWeight)
   Float fDeltaWeight = (fTargetLimit - fCurrentLimit)
   pPlayerREF.ModValue(pCarryWeight,  fDeltaWeight)
EndEvent

Hey thanks, I will keep that :smile:

 

Edit: I havn't even noticed my original script hasn't got the first line that is required

Edited by Ryder104
Link to comment
Share on other sites

 

Because ModActorValue() doesn't exist. You use ModValue(ActorValue akAV, float afAmount) on actors

Lol ok, thank you. Modactorvalue does not exist but I found it on creationkit.com nevermind :confused:

Creationkit.com is split between skyrim and fallout. You have to pay attention to which one youâre on. ModActorValue() is a skyrim function and was removed when fallout was developed

Link to comment
Share on other sites

  • Recently Browsing   0 members

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