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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make encounters?
sacroid Offline
Member

Posts: 88
Threads: 11
Joined: Apr 2010
Reputation: 0
#11
RE: How to make encounters?

Hmmm... PathNode doesn't seem to work, the despawn area works perfectly, I throw a box into the despawn area to "distract" him and make him go there and when he steps the area he dissapears, so that's perfect, but the waypoint isn't working! :S
Here is the script, I'm so sure something is wrong:
void OnStart()
{
    
        AddEntityCollideCallback("Player", "ScriptArea_1", "CollideScriptArea_1", true, 0);
    AddEntityCollideCallback("servant_brute_1", "ScriptArea_2", "CollideScriptArea_2", true, 0);
    AddEnemyPatrolNode("servant_brute_1", "PosNodeArea_1", 0, "");
    
}

void OnEnter()
{
}


void CollideScriptArea_1(string &in asParent, string &in asChild, int alState)
{
    
    SetEntityActive("servant_brute_1", true);

}

void CollideScriptArea_2(string &in asParent, string &in asChild, int alState)
{
    
    SetEntityActive("servant_brute_1", false);
    
}

(This post was last modified: 09-15-2010, 04:27 PM by sacroid.)
09-15-2010, 04:24 PM
Find
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#12
RE: How to make encounters?

It's a simple fix Smile It is not PosNode you are supposed to use (those are for ropes if memory serves me right), it is PathNode that you are supposed to use.

Check a map from Amnesia to see how you should spread them out (what a good distances between each node is) and also to see how they should be aligned to the floor.
09-15-2010, 05:01 PM
Website Find
sacroid Offline
Member

Posts: 88
Threads: 11
Joined: Apr 2010
Reputation: 0
#13
RE: How to make encounters?

(09-15-2010, 05:01 PM)jens Wrote: It's a simple fix Smile It is not PosNode you are supposed to use (those are for ropes if memory serves me right), it is PathNode that you are supposed to use.

Check a map from Amnesia to see how you should spread them out (what a good distances between each node is) and also to see how they should be aligned to the floor.

Oh! How can I be so dumb? haha, thanks Jens! I'll check the original Amnsesia Maps Wink
By the way, I'm going to publish this test map later and see your opinions about my first day with the editor Big Grin

09-15-2010, 05:11 PM
Find
Ethril Offline
Junior Member

Posts: 7
Threads: 1
Joined: Jan 2011
Reputation: 0
#14
RE: How to make encounters?

I tried doing the same as Sacroid with trying to make a zombie spawn if an area of type script is touched but no matter how I do so he just won't spawn? I have his active boxed ticked off. I have unticked all the boxes in the area section of the Script Area.

here is my script :< Btw corpseroom = the script area, cannibal = name of the monster




void onStart()
{
AddUseItemCallback("", "strangekey_1", "cellar_wood01_2", "UsedKeyOnDoor", true);

AddEntityCollideCallback("Player", "corpseroom", "Collidecorpseroom", true, 1);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01_2", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_2", 0, false);
RemoveItem("strangekey_1");
}



void onEnter()
{

}

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

void OnLeave()
{

}


could someone please tell me where I have gone wrong Sad I've been at it for hours! thx
01-12-2011, 07:53 AM
Find
Tony32 Offline
Junior Member

Posts: 26
Threads: 2
Joined: Jan 2011
Reputation: 0
#15
RE: How to make encounters?

(09-15-2010, 02:31 PM)jens Wrote: the enemy will disable by himself when he has walked his path and you are not in a position where you can see him.

Is that true? If so, nice ^^ Thanks Smile
01-12-2011, 02:46 PM
Find
Neatherblade Offline
Junior Member

Posts: 19
Threads: 5
Joined: Jan 2011
Reputation: 0
#16
RE: How to make encounters?

Try this Ethril.

void onStart()
{
AddUseItemCallback("", "strangekey_1", "cellar_wood01_2", "UsedKeyOnDoor", true);

AddEntityCollideCallback("Player", "corpseroom", "Collidecorpseroom", true, 1);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("cellar_wood01_2", false, true);
PlaySoundAtEntity("", "unlock_door", "cellar_wood01_2", 0, false);
RemoveItem("strangekey_1");
}

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


void onEnter()
{

}

void OnLeave()
{

}

if you have it onEnter() the engine will run the script as soon you enter the map.
01-12-2011, 08:54 PM
Find




Users browsing this thread: 2 Guest(s)