First of all , i'm really sorry for flooding with help topics . This is my last one!
I need help to force look the player somewhere on the map when touching a script area , there is already one which makes you look somewhere but it is triggered instantly when you enter a map , so i tried to make it trigger when touching the script area but i failed pathetically.
So please help?
//Creating the function to call
First: Making the game call a function when the player enters a area.
// First function
First: When the player enters the area, i set the player inactive, so the that you can't move him around.
Second: After the players is set inactive, i make him look at a torch.
Third: I create a timer, that activates the player, so that him can move around again
ScriptArea is the name of the area script you place in your map and where the player looks.
viewacceleration controls how fast the player looks.
maxviewvelocity controls the max speed the player looks.
onlook is a function you call when the player's view is centered on the target.
To stop the player from looking at a spot, call StopPlayerLookAt();
Example:
//When player starts the level, make him look at this spot.
void OnStart()
{
// Function argument is empty since we don't want to call a function.
StartPlayerLookAt("AreaLookAt", 2, 2, "");
//Make the player look for 2.5 seconds
AddTimer("donelook", 2.5f, "TimerDoneLookAt");
}
(This post was last modified: 10-12-2012, 02:35 PM by naseem142.)
The script is easy , but the timer stuff is just complicated for me. ( as a newbie it gave me a headache )
so i wont do it anymore , it wasn't necessary for my custom story though it was just a bonus.
But since your here , can you help me with this door-slam script?
I have no idea whats wrong with it , it looks perfect!
( I cut it out of my script so i wont need to post everything else )
Do you get an error?
I would recommend using AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
or
AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
And you haven't used timers before? I suggest you to check them out! Timers are pretty good to have in your custom stories...
Trying is the first step to success.
(This post was last modified: 10-12-2012, 03:02 PM by FlawlessHappiness.)
(10-12-2012, 03:02 PM)beecake Wrote: Do you get an error?
I would recommend using AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
or
AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);
And you haven't used timers before? I suggest you to check them out! Timers are pretty good to have in your custom stories...
Nope i don't get any errors , the door just doesn't respond to the script area >:|