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!
Your Computer Offline
SCAN ME!

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

(02-05-2012, 11:06 PM)Ninami Wrote: 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"?

Yeah, if you want to have a particle system exist when colliding with an area, it needs to be done through scripts. I don't have any Portal_1.ps on my side, so unless he created it himself, then he's providing the wrong file path.

Tutorials: From Noob to Pro
02-05-2012, 11:12 PM
Website Find
Ninami Offline
Member

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

Awesome, it's fun to learn and then help others haha.

Btw thanks for the video on youtube, helped me understand more Smile
When I saw your name on the video I was like, Heey isn't that the guy from the forums Big Grin
02-05-2012, 11:26 PM
Find
trollox Offline
Member

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

Then why won't this work it's exacly the name of the ps here's that script part :



void Portal(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("Portal_1", "guardian_appear_explosion.ps", "PortalAltar_1", false);
}
02-06-2012, 08:01 AM
Find
Khyrpa Offline
Senior Member

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

void CreateParticleSystemAtEntity(string& asPSName, string& asPSFile, string& asEntity, bool abSavePS);

asEntity - the entity to create the particle system at

You should have a script area with the name PortalAltar_1 where you want the particle to spawn


02-06-2012, 08:58 AM
Find
trollox Offline
Member

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

Well this is what i read from the wiki
asPSName - internal name
asPSFile - the particle system to use + extension .p asEntity - the entity to create the particle system at
abSavePS - determines whether a particle system should “remember” its state

Which means this should work?


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

But for some reason it dosen't and khypa i know you know this it'd be a lot easier if you could just write down the working script instead of giving me fact that i can't actually understand , like i said i'm new to scripting and this if my first time ever trying to work with particles
02-06-2012, 01:53 PM
Find
Your Computer Offline
SCAN ME!

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

Internal name (asPSName): generally optional, except where destruction of the particle system is desired. Can be called anything you want.

Particle system (asPSFile): file name + file extension of the particle system.

Entity (asEntity): name of entity to create particle system at (script areas, that is, areas of type script should work too).

State save (abSavePS): deals with game saves, whether to save the "state" of the particle system. Generally false.

Example usage:
PHP Code: (Select All)
CreateParticleSystemAtEntity("GuardianPS""guardian_appear_explosion.ps""ScriptArea_1"false); 

Tutorials: From Noob to Pro
02-06-2012, 02:20 PM
Website Find
trollox Offline
Member

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

Well it still dosen't work add. Here's the intiere 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("PortalPs", "guardian_appear_explosion.ps", "PortalArea_1", false);
}


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

}

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



Okay so the PortalPs i got no clue what that is. The "guardian_appear_explosion.ps" is the Particle. And the PortalArea_1 is the area you collide with. So i'm guessing that the PortalPs Has somthing to do with why it's not working. Sort of didn't understand what it is , and it's function
02-06-2012, 02:42 PM
Find
Your Computer Offline
SCAN ME!

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

The internal name can be anything, even an empty string. Its use is merely for sake of reference when used in combination with DestroyParticleSystem. For debugging purposes, you may want to add a debug message inside the collision callback to see if any collision has occurred. Secondly, try creating the particle system in an area that you don't collide with but is in plain sight of the player. Finally, try preloading the particle system with PreloadParticleSystem (in OnEnter).

Tutorials: From Noob to Pro
02-06-2012, 03:10 PM
Website Find




Users browsing this thread: 1 Guest(s)