Hi folks,
For some reason, I'm having something strange going on that I don't seem to be able to change.
What I want is for the PC, when they walk into a trigger, to turn and face a storm giant statue that's in a cave very close to them & start a conversation with it.
This is the script I have (courtesy of Lilac Soul's gerator):
void main()
{
object oTarget;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Have the PC turn to face "atomas_pool".
oTarget = GetNearestObjectByTag("atomas_pool", oPC);
AssignCommand(oPC, SetFacingPoint(GetPosition(oTarget)));
// The PC holds an inner dialog.
AssignCommand(oPC, ActionStartConversation(oPC, "atomas_statue_te", FALSE, FALSE));
}
What happens is the convo fires, but whichever way the PC is facing when they walk into the trigger - usually north, but I've tried hitting the trigger from various directions - every time, the PC turns east.
What's going on here? Any ideas? Is the PC looking for the rising sun or something?
Notes:
atomas_pool is the tag of a small boulder in the centre of the pool that the petrified giant it standing in - I tried using the tag of the giant itself, but it didn't work - I thought a placeable might - but no such luck.
Atomas_statue_te is the convo that needs to fire - this part works fine.
Any ideas or advice very gratefully received - I'm getting really close to release of this adventure now & this is one of the few things besides a bit of a polish that left to sort out.
Cly.
PC won't face the way I want him to...
Débuté par
Clyordes
, juin 13 2012 01:55
#1
Posté 13 juin 2012 - 01:55
#2
Posté 13 juin 2012 - 03:48
Try it like this:
void main()
{
object oTarget;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Have the PC turn to face "atomas_pool".
oTarget = GetNearestObjectByTag("atomas_pool", oPC);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, SetFacingPoint(GetPosition(oTarget)));
// The PC holds an inner dialog.
AssignCommand(oPC, ActionStartConversation(oPC, "atomas_statue_te", FALSE, FALSE));
}
See if that helps.
void main()
{
object oTarget;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Have the PC turn to face "atomas_pool".
oTarget = GetNearestObjectByTag("atomas_pool", oPC);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, SetFacingPoint(GetPosition(oTarget)));
// The PC holds an inner dialog.
AssignCommand(oPC, ActionStartConversation(oPC, "atomas_statue_te", FALSE, FALSE));
}
See if that helps.
#3
Posté 13 juin 2012 - 09:45
Hi GhostofGod - thanks for the fast response.
Just tested & sadly, my testing PC still appears obsessed with staring over to the right of where my giant is.
I'm sure there's some logical, easy to fix reason - but its foxing me at the moment.
Any other good ideas?
Cly
Just tested & sadly, my testing PC still appears obsessed with staring over to the right of where my giant is.
I'm sure there's some logical, easy to fix reason - but its foxing me at the moment.
Any other good ideas?
Cly
#4
Posté 13 juin 2012 - 09:57
// Get the nNth object nearest to lLocation that is of the specified type.
// - nObjectType: OBJECT_TYPE_*
// - lLocation
// - nNth
// * Return value on error: OBJECT_INVALID
object GetNearestObjectToLocation(int nObjectType, location lLocation, int nNth=1);
// - nObjectType: OBJECT_TYPE_*
// - lLocation
// - nNth
// * Return value on error: OBJECT_INVALID
object GetNearestObjectToLocation(int nObjectType, location lLocation, int nNth=1);
#5
Posté 13 juin 2012 - 09:59
- what if you setFacingPt
after the StartConvo ( perhaps delaycommand ),
or even in the first node of the dialog ?
after the StartConvo ( perhaps delaycommand ),
or even in the first node of the dialog ?
#6
Posté 13 juin 2012 - 10:00
also try and make the placeable/creature setabletospeaktononplayercharacters or whatever the tickbox is - you'll know it when u c it
#7
Posté 13 juin 2012 - 10:05
Also if you are concerned with efficiency I would just use the "GetObjectByTag()" function. Just make sure whatever you are trying to face has a unique tag that no other object in your module has. Also I wonder if you might need a delay for the conversation line. Give the player time to perform the facing action before the convo start? Just a thought. Those tricky actions.
#8
Posté 13 juin 2012 - 10:16
kevL wrote...
- what if you setFacingPt
after the StartConvo ( perhaps delaycommand ),
or even in the first node of the dialog ?
this is probably the issue - so try this first....
good one kev
#9
Posté 13 juin 2012 - 10:20
.... additional info
this reminds me of a debug item that I use:
and it always twists my PC to the east. It seems to be a characteristic of / oPC talk to oPC /. Hence try setFacing after the conversation starts,
this reminds me of a debug item that I use:
AssignCommand(oPC, ActionStartConversation(oPC, "kg_cv_theitem", TRUE, FALSE, TRUE, FALSE));
and it always twists my PC to the east. It seems to be a characteristic of / oPC talk to oPC /. Hence try setFacing after the conversation starts,
#10
Posté 13 juin 2012 - 10:32
w/ ClearAllActions somewhere, lulz
#11
Posté 13 juin 2012 - 11:17
You can try starting the conversation with a iPoint instead of having the PC talk to themself. Then the PC should turn towards the object they're talking to.
And as GhostofGod and KevL pointed out - ClearAllActions solves a multitude of problems.
And as GhostofGod and KevL pointed out - ClearAllActions solves a multitude of problems.
Modifié par DannJ, 13 juin 2012 - 11:19 .
#12
Posté 14 juin 2012 - 03:26
I have been using variations of gtr_speak_node to start conversations because the object - whatever it may be - does the talking and the objects display name shows in the dialog window too.
#13
Posté 14 juin 2012 - 10:09
Many thanks folks - using a combination of the advice above, I've now got:
/*
* Script generated by LS Script Generator, v.TK.0
*
* For download info, please visit:
* http://nwvault.ign.c....Detail&id=1502
*/
// Put this script OnEnter.
void main()
{
object oActor;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Have "atomas_ip" strike up a conversation with the PC.
oActor = GetNearestObjectByTag("atomas_ip", oPC);
AssignCommand(oActor, ActionStartConversation(oPC, "", FALSE, FALSE));
// Have the PC turn to face "atomas_ip".
DelayCommand(1.0, AssignCommand(oPC, SetFacingPoint(GetPosition(oActor))));
}
& it works a treat!
Many Thanks!
Now onto the next issue....
Cly.
/*
* Script generated by LS Script Generator, v.TK.0
*
* For download info, please visit:
* http://nwvault.ign.c....Detail&id=1502
*/
// Put this script OnEnter.
void main()
{
object oActor;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// Have "atomas_ip" strike up a conversation with the PC.
oActor = GetNearestObjectByTag("atomas_ip", oPC);
AssignCommand(oActor, ActionStartConversation(oPC, "", FALSE, FALSE));
// Have the PC turn to face "atomas_ip".
DelayCommand(1.0, AssignCommand(oPC, SetFacingPoint(GetPosition(oActor))));
}
& it works a treat!
Many Thanks!
Now onto the next issue....
Cly.
#14
Posté 28 juin 2012 - 10:03
Have you tried ActionOrientToObject()? It's in ginc_actions. Very useful for making NPCs face a certain direction.
#15
Posté 06 juillet 2012 - 07:49
Thanks John - just seen your reply - much appreciated. Since the previous advice given worked fine, I'm really loathe to change anything now!
Besides, I'm scratching my head trying to work out an on acquire script that's refusing to work properly - if you can help - I'd be very grateful - see seperate thread - just submitting....
Cly.
Besides, I'm scratching my head trying to work out an on acquire script that's refusing to work properly - if you can help - I'd be very grateful - see seperate thread - just submitting....
Cly.





Retour en haut






