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


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Game Problems
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#21
RE: Game Problems

(12-08-2012, 05:21 PM)Fishnugget Wrote: Where exactly have i to write onenter();?
Wherever you want, like void OnStart() or void OnLeave. By this I don't mean putting it in there, I mean putting it freely. Like this:

void OnStart()
{

}

void OnEnter()
{

}

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-08-2012, 05:57 PM
Find Reply
Fishnugget Offline
Member

Posts: 72
Threads: 6
Joined: Aug 2012
Reputation: 1
#22
RE: Game Problems

Is this right?


void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "Clown1" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_2" , "Clown2" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_3" , "Clown3" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideDoorExplode" , true , 1);
}

void Clown1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_1", true);
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_5", 0, "Idle");
}

void Clown2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_3", true);
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_9", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_10", 0, "Idle");
}

void Clown3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_2", true);
AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_12", 0, "Idle");
}

void OnEnter()
void CollideDoorExplode(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("castle_1", false);
SetEntityActive("castle_broken_1", true);
CreateParticleSystemAtEntity("", "ps_break_wood.ps", "DoorExplodeParticle", false);
PlaySoundAtEntity("", "break_wood.snt", "DoorExplodeParticle", 0, false);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
12-08-2012, 06:08 PM
Find Reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#23
RE: Game Problems

No.

Void OnEnter is just like void OnStart.

This is what you wrote:

void OnStart()
{

}

void OnEnter()


Do you see. There is a problem.
It should look like this:

void OnEnter()
{

}

Trying is the first step to success.
12-08-2012, 06:19 PM
Find Reply
Fishnugget Offline
Member

Posts: 72
Threads: 6
Joined: Aug 2012
Reputation: 1
#24
RE: Game Problems

like this?


void OnEnter()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "Clown1" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_2" , "Clown2" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_3" , "Clown3" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideDoorExplode" , true , 1);
}

void Clown1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_1", true);
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_5", 0, "Idle");
}

void Clown2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_3", true);
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_9", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_10", 0, "Idle");
}

void Clown3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_2", true);
AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_12", 0, "Idle");
}

void CollideDoorExplode(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("castle_1", false);
SetEntityActive("castle_broken_1", true);
CreateParticleSystemAtEntity("", "ps_break_wood.ps", "DoorExplodeParticle", false);
PlaySoundAtEntity("", "break_wood.snt", "DoorExplodeParticle", 0, false);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
12-08-2012, 06:32 PM
Find Reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#25
RE: Game Problems

No. I'm change your script now:

void OnStart()
{
AddEntityCollideCallback("Player" , "ScriptArea_1" , "Clown1" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_2" , "Clown2" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_3" , "Clown3" , true , 1);
AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideDoorExplode" , true , 1);
}

void Clown1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_1", true);
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_5", 0, "Idle");
}

void Clown2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_3", true);
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_9", 0, "Idle");
AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_10", 0, "Idle");
}

void Clown3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Clooni1_2", true);
AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_12", 0, "Idle");
}

void CollideDoorExplode(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("castle_1", false);
SetEntityActive("castle_broken_1", true);
CreateParticleSystemAtEntity("", "ps_break_wood.ps", "DoorExplodeParticle", false);
PlaySoundAtEntity("", "break_wood.snt", "DoorExplodeParticle", 0, false);
}


void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

Trying is the first step to success.
12-08-2012, 06:35 PM
Find Reply
Fishnugget Offline
Member

Posts: 72
Threads: 6
Joined: Aug 2012
Reputation: 1
#26
RE: Game Problems

Oh, now I get it, thanks^^
but the door doesnt explode
(This post was last modified: 12-08-2012, 07:10 PM by Fishnugget.)
12-08-2012, 06:45 PM
Find Reply
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#27
RE: Game Problems

You have two AddEntityCollideCallback's with ScriptArea_1. Wouldn't it be more logical to put the door thing in the "Clown 1"?

Script:

void OnStart()

{

AddEntityCollideCallback("Player" , "ScriptArea_1" , "Clown1" , true , 1);

AddEntityCollideCallback("Player" , "ScriptArea_2" , "Clown2" , true , 1);

AddEntityCollideCallback("Player" , "ScriptArea_3" , "Clown3" , true , 1);

}



void Clown1(string &in asParent, string &in asChild, int alState)

{

SetEntityActive("Clooni1_1", true);

AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_1", 0, "Idle");

AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_2", 0, "Idle");

AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_3", 0, "Idle");

AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_4", 0, "Idle");

AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_5", 0, "Idle");
SetEntityActive("castle_1", false);

SetEntityActive("castle_broken_1", true);

CreateParticleSystemAtEntity("", "ps_break_wood.ps", "DoorExplodeParticle", false);

PlaySoundAtEntity("", "break_wood.snt", "DoorExplodeParticle", 0, false);

}



void Clown2(string &in asParent, string &in asChild, int alState)

{

SetEntityActive("Clooni1_3", true);

AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_6", 0, "Idle");

AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_7", 0, "Idle");

AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_8", 0, "Idle");

AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_9", 0, "Idle");

AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_10", 0, "Idle");

}



void Clown3(string &in asParent, string &in asChild, int alState)

{

SetEntityActive("Clooni1_2", true);

AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_11", 0, "Idle");

AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_12", 0, "Idle");

}







void OnEnter()

{



}



////////////////////////////

// Run when leaving map

void OnLeave()

{



}

Also, those "AddEnemyPatrolNode" have "Idle" as animation. Why is that?

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 12-08-2012, 07:18 PM by The chaser.)
12-08-2012, 07:17 PM
Find Reply
Fishnugget Offline
Member

Posts: 72
Threads: 6
Joined: Aug 2012
Reputation: 1
#28
RE: Game Problems

dammit, I really dont get it xDDD
i have an better idea. I delete the door and make just a floor who the evil clown walks
12-08-2012, 07:39 PM
Find Reply
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#29
RE: Game Problems

Fishnugget, read carefully:

Scripts can be hard, very hard. I toke me a good time to memorize a lot of scripts and I still need the wiki for a lot of things. But, if you skip and change the idea to a more basic one, you will never learn. Everything will be the same.

So, when making scripts, you have to think. A LOT. You must care about bugs and how realistic does it look in-game.

So, we are here. Ask freely. Whatever you need, hell, this is Development Support, we help people. If you need so, we will crush our head to think to solve your problem.

Now, what's the thing you don't get? Let's see:

This is the list of ALL available scripts for Amnesia (doesn't include Justine, I think). You can look at the scripts to see what they do.

And this is a large list of tutorials to improve your techniques. I've learned with them, do so too.

Basic scripting tutorial:
http://wiki.frictionalgames.com/hpl2/tut...t_beginner

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
(This post was last modified: 12-08-2012, 08:25 PM by The chaser.)
12-08-2012, 08:16 PM
Find Reply
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#30
RE: Game Problems

Yes. You need to understand what a basic script is.
So you understand why you get the errors.
And understand that whenever you open something. ( [ {
You have to close it again ) ] }

Trying is the first step to success.
12-08-2012, 10:13 PM
Find Reply




Users browsing this thread: 1 Guest(s)