Frictional Games Forum (read-only)

Full Version: Creating Particle Systems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone who is kind enough to read this!

Lately, I've improved my skills in scripting by for example being able to program my own flashbacks. Those works
just fine, but I got a little over my head and tried creating a PS on an entity (PS: s are the hardest thing I know so far), but without success. My question: Is it invalid to create a PS in a script area? Or how do I make my rose petals show when the player enters the room?

{
AddEntityCollideCallback("Player", "Look_Roses", "PS_System", true, 1);
}


void PS_System(string &in asChild, string &in asParent, int alState)
{
CreateParticleSystemAtEntity("Roses_Red", "ps_rose_petals.ps", "Roses", true);
//Y U no work?!
}

Look_Roses = The area the player enters when he enters the room (a script area)
Roses_Red = What I named the PS (the internal name)
Roses = The script area I want the PS to start from

(asPSName - internal name
asPSFile - the particle system to use + extension .ps
asEntity - the entity to create the particle system at
abSavePS - determines whether a particle system should “remember” its state)
What I think is wrong is that I've missunderstood what the internal name should be used for, or is it invalid to use a script function to create a PS at? Also, I was wondering what the boolean parameter "abSavePS" means?
Kind Regards,
/Twitchez
I'm still in the middle of observing your script, so in the meantime I'll show you a script I used in my story which works just fine.
Code:
{
    AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
    CreateParticleSystemAtEntity("", "ps_dust_push_15", "areawhirl", false);
    PlaySoundAtEntity("", "scare_wind.snt", "Player", 0, false);
}

Just so you know areawhirl is a script area.
As a basic rule of thumb when your trying to troubleshoot something, put in a

void AddDebugMessage(string& asString, bool abCheckForDuplicates);


To check if your script is being executed at all... In this case it would be good since theirs only one thing going on.
//*******************************************
But to fix your problem... Your parameters are backwards...

void PS_System(string &in asChild, string &in asParent, int alState)

should be...

void PS_System(string &in asParent, string &in asChild, int alState)

Ah ok Rapture, I just solved it before I looked at your post. What I changed was to this:


void PS_System(string &in asChild, string &in asParent, int alState)
{
CreateParticleSystemAtEntity("", "ps_rose_petals.ps", "Roses", false);
//Y U work?!
}

I havent tried writing the parameters in the way you suggested. I have them in this order I wrote in every other bit of my code, and it works just fine.

It will be interesting to try though, thanks for all the responses!