Jump to content

Getting a value and applying it to an intiger?


Darkvalkyr

Recommended Posts

Hey all,

 

I was just wondering if anyone could tell me how I can Get and Actor Value from an Actor, and then apply it to an Intiger in Script?

 

I've tried a fair bit of things but so far no dice.

 

In my situation:

My script is extending an ObjectReference.

FKFeresHealth is an intiger property, it is meant to be a variable that holds the value of the actor's current health.

FKFeres is the Actor, under the alias Feres in the quest FKFeresTracking.

The Alias Feres has been defined as an AliasReference property.

 

Trying out FKFeresHealth = (Feres.GetReference().GetAV usually leads to a 'no viable alternative at input '.' error.

 

 

Can anyone help me out?

 

Cheers,

DV

Edited by Darkvalkyr
Link to comment
Share on other sites

Ok first you need to declare Feres as an actor property "Actor property Feres auto", then define the integrer, "Int FeresHealth" (never tried to delcare an int but im guessing it should look something like that. Then save and compile the script, go to the window where the script is, where you can see Add/Remove/Properties, select the script and go to properties, there you should see a variable named Feres, select it, click on Edit value, then 2 slidebars will popup, one with the cell and the other with the referençe, if your actor is on a specefied cell, select that cell, else select any and go to the ref and look for Feres under there.

Once you have all that, you will get Feres in your script and you could manipulate him, problem is you cant just call functions outside events, so if you want to get the health, you probably are doing it ok, its just outside an event, so look on the OnLoad or OnActivate events, I dont know, depends on what you need.

Link to comment
Share on other sites

Thanks for the speedy reply!

 

That makes sense, I'll try it out.

 

I was actually trying to get this info (along with his other stats) via dialogue. So I'd choose a Topic and then that'd end the conversation, bringing up a Message box to list down the stats. Would there be specific Topic Events I can use? I remember reading a bit about them on the tutorial.

 

Cheers,

DV

Link to comment
Share on other sites

  • Recently Browsing   0 members

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