Jump to content

EquipItem and potions not working


demonofsarila

Recommended Posts

Ok so from what I've read online and in source code, one way to get a set of effects (like say str +1 or int -2) to show up in the pitboy and effect the player is add them to a potion and then in a script use equipitem to add the potion. Only problem is I cannot get it to work and have no idea why. The CK compiler throws no errors. Since the script I'm working on is currently just shy of 300 lines, here's the relevant parts:

 

Actor Player

Potion Property MyAwesomePotion Auto Const

Function msg(string asTextToPrint)
Debug.Notification("DEBUG: " + asTextToPrint)
EndFunction

 

Event OnInit()
Player = Game.GetPlayer()
RegisterForRemoteEvent(Player, "OnPlayerLoadGame")

EndEvent

Event Actor.OnPlayerLoadGame(actor aSender)
Player = Game.GetPlayer()
Player.EquipItem(MyAwesomePotion, true, true)
msg("Added MyAwesomePotion: " + Player.IsEquipped(MyAwesomePotion))

EndEvent

 

 

And yes I've gone into the properties of my script and added the default value for MyAwesomePotion as MyAwesomePotion that I made out in the object window. But when I load a save, I see the message/notifcation "DEBUG: Added MyAwesomePotion: false" and the character has no status effects in their pitboy so idk wtf is going on and what I did wrong.

 

My big goal is to temporarily raise/lower some of the SPECIAL stats with a few different sets, similar to how being thirsty or hungry in the HC survival temporarily lowers some of your SPECIAL stats. And I'm totally open to better ways to do that as long as they work.

Edited by demonofsarila
Link to comment
Share on other sites

  • Recently Browsing   0 members

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