Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Modifying existing particles with particle properties (https://forums.graalonline.com/forums/showthread.php?t=134270128)

DustyPorViva 11-16-2015 11:45 AM

Modifying existing particles with particle properties
 
Is there any way to modify particles based on the properties of the particles themselves? What I'm trying to do is modify a particles x/y movement dependent on its height. I want the particles to move faster if they're higher in the air, based on player input(walking).

This is my attempt:
PHP Code:

  temp.emitter findimg(200).emitter;
  if (
abs(temp.dx) > 0) {
    
with (temp.emitter) {
      
addglobalmodifier("once"05"x""add", -temp.dx*particles[0].z,-temp.dx*particles[0].z);
    }
  } 

But obviously it doesn't work or I wouldn't be here.

DrakilorP2P 06-28-2016 07:51 AM

I don't think so. There's no way to read or write the variables of particles; fairly literal fire and forget.

The particles[] array you're accessing is just templates/prototypes/classes which hold the starting variables of the actual particles.

You could maybe be dynamic with the modifiers though by repeatedly doing removemodifiers() and add*modifier() but I'm not sure how well that works or if it could get laggy.


All times are GMT +2. The time now is 07:57 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.