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 Help please! Particles and removing objects
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#1
Help please! Particles and removing objects

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!

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
(This post was last modified: 11-13-2011, 04:19 PM by Your Computer.)
11-13-2011, 03:25 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Help please! Particles and removing objects

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.

Tutorials: From Noob to Pro
(This post was last modified: 11-13-2011, 04:29 PM by Your Computer.)
11-13-2011, 04:22 PM
Website Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#3
RE: Help please! Particles and removing objects

(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...

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
(This post was last modified: 11-13-2011, 04:41 PM by TheDavenia.)
11-13-2011, 04:36 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Help please! Particles and removing objects

(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.

Tutorials: From Noob to Pro
11-13-2011, 04:49 PM
Website Find
TheDavenia Offline
Member

Posts: 223
Threads: 38
Joined: Jun 2011
Reputation: 0
#5
RE: Help please! Particles and removing objects

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. "...?

Current Project: Nightmare's End(Project Director, Scripter, boss >:D)
(This post was last modified: 11-13-2011, 05:30 PM by TheDavenia.)
11-13-2011, 04:56 PM
Find




Users browsing this thread: 1 Guest(s)