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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Particle Effects help
Smackdown Offline
Junior Member

Posts: 13
Threads: 3
Joined: Jan 2013
Reputation: 0
#1
Particle Effects help

hey there! Smile


First things first: I've searched several times and I didn't find anything helpfull.

I want that dust falls down when the player passes a script area. (e.g. ScriptArea_4) So I've tried it with activate like with other objects. But it didn't work. I know I have to do something with "CreateParticleSystemAtEntity"

here are my tries:

Quote:void OnStart()
{
...
AddEntityCollideCallback("Player", "ScriptArea_4", "staub", true, 1);
...
}


void staub(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "28_done03.snt", "Player", 0, false);
SetEntityActive("ParticleSystem_17", true);
SetEntityActive("ParticleSystem_19", true);
CreateParticleSystemAtEntity("E1PS", "ps_debris_tunnel.ps", "ScriptArea_4", true);

}

Can anyone help me? Blush
01-03-2013, 07:24 PM
Find Reply
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#2
RE: Particle Effects help

What's not working? is the whole function not working, or do you not see the particle system?

The particle system will play in the center of a script area (ScriptArea_4), basically where you see the words "AREA" in the editor. Make sure the words are in the map itself so you can see it, and that the center of the area is not, say, under the floor.
01-03-2013, 07:38 PM
Find Reply
Smackdown Offline
Junior Member

Posts: 13
Threads: 3
Joined: Jan 2013
Reputation: 0
#3
RE: Particle Effects help

(01-03-2013, 07:38 PM)Statyk Wrote: What's not working? is the whole function not working, or do you not see the particle system?

The particle system will play in the center of a script area (ScriptArea_4), basically where you see the words "AREA" in the editor. Make sure the words are in the map itself so you can see it, and that the center of the area is not, say, under the floor.

When I have in the script "SetEntityActive("ParticleSystem_17", true);" and in the editor the particle effect is not active I can start the game and play the map, but Nothing happens there, no particle effect.
When I have something like that "CreateParticleSystemAtEntity("E1PS", "ps_debris_tunnel.ps", "ScriptArea_4", true);" and I want to start the custom story an error shows up.
01-03-2013, 07:46 PM
Find Reply
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: Particle Effects help

You cannot set particle systems active like SetEntityActive("ParticleSystem_17", true); as they are not entities.

Try this and tell me what the error that comes up says:
void OnStart()
{
...
AddEntityCollideCallback("Player", "ScriptArea_4", "staub", true, 1);
...
}


void staub(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "28_done03.snt", "Player", 0, false);
CreateParticleSystemAtEntity("E1PS", "ps_debris_tunnel.ps", "ScriptArea_4", true);
}

As well, it would help to post your whole hps here.
01-03-2013, 07:56 PM
Find Reply
Smackdown Offline
Junior Member

Posts: 13
Threads: 3
Joined: Jan 2013
Reputation: 0
#5
RE: Particle Effects help

No error. It just plays the sound when I'm on the Scriptarea4. But my target is, that it activates the particle effect too when I pass this area.

My hps so far (im a noob in scripting and such things Big Grin)

Quote:void OnStart()
{
AddUseItemCallback("", "key_torture_chamber_1", "castle_arched01_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "ScriptArea_1", "schweine", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "schweinehang", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "klang", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "staub", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "engel", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_6", "falle", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_7", "enemyklang", true, 1);
AddEntityCollideCallback("Player" , "ScriptArea_8" , "wegpunkte" , true , 1);
AddEntityCollideCallback("Player", "ScriptArea_9", "klang2", true, 1);
AddUseItemCallback("", "key_torture_chamber_2", "mansion_1", "UsedKeyOnDoor2", true);
}







void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, false);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false);
RemoveItem("key_torture_chamber_2");
AddDebugMessage("KeyOnDoor", false);
}









void klang2(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_human_noices.snt", "Player", 0, false);



}









void wegpunkte(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "Idle");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "Idle");
}












void enemyklang(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "amb_idle_scratch.snt", "Player", 0, false);



}








