Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add all simple scripts here!
Author Message
HumiliatioN Offline
Posting Freak

Posts: 1,176
Joined: Dec 2010
Reputation: 18
Post: #11
RE: Add all simple scripts here!

Okay problem: I dont have any errors in this script but why this doesnt work?

Full Script:

void OnStart()
{
AddEntityCollideCallback("Player" , "Origin" , "scareactive" , true , 1);
}

void scareactivate(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("monster_1" , true);
}

////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true);
}

////////////////////////////
// Run when leaving map

void OnLeave()
{
}

////////////////////////////
// Actual functions

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}

I have not activated Monster entity and all names alright but why monster doesnt appears in the marked area?

“Life is a game, play it”
12-13-2010 05:27 PM
Find all posts by this user Quote this message in a reply
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #12
RE: Add all simple scripts here!

AddEntityCollideCallback("Player" , "Origin" , "scareactive" , true , 1);
void scareactivate(string &in asParent , string &in asChild , int alState)

Take a very good look at the function name Wink
12-13-2010 05:34 PM
Find all posts by this user Quote this message in a reply
HumiliatioN Offline
Posting Freak

Posts: 1,176
Joined: Dec 2010
Reputation: 18
Post: #13
RE: Add all simple scripts here!

(12-13-2010 05:34 PM)Akumasama Wrote:  AddEntityCollideCallback("Player" , "Origin" , "scareactive" , true , 1);
void scareactivate(string &in asParent , string &in asChild , int alState)

Take a very good look at the function name Wink

Where i dont see Confused

“Life is a game, play it”
12-13-2010 05:45 PM
Find all posts by this user Quote this message in a reply
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #14
RE: Add all simple scripts here!

scareactive
scareactivate

See it now? Tongue
12-13-2010 06:51 PM
Find all posts by this user Quote this message in a reply
HumiliatioN Offline
Posting Freak

Posts: 1,176
Joined: Dec 2010
Reputation: 18
Post: #15
RE: Add all simple scripts here!

(12-13-2010 06:51 PM)Akumasama Wrote:  scareactive
scareactivate

See it now? Tongue

Oh xD

Okay but it doesnt work anyways :I

“Life is a game, play it”
12-13-2010 10:55 PM
Find all posts by this user Quote this message in a reply
HumiliatioN Offline
Posting Freak

Posts: 1,176
Joined: Dec 2010
Reputation: 18
Post: #16
RE: Add all simple scripts here!

(12-13-2010 10:55 PM)HumiliatioN Wrote:  
(12-13-2010 06:51 PM)Akumasama Wrote:  scareactive
scareactivate

See it now? Tongue

Oh xD

Okay but it doesnt work anyways :I

Help me with this! Huh

“Life is a game, play it”
12-14-2010 01:09 AM
Find all posts by this user Quote this message in a reply
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #17
RE: Add all simple scripts here!

void OnStart()
{
AddEntityCollideCallback("Player" , "Origin" , "scareactive" , true , 1);
}

////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true);
}

////////////////////////////
// Run when leaving map

void OnLeave()
{
}

////////////////////////////
// Actual functions

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}


void scareactive(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("monster_1" , true);
AddEnemyPatrolNode("enemyname", "nodename", waiting time (for example: 0.0f), "animation to play");
}

You have to add path nodes when spawning a monster, or it will despawn right away.
This is because after a monster has walked it's last path, it will disappear, hence, having no path, it will disappear right away.

Again, make sure everything is organized.
Put your functions that don't belong in any of the "On...." functions, at the end of your script.
12-14-2010 11:18 AM
Find all posts by this user Quote this message in a reply
HumiliatioN Offline
Posting Freak

Posts: 1,176
Joined: Dec 2010
Reputation: 18
Post: #18
RE: Add all simple scripts here!

(12-14-2010 11:18 AM)Akumasama Wrote:  
void OnStart()
{
AddEntityCollideCallback("Player" , "Origin" , "scareactive" , true , 1);
}

////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true);
}

////////////////////////////
// Run when leaving map

void OnLeave()
{
}

////////////////////////////
// Actual functions

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}


void scareactive(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("monster_1" , true);
AddEnemyPatrolNode("enemyname", "nodename", waiting time (for example: 0.0f), "animation to play");
}

You have to add path nodes when spawning a monster, or it will despawn right away.
This is because after a monster has walked it's last path, it will disappear, hence, having no path, it will disappear right away.

Again, make sure everything is organized.
Put your functions that don't belong in any of the "On...." functions, at the end of your script.

Thanks! Now i got it hallucinating zombie its working! Smile

“Life is a game, play it”
12-14-2010 04:00 PM
Find all posts by this user Quote this message in a reply
HumiliatioN Offline
Posting Freak

Posts: 1,176
Joined: Dec 2010
Reputation: 18
Post: #19
RE: Add all simple scripts here!

(12-14-2010 04:00 PM)HumiliatioN Wrote:  
(12-14-2010 11:18 AM)Akumasama Wrote:  
void OnStart()
{
AddEntityCollideCallback("Player" , "Origin" , "scareactive" , true , 1);
}

////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("", "key_1", "door_1", "KeyOnDoor", true);
AddUseItemCallback("", "key_2", "door_2", "KeyOnDoor2", true);
}

////////////////////////////
// Run when leaving map

void OnLeave()
{
}

////////////////////////////
// Actual functions

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, false);
RemoveItem("key_1");
AddDebugMessage("KeyOnDoor", false);
}

void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_2", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}


void scareactive(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("monster_1" , true);
AddEnemyPatrolNode("enemyname", "nodename", waiting time (for example: 0.0f), "animation to play");
}

You have to add path nodes when spawning a monster, or it will despawn right away.
This is because after a monster has walked it's last path, it will disappear, hence, having no path, it will disappear right away.

Again, make sure everything is organized.
Put your functions that don't belong in any of the "On...." functions, at the end of your script.

Thanks! Now i got it hallucinating zombie its working! Smile

Okay i have more questions: How i can make readable note? (I mean i can read my note what i write in there)

“Life is a game, play it”
12-14-2010 05:07 PM
Find all posts by this user Quote this message in a reply
Akumasama Offline
Member

Posts: 122
Joined: Nov 2010
Reputation: 0
Post: #20
RE: Add all simple scripts here!

http://wiki.frictionalgames.com/hpl2/tut...omakenotes
There you go.
Ask for more help if you can't figure it out Smile
12-14-2010 05:30 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)