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 Particels won't work!
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#1
Particels won't work!

Okay so here's my script :


void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "Door", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "Script", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_2", "Door2", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_3", "Door1", true, 1);
AddEntityCollideCallback("Player", "FlyingJesus_1", "Scare", true, 1);
AddEntityCollideCallback("Jesus_1", "FlyingJesus_1", "Sound", true, 1);
AddEntityCollideCallback("Player", "PortalArea_1", "Portal", true, 1);
}

void Door(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Door_1", true);
SetEntityActive("ScriptArea_2", true);
SetEntityActive("ScriptArea_3", true);
}

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

void Scare(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("Jesus_1", true);
AddPropForce("Jesus_1", 0, 0, 0, "World");
PlaySoundAtEntity("", "24_iron_maiden.snt", "FlyingJesus_1", 0, true);
}

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

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

void Portal(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("Portal_1", "Portal_1.ps", "PortalAltar_1", false);
}


////////////////////////////
// Run when entering map
void OnEnter()
{

}

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


But for some reason the Particle that (the demon alike one). Dosen't activate when i hit the area it activates just as i enter the map , andi don't want that. Maybe this script is incorrect , if so please help me :/.
Trollox.
(This post was last modified: 02-05-2012, 07:37 PM by trollox.)
02-05-2012, 07:36 PM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: Particels won't work!

You have to create the particle effects into entites (script areas work too). If you place particle effect in level editor that doesnt loop, it will run at start and then disappear.

02-05-2012, 08:04 PM
Find
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#3
RE: Particels won't work!

What that made no sense could you be a little more detailed khyrpa? I'm very new to scripting etc , would be awesome if you could make it easier to understand.
02-05-2012, 09:18 PM
Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#4
RE: Particels won't work!

The only thing I can think of is if you accidentally have the "PortalArea_1" close to your "PlayerStart" area. Because I think the script looks fine.

I assume you don't have a particle on your level editor since you are creating one in your script?
02-05-2012, 09:25 PM
Find
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#5
RE: Particels won't work!

Well.. I do have a particle in the level editor. And the particel is located at the end of the map. So pretty much as far from the start area as possible.. So that won't work :/
02-05-2012, 09:28 PM
Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#6
RE: Particels won't work!

That's your problem, you're not suppose to add the particle on the Level Editor.

Because this script line:

CreateParticleSystemAtEntity("Portal_1", "Portal_1.ps", "PortalAltar_1", false);

Creates a particle on its own. Just delete the particle in level editor and it should work.
02-05-2012, 09:44 PM
Find
trollox Offline
Member

Posts: 215
Threads: 16
Joined: Dec 2011
Reputation: 3
#7
RE: Particels won't work!

That makes no sense how can it creat a particle on it's own with out having it in the game when i named it Portal_1? And like i though it didn't. Maybe i need to change the Portal_1 to the original particle name? Or any other suggestions?
02-05-2012, 10:27 PM
Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#8
RE: Particels won't work!

It makes perfect sense Tongue

The script says "CREATEparticlesystematentity" not "ACTIVATEparticleonsystematentity" so it creates a particle. If you simply add a particle on level editor it starts right away, like your problem.

on "Portal_1.ps" it should be the EXACT name of the particle in the folders "particle".
For example, if I want bubble particles, I write:

CreateParticleSystemAtEntity("Portal_1", "ps_acid_container_bubbles.ps", "PortalAltar_1", false);

If the name of the particle isn't exactly what you write, it wont work. So just find the particle, copy/paste the name and use it in your script.
(This post was last modified: 02-05-2012, 10:36 PM by Ninami.)
02-05-2012, 10:34 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#9
RE: Particels won't work!

FYI: Placing particle systems in the level editor is not counter-productive. Particle systems die because they were not meant to respawn, not because they existed outside of scripts. Look at the rain and fog particle systems, for example.

Tutorials: From Noob to Pro
(This post was last modified: 02-05-2012, 10:59 PM by Your Computer.)
02-05-2012, 10:59 PM
Website Find
Ninami Offline
Member

Posts: 59
Threads: 6
Joined: Feb 2012
Reputation: 2
#10
RE: Particels won't work!

Yeah as I said, "If you simply add a particle on level editor it starts right away" like rain and fog.


If you want particles to spawn at certain times, you create particles with script (at least that's what I learned).


So there were 2 "problems" here, first he shouldn't have added a particle in level editor, and he named the .ps file wrong.


Am I right, "Your Computer"?
02-05-2012, 11:06 PM
Find




Users browsing this thread: 1 Guest(s)