Frictional Games Forum (read-only)
[SCRIPT] Creating Particle, setting different axis? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Creating Particle, setting different axis? (/thread-24690.html)



Creating Particle, setting different axis? - FoodOnCrack - 02-23-2014

Hellooo! Tongue

I am working busy on my second custom story (i threw away my first one) And i want to create a particle system and a sound at an entity when i enter a specific area. It turned out good the first time without errors, but the unfortunate thing, the orientation of the particle system is incorrect. I created a ps_dust_push at a level door but it is 90 degrees off.

Here is my code:

PHP Code:
void OnStart()
{
// Area Player Collide Scripts
    
AddEntityCollideCallback("Player""ScriptArea_1",  "BlowWind_1"true1);
    
AddEntityCollideCallback("Player""ScriptArea_2",  "BlowWind_2"true1);
}


void BlowWind_2(string &in asParentstring &in asChildint alState
{
    
CreateParticleSystemAtEntity("Wind_2""ps_dust_push.ps""level_dungeon_1"false);
    
PlaySoundAtEntity("""guardian_ontop.snt""level_dungeon_1"0false);
    
GiveSanityDamage(5true);



Is there another way of scripting this or doing something different in the level editor? Thank you!

PS. I'm looking for Alpha/Beta testers to play my custom story Smile


RE: Creating Particle, setting different axis? - Wapez - 02-23-2014

Turn the area you are spawning the particle on around, so it's facing the way you want the particle to face. There's no way of seeing this in the level editor, (might be positive X axis), but you can try it out in game.


RE: Creating Particle, setting different axis? - FoodOnCrack - 02-23-2014

(02-23-2014, 07:57 PM)Wapez Wrote: Turn the area you are spawning the particle on around, so it's facing the way you want the particle to face. There's no way of seeing this in the level editor, (might be positive X axis), but you can try it out in game.

I feared that, it is a level door which can't be turned. (it can but that would look very stupid.)
How about creating a script area on the door and setting the particle system on that?


RE: Creating Particle, setting different axis? - Mudbill - 02-23-2014

Well, you can use a PlayerStartArea type when placing it. They show the local axises of the area. If it uses positive X, then that'd be the blue arrow. After that you can just change the area type back to ScriptArea.


RE: Creating Particle, setting different axis? - davide32 - 02-23-2014

You can use a SetEntityActive("YourArea", true);
if true you make the Entity or areas active if false inactive


RE: Creating Particle, setting different axis? - Mudbill - 02-24-2014

(02-23-2014, 10:13 PM)davide32 Wrote: You can use a SetEntityActive("YourArea", true);
if true you make the Entity or areas active if false inactive

That is correct, but you might've misunderstood what was asked. OP was wondering how to rotate a scripted particle system.


RE: Creating Particle, setting different axis? - davide32 - 02-24-2014

yes but if you want to rotate the PS to some different axis you can use over a SetEntityActive of an area+ but I think the script is RotatePropToSpeed applied of a particle system to rotate the PS in a different axis, but i'm not sure for it does it work I try it if does it work i give you the hps file