MrJackrabbit
Junior Member
Posts: 26
Threads: 10
Joined: Nov 2013
Reputation:
0
|
help script
so heyllo,
so im messing around with script function stuff and im trying to find a way to add something to this script.
this is what i have so far:
void OnStart()
{
SetEntityCallbackFunc("key_1", "OnPickup");
}
void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("servant_brute_1", true);
ShowEnemyPlayerPosition("servant_brute_1");
}
this spawns an enemy hallucination once you pick up the key and everything works so far. i took out all the other parts of the scrip because this is the only important thing but ive tried it and it works fine.
i was wondering if anyone could tell me how to have the player look at the brute when he picks up the key.
thank yall!
|
|
12-24-2013, 10:02 PM |
|
DnALANGE
Banned
Posts: 1,549
Threads: 73
Joined: Jan 2012
|
RE: help script
void OnStart() { SetEntityPlayerInteractCallback("key_1", "OnPickup", false); }
void OnPickup(string &in asEntity, string &in type) { SetEntityActive("servant_brute_1", true);//Setting the enemy ACTIVE. ShowEnemyPlayerPosition("servant_brute_1");// this will make the enemy attack you where ever you are. StartPlayerLookAt("servant_brute_1", 10.0f, 10.5f, "");//The 10 is the speed to look at something, 1 is very slow, so this is very fast. }
(This post was last modified: 12-24-2013, 10:07 PM by DnALANGE.)
|
|
12-24-2013, 10:07 PM |
|
MrJackrabbit
Junior Member
Posts: 26
Threads: 10
Joined: Nov 2013
Reputation:
0
|
RE: help script
(12-24-2013, 10:07 PM)DnALANGE Wrote: void OnStart() { SetEntityPlayerInteractCallback("key_1", "OnPickup", false); }
void OnPickup(string &in asEntity, string &in type) { SetEntityActive("servant_brute_1", true);//Setting the enemy ACTIVE. ShowEnemyPlayerPosition("servant_brute_1");// this will make the enemy attack you where ever you are. StartPlayerLookAt("servant_brute_1", 10.0f, 10.5f, "");//The 10 is the speed to look at something, 1 is very slow, so this is very fast. }
thank you so much! this helps alot!
(12-24-2013, 10:11 PM)MrJackrabbit Wrote: (12-24-2013, 10:07 PM)DnALANGE Wrote: void OnStart() { SetEntityPlayerInteractCallback("key_1", "OnPickup", false); }
void OnPickup(string &in asEntity, string &in type) { SetEntityActive("servant_brute_1", true);//Setting the enemy ACTIVE. ShowEnemyPlayerPosition("servant_brute_1");// this will make the enemy attack you where ever you are. StartPlayerLookAt("servant_brute_1", 10.0f, 10.5f, "");//The 10 is the speed to look at something, 1 is very slow, so this is very fast. }
thank you so much! this helps alot!
how do i stop looking at it? it worked but after it dissapears the player continues to look where it used to be. where do i put in "StopPLayerLookAt()"? i put that in the void OnPickup but that event and the startPlayerLookAt event occurs at the same time so they cancel each other out.
(This post was last modified: 12-24-2013, 10:22 PM by MrJackrabbit.)
|
|
12-24-2013, 10:11 PM |
|
DnALANGE
Banned
Posts: 1,549
Threads: 73
Joined: Jan 2012
|
RE: help script
void OnStart()
{
SetEntityPlayerInteractCallback("key_1", "OnPickup", false);
}
void OnPickup(string &in asEntity, string &in type)
{
AddTimer("", 5.0f, "STOPLOOK"); // Put this timer as long as you want
SetEntityActive("servant_brute_1", true);//Setting the enemy ACTIVE.
ShowEnemyPlayerPosition("servant_brute_1");// this will make the enemy attack you where ever you are.
StartPlayerLookAt("servant_brute_1", 10.0f, 10.5f, "");//The 10 is the speed to look at something, 1 is very slow, so this is very fast.
}
void STOPLOOK(string &in asTimer)
{
StopPlayerLookAt();
}
Edit;
Try to understand the engine\scripts.
VERY importend, or at lesast try to ask waht does what and how.
you just ask the script and then what? do you know what what does?
Just wondering..
Here is somehting you may want to add to your favorites;
http://wiki.frictionalgames.com/hpl2/amn..._functions
(This post was last modified: 12-24-2013, 10:29 PM by DnALANGE.)
|
|
12-24-2013, 10:24 PM |
|
MrJackrabbit
Junior Member
Posts: 26
Threads: 10
Joined: Nov 2013
Reputation:
0
|
RE: help script
(12-24-2013, 10:24 PM)DnALANGE Wrote: void OnStart()
{
SetEntityPlayerInteractCallback("key_1", "OnPickup", false);
}
void OnPickup(string &in asEntity, string &in type)
{
AddTimer("", 5.0f, "STOPLOOK"); // Put this timer as long as you want
SetEntityActive("servant_brute_1", true);//Setting the enemy ACTIVE.
ShowEnemyPlayerPosition("servant_brute_1");// this will make the enemy attack you where ever you are.
StartPlayerLookAt("servant_brute_1", 10.0f, 10.5f, "");//The 10 is the speed to look at something, 1 is very slow, so this is very fast.
}
void STOPLOOK(string &in asTimer)
{
StopPlayerLookAt();
}
Edit;
Try to understand the engine\scripts.
VERY importend, or at lesast try to ask waht does what and how.
you just ask the script and then what? do you know what what does?
Just wondering..
Here is somehting you may want to add to your favorites;
http://wiki.frictionalgames.com/hpl2/amn..._functions alrighty. thank you very much! im practicing with scripting and i just started this week so im begining to understand it
|
|
12-24-2013, 10:36 PM |
|
DnALANGE
Banned
Posts: 1,549
Threads: 73
Joined: Jan 2012
|
RE: help script
That's totally fine MrRabbit*
Just be aware scripting is\can be hard, we all make mistakes.
But then try to understad what is wrogn is very importend.
While trying you learn yourself, and youre Always free to ask on the forum here.
Signing off now.
Good luck with your story.
(This post was last modified: 12-24-2013, 10:53 PM by DnALANGE.)
|
|
12-24-2013, 10:53 PM |
|
|