Frictional Games Forum (read-only)
[SCRIPT] Help please! Particles and removing objects - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Help please! Particles and removing objects (/thread-11326.html)



Help please! Particles and removing objects - TheDavenia - 11-13-2011

How do i make it that if an enemy walks into an area a wall deletes and particle system's get active.
I've tried this code:

What i put in the Void OnStart:

AddEntityCollideCallback("servant_brute_1", "FalconPunch", "FalconPunch", true, 1);


And what i put under it:


void FalconPunch(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("HitWall", "attack_claw_hit.snt", "SlashSound", 1, true);
SetEntityActive("ParticleSystem_40", true);
AddTimer("", 0.3f, "BreakWall");
}

void BreakWall(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("WallBreak", "03_break_wall.snt", "LookAtWall", 1, true);
SetEntityActive("ParticleSystem_39", true);
SetEntityActive("ParticleSystem_48", true);
SetEntityActive("ParticleSystem_42", true);
SetEntityActive("ParticleSystem_37", true);
SetEntityActive("ParticleSystem_47", true);
SetEntityActive("ParticleSystem_43", true);
SetEntityActive("ParticleSystem_49", true);
SetEntityActive("ParticleSystem_50", true);
SetEntityActive("ParticleSystem_51", true);
SetEntityActive("ParticleSystem_60", true);
SetEntityActive("ParticleSystem_56", true);
SetEntityActive("ParticleSystem_41", true);
SetEntityActive("ParticleSystem_61", true);
SetEntityActive("wall_default_35", false);
}

But the wall doesn't delete and the particle systems get enabled on the start of the map :3
Help please!


RE: Help please! Particles and removing objects - Your Computer - 11-13-2011

Particles systems cannot be accessed with the SetEntityActive function. Static objects cannot be deactivated or made invisible. You need to create the particle systems when the callback is called, and you need to convert the static object (wall) into a non-static entity.

P.S. Next time please briefly specify your issue in the topic title. Don't use anything vague like "Please help!" only.


RE: Help please! Particles and removing objects - TheDavenia - 11-13-2011

(11-13-2011, 04:22 PM)Your Computer Wrote: Particles systems cannot be accessed with the SetEntityActive function. Static objects cannot be deactivated or made invisible. You need to create the particle systems when the callback is called, and you need to convert the static object (wall) into a non-static entity.

P.S. Next time please briefly specify your issue in the topic title. Don't use anything vague like "Please help!" only.
Ermm...
And how do i exactly do all that...?
And also:
When the brute walks into the area the sounds don't play as well...


RE: Help please! Particles and removing objects - Your Computer - 11-13-2011

(11-13-2011, 04:36 PM)TheDavenia Wrote: Ermm...
And how do i exactly do all that...?
And also:
When the brute walks into the area the sounds don't play as well...

Open the model editor and import the wall that you want to make disappear. In the User defined variables, choose Object for Type and leave the SubType as Static.

Use the CreateParticleSystemAtEntity function on the wall entity that you customized.

As for the sound issues, there could be many reasons why they don't work: 1. Brute doesn't collide with area. 2. Area may be of a type where collisions don't work. 3. Sound file does not exist. 4. Area could be named differently than what is defined in the script. 5. Sounds could be playing on a volume level too low to hear at a distance. 6. Could be the wrong brute. 7. Entity where the sound is played doesn't exist. Et cetera.


RE: Help please! Particles and removing objects - TheDavenia - 11-13-2011

Well the brute should collide with the area...
I've added path nodes for the brute + put them in the script:

In the Void OnStart:
MonsterPath();


Below it:

void MonsterPath()
{
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 3.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0.0f, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0.0f, "");
}

Could you explain what you mean with "Use the CreateParticleSystemAtEntity function on the wall entity that you customized. "...?