Aller au contenu

Photo

question: is 'oPC' a valid sTarget string?


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
dickel

dickel
  • Members
  • 72 messages
I've tried using 'oPC' before with a conversation script action.
specifically ga_jump
Basically the PC initiates dialog with a hanging rope and is given the option to climb it. Depending on a condition check the PC will climb the rope and 'ga_jump' to the top.
ga_jump has a param - sTarget (string) and I was wondering if oPC was a valid option here?
btw- leaving it default uses Owner.

Initially I tried having the ga_jump action on the final line of dialog which is a pc [END DIALOG] node.
I left the sTarget blank, thinking that it would just correspond to whichever pc used that previous PC node...but not the case.
So my question is, I am wondering if I put oPC in the sTarget box in the conversation, then would that grab the PC that used that line of dialog?

I have done this once before in the past, and am fairly sure it's what caused my module to become corrupt....i've learnt now to save in directory format, which is only way to go.

Anyway, a quick response on this would be ace. Thanks all and peace.
:wizard:

#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Take a look at Referencing Objects in Scripts

jump uses this prototype -> void main(string sDestination, string sTarget, float fDelay)

sTarget uses GetTarget with a default of owner.

Which means you can use the following $ symbols

$OBJECT_SELF ---- then it uses OBJECT_SELF (conversation owner)
$OWNER ---- then it uses OBJECT_SELF (conversation owner)
$OWNED_CHAR ---- then it uses GetOwnedCharacter(OBJECT_SELF)
$PC ---- then it uses GetPCSpeaker();
$PC_LEADER ---- then it uses GetFactionLeader(GetFirstPC()) // won't work in MP
$PC_NEAREST ---- then it uses NearestPC(); (owned and alive)
$PC_SPEAKER ---- then it uses GetPCSpeaker()
$MODULE ---- then it uses GetModule();
$LASTSPEAKER ---- then it uses GetLastSpeaker();

I would play around with those, some trial and error and learn how they work. ( i don't do a lot of convo scripting but this is used a lot and is powerful )

#3
MasterChanger

MasterChanger
  • Members
  • 686 messages
Ah, took my a while to find this since I don't script that many convo's, and usually just use my own custom scripts if I do. Take a look at ginc_param_const, which is included by ga_jump as well as many other scripts called from conversations. It declares a bunch of const strings that are used during conversations.

For example...
const string TARGET_PC              = "$PC";            // PCSpeaker
...so you should be able to use either "TARGET_PC" or "$PC" as a parameter for ga_jump.

Edit: Ninja'd by the Sensei! :ph34r: Still, I cited sources, which has gotta count for something, eh?

Modifié par MasterChanger, 05 mars 2011 - 09:39 .


#4
dickel

dickel
  • Members
  • 72 messages
Thanks for the replies Master and Painof, that clears that up nicely.
My module continues :D