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
Creating Particle Systems
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#1
Creating Particle Systems

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
(This post was last modified: 04-11-2012, 05:43 PM by Twitchez.)
04-11-2012, 05:42 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#2
RE: Creating Particle Systems

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.
{
    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.
(This post was last modified: 04-11-2012, 05:48 PM by Kreekakon.)
04-11-2012, 05:47 PM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#3
RE: Creating Particle Systems

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)

(This post was last modified: 04-11-2012, 05:52 PM by Rapture.)
04-11-2012, 05:52 PM
Find
Twitchez Offline
Member

Posts: 67
Threads: 17
Joined: Mar 2012
Reputation: 1
#4
RE: Creating Particle Systems

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!
(This post was last modified: 04-11-2012, 06:03 PM by Twitchez.)
04-11-2012, 06:02 PM
Find




Users browsing this thread: 1 Guest(s)