Jump to content

getting actor value within script


OvertWizzard

Recommended Posts

Hi All, I am relatively new to scripting for Oblivion, i am more akin to imperative languages such as c/c++/java etc. Anyway thats not the point of the post. In the script i am currently attempting to write i want to be able to change an NPCs disposition based on some + or - key press. I have no issue identifying that i am looking at an NPC i just cant perform functions on the npc such as getdisposition. Here is an example of what i am talking about:

 

float Fquestdelaytime
ref target
int type
int actorValue
begin GameMode
set Fquestdelaytime to 0.01
if(onkeydown 47)
set target to GetCrosshairRef
set type to target.GetObjectType
target.GetDisposition <-- throws the error "missing parameter Actor"
if(type == 35)
messagebox"NPC"
endif
endif
end
Some help would be appreciated as i am sure this is a simple fix but as i am new to this i do not yet know what it is.
Best,
Overt
Link to comment
Share on other sites

Hid your redundant duplicate topic.

 

Hmm, I'm not sure, but this one looks like a rather simple problem for a change.

 

There is no such thing as a global disposition of an actor. Disposition always requires a target towards which it's aimed, such as the NPC's disposition towards the player, which is what I think you're asking for in this case here.

So the correct usage requires you to make it "target.GetDisposition player", for it to ever have any chance to work.

 

Here's the relevant function reference: http://cs.elderscrolls.com/index.php?title=GetDisposition

Link to comment
Share on other sites

Hi Drake,

 

Thanks for the reply.

 

Ive edited this post as i had my very favourite special hat on and wasn't saving the scripts before running the game <-- used to ides that compile everything not just tiny bits of code. that worked thankyou very much for your time :smile:

Edited by OvertWizzard
Link to comment
Share on other sites

  • Recently Browsing   0 members

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