void falle(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "lurker_hit_wood.snt", "Player", 0, false);
SetEntityActive("armour_nice_complete_1", true);
SetEntityActive("armour_nice_complete_2", true);


}



void engel(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("angel_statue_1", 15, 15, "");
PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
SetEntityActive("angel_statue_1", true);
GiveSanityDamage(2.0f, true);
AddTimer("opala",0.2f,"EnemyTimer");

}











void staub(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "28_done03.snt", "Player", 0, false);
SetEntityActive("ParticleSystem_17", true);
SetEntityActive("ParticleSystem_19", true);

}









void klang(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_baby_cry.snt", "Player", 0, false);

}











void schweinehang(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetEntityActive("pig_corpse_hanging_1", true);
SetEntityActive("pig_corpse_hanging_2", true);
SetEntityActive("carcass_1", true);
SetEntityActive("carcass_2", true);
SetEntityActive("pig_corpse_hanging_3", true);
SetEntityActive("pig_corpse_hanging_4", true);
SetEntityActive("pig_corpse_hanging_5", true);
SetEntityActive("pig_corpse_hanging_6", true);
SetEntityActive("carcass_3", true);
SetEntityActive("ParticleSystem_34", true);

}




void schweine(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "scare_animal_squeal.snt", "Player", 0, false);
GiveSanityDamage(5.0f, true);
SetEntityActive("pig_corpse_26", true);
SetEntityActive("pig_corpse_27", true);
SetEntityActive("pig_corpse_28", true);
SetEntityActive("pig_corpse_29", true);
}










void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("castle_arched01_1", false, false);
PlaySoundAtEntity("", "unlock_door.snt", "castle_arched01_1", 0, false);
RemoveItem("key_torture_chamber_1");
AddDebugMessage("KeyOnDoor", false);
}




////Timers
void EnemyTimer(string &in asTimer)

{

if(asTimer == "opala")
{
StopPlayerLookAt();
AddTimer("Scare2",30.5f,"EnemyTimer");
}
}
01-03-2013, 08:10 PM
Find Reply
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#6
RE: Particle Effects help

Your particle is being created at the center of ScriptArea_4 (the script area you walk in). Either make sure the center of the area is within sight, or create another script area somewhere and have it play on that one instead.
01-03-2013, 08:22 PM
Find Reply
Smackdown Offline
Junior Member

Posts: 13
Threads: 3
Joined: Jan 2013
Reputation: 0
#7
RE: Particle Effects help

And how does that look like, when I make a new script area only for the particle effect? Could you please make one for me as a example? :-)
01-03-2013, 08:26 PM
Find Reply
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#8
RE: Particle Effects help

[] - Here is "particlearea"

[] - Here is "ScriptArea_4"

void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_4", "staub", true, 1);
}

void staub(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "28_done03.snt", "Player", 0, false);
CreateParticleSystemAtEntity("E1PS", "ps_debris_tunnel.ps", "particlearea", true);
}

Walk into ScriptArea_4 and watch where particlearea is. Wait and see if the particle shows.
01-03-2013, 08:43 PM
Find Reply
Smackdown Offline
Junior Member

Posts: 13
Threads: 3
Joined: Jan 2013
Reputation: 0
#9
RE: Particle Effects help

Thank you, it worked. Thank you very much. Wink


Another question (short one Big Grin)



What do I have to write when I want signs? Is it like that:


Quote:<CATEGORY Name="Signs">
<Entry Name="test1">XXXXXXXXX</Entry>
<Entry Name="test2">YYYYYYYYY</Entry>
<Entry Name="test3">AAAAAAAAA</Entry>
<Entry Name="test4">DDDDDDDDD</Entry>
</CATEGORY>


Or what? because this above doesnt work in my story ^^
01-03-2013, 08:57 PM
Find Reply
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#10
RE: Particle Effects help

Are you using Sign Areas in front of the signs?
01-03-2013, 09:36 PM
Find Reply




Users browsing this thread: 1 Guest(s)