Hi there fellows
I'm creating a maze and I would like that each time the player faces a bifurcation, the camera angle would be behind him. My idea is to create a trigger at the tile right in front of the bifurcation that arrange the angle change... but couldnt do it yet.
Can anyone tell me if this is the better (easiest) method to do this? Can anyone tell me how to implemente this trigger system or indicate the faq where I can study it?
Thx!
How to pin the camera
Débuté par
el.sombrero
, avril 18 2012 02:09
#1
Posté 18 avril 2012 - 02:09
#2
Posté 18 avril 2012 - 02:24
You could have a conversation start, then set the conversation camera to show the right angle.
#3
Posté 18 avril 2012 - 08:52
Uhm... but this would break the flowing of the maze... you know, there will be plenty of bifurcations there. If I start a conversation each time, the maze will be like a speed date event :0)
#4
Posté 18 avril 2012 - 09:30
You don't necessarily need to start a conversation with pc lines, a single line barkstring might be sufficient to let you force a camera angle. The barkstring could even be empty on the "npc" side. It might work, it might not.
Another thing to try would be to write a custom version of the RestoreCameraFacing function, since that can apparently be used to set a camera angle as part of a cutscene.
Another thing to try would be to write a custom version of the RestoreCameraFacing function, since that can apparently be used to set a camera angle as part of a cutscene.
#5
Posté 19 avril 2012 - 03:52
you could play around with
Paint a trigger at each junction, that runs a small script using those (nb. i haven't tried this)
void SetCameraFacing(float fDirection, float fDistance = -1.0f, float fPitch = -1.0, int nTransitionType=CAMERA_TRANSITION_TYPE_SNAP); void SetCameraHeight(object oPlayer, float fHeight=0.0f);
Paint a trigger at each junction, that runs a small script using those (nb. i haven't tried this)
Modifié par kevL, 19 avril 2012 - 03:54 .
#6
Posté 19 avril 2012 - 04:16
A year ago I tried working with these functions. I can't remember it working that well, but it is certainly worth a shot. I do wonder if it would be disorienting to the player to have the camera snap around at each bifrucation.
#7
Posté 19 avril 2012 - 04:44
iirc, they worked very well in NwN1 and i had lots of fun & frustration w/ that! ofc this is NwN2 ...
confusing? you bet, it's a maze
confusing? you bet, it's a maze
#8
Posté 20 avril 2012 - 09:33
Hey guys, thx! Saturday I will have sometime off and will try these out!
#9
Posté 16 mai 2012 - 09:34
hey, tried the
void SetCameraFacing(float fDirection, float fDistance = -1.0f, float fPitch = -1.0,
int nTransitionType=CAMERA_TRANSITION_TYPE_SNAP);
void SetCameraHeight(object oPlayer, float fHeight=0.0f);
it did nothing, any other idea?
void SetCameraFacing(float fDirection, float fDistance = -1.0f, float fPitch = -1.0,
int nTransitionType=CAMERA_TRANSITION_TYPE_SNAP);
void SetCameraHeight(object oPlayer, float fHeight=0.0f);
it did nothing, any other idea?
#10
Posté 16 mai 2012 - 11:57
The following script worked great for me when in Exploration or Character Modes -- Strategy Mode left the view pretty borked tho. Unfortunately there's no GetCameraMode function ... else one could adapt to the player's preferred camera ... an alternative is to force SetCameraMode() and send a message to the player that they need to use Character or Exploration mode to navigate the maze (!),
void main()
{
if (GetLocalInt(OBJECT_SELF, "bDone")) return;
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
// from 'x0_inc_generic' GetIsFighting()
object oAttack = GetAttemptedAttackTarget();
object oSpellTarget = GetAttemptedSpellTarget();
if (GetIsObjectValid(oAttack) || GetIsObjectValid(oSpellTarget)) return;
AssignCommand(oPC, ClearAllActions());
SetLocalInt(OBJECT_SELF, "bDone", TRUE);
object oTarget = GetObjectByTag("kg001_ct_dov");
// from 'ginc_cutscene' SetCameraFacingPoint()
vector vPC = GetPosition(oPC);
vector vTarget = GetPosition(oTarget);
// this gives us a vector pointing from PC to Target
vector vDifference = vTarget - vPC;
// we just need the angle of that vector
float fDirection = VectorToAngle(vDifference);
AssignCommand(oPC, SetFacingPoint(vTarget));
AssignCommand(oPC, SetCameraFacing(fDirection, 6.f, 85.f,
CAMERA_TRANSITION_TYPE_FAST));
SendMessageToPC(GetFirstPC(FALSE), ". Camera facing theDove, done");
}
#11
Posté 18 mai 2012 - 07:31
Hey KevL... it worked fine for me too. Sweet.
I just erased
// from 'x0_inc_generic' GetIsFighting()
object oAttack = GetAttemptedAttackTarget();
object oSpellTarget = GetAttemptedSpellTarget();
if (GetIsObjectValid(oAttack) || GetIsObjectValid(oSpellTarget)) return;
and
SetLocalInt(OBJECT_SELF, "bDone", TRUE);
Because I thought these wouldnt be helpful in my situation... The script still works ok... Erasing these lines will have any sideffect. By the way, when the camera angle changes, it comes very near the pc... is there a way to force the camera angle but to keep the distance between it and the pc?
thx dude!
I just erased
// from 'x0_inc_generic' GetIsFighting()
object oAttack = GetAttemptedAttackTarget();
object oSpellTarget = GetAttemptedSpellTarget();
if (GetIsObjectValid(oAttack) || GetIsObjectValid(oSpellTarget)) return;
and
SetLocalInt(OBJECT_SELF, "bDone", TRUE);
Because I thought these wouldnt be helpful in my situation... The script still works ok... Erasing these lines will have any sideffect. By the way, when the camera angle changes, it comes very near the pc... is there a way to force the camera angle but to keep the distance between it and the pc?
thx dude!
#12
Posté 18 mai 2012 - 07:40
hey el,
those /attack/ lines can be removed safely if there's no enemies around, yep. the local_int can/should be removed if you want the trigger to work multiple times ( you should also remove the GetLocal since the SetLocal is gone ..)
beware StrategyMode cams
those /attack/ lines can be removed safely if there's no enemies around, yep. the local_int can/should be removed if you want the trigger to work multiple times ( you should also remove the GetLocal since the SetLocal is gone ..)
beware StrategyMode cams
not sure what you mean ..el.sombrero wrote...
By the way, when the camera angle changes, it comes very near the pc... is there a way to force the camera angle but to keep the distance between it and the pc?
#13
Posté 18 mai 2012 - 08:42
kevL wrote...
not sure what you mean ..el.sombrero wrote...
By the way, when the camera angle changes, it comes very near the pc... is there a way to force the camera angle but to keep the distance between it and the pc?
May be because it is backing up to the wall? or a placeable?
#14
Posté 21 mai 2012 - 08:53
Uhm... I will try to explain msyelf... the thing is, when testing the module I usually set the camera as far as possible from the avatar, using the mouse wheel.
I noticed that when the script is triggered and the angle is forced, the camera comes very near the back of the avatar. If, in my original situation, the camera was like 10 feet away from the avatar after the forced angle it comes very near, like 2 ou 3 feet away from it.
Does it have anything to do with the viewmode I'm using? (by the way, how do I change the viewmode? can't remember it)
I noticed that when the script is triggered and the angle is forced, the camera comes very near the back of the avatar. If, in my original situation, the camera was like 10 feet away from the avatar after the forced angle it comes very near, like 2 ou 3 feet away from it.
Does it have anything to do with the viewmode I'm using? (by the way, how do I change the viewmode? can't remember it)
#15
Posté 21 mai 2012 - 09:08
hey El,
the " * " on NumericKeypad cycles through cameraModes,
It sounds like you want to adjust the value " 6.f " for function:
- make it bigger to move the camera farther away. As long as, like Morbane says, there isn't a wall or something in the way back there. btw, " 85.f " is the angle down from vertical ...
( 6.f means 6.0 units as a float )
the " * " on NumericKeypad cycles through cameraModes,
It sounds like you want to adjust the value " 6.f " for function:
SetCameraFacing(fDirection, 6.f, 85.f, CAMERA_TRANSITION_TYPE_FAST);
- make it bigger to move the camera farther away. As long as, like Morbane says, there isn't a wall or something in the way back there. btw, " 85.f " is the angle down from vertical ...
( 6.f means 6.0 units as a float )





Retour en haut






