Dedicated weather effects modules?

PS_VITA

Active member
I'm looking to createa new stage with some weather effects, such as rain, snow, sand storms, lava ash cinders, ect.

Anyone know if anyone has ever created something similar to learn of from?
 
Gurtag said:
sure but you must use entities for the job as level layers cant scroll vertically

Where'd you get that idea? Layers can scroll natively in any direction along the X or Y axis, and both at the same time if you want diagonal.
 
First of all thank you guys.  Can I use Fglayer with an animated rain sprite.gif that follows the view of the player I already know how to use fground layer to follow the player but I'm not sure how to add an animated png or gif file to it.
 
ChronoCrash said:
First of all thank you guys.  Can I use Fglayer with an animated rain sprite.gif that follows the view of the player I already know how to use fground layer to follow the player but I'm not sure how to add an animated png or gif file to it.

No. You shouldn't be using .gif at all, and you certainly can't use animated .gif outside of cut scenes. To add animation to backgrounds you need to use panel entities or script tricks. The later I just posted a tutorial on that explains it all at length.

DC
 
ChronoCrash said:
I'm looking to createa new stage with some weather effects, such as rain, snow, sand storms, lava ash cinders, ect.

Anyone know if anyone has ever created something similar to learn of from?

There are some mods with rain and snow effects. Though they are using entities for those animated effects instead of fglayers.

If you want to use fglayers, you can go to link posted by Damon Caskey :).
 
There are some mods with rain and snow effects. Though they are using entities for those animated effects instead of fglayers.

If you want to use fglayers, you can go to link posted by Damon Caskey :).

Hi,

Do you still have access to the mods you mentioned that use entities for rain?

I'm having some optimization problems when creating a rain effect and I think I'm going to have to compromise and try something completely new.

So basically I created an entity called rainmaker and another called rain

When the level starts the stage loads rainmaker and rainmaker creates a rain entity via a script called shooter 3, this script is able to create an entity and spawn the rain drop with a certain velocity. The rain entity has a short life span.

It looks great ,but I can tell the game is chugging a bit.

I'm thinking it would probably be easier on my computer and the engine if I draw a simple rain animation square or tile and place it on the stage instead.
 
I was referring to this when I mention rain:
Code:
name        rain
type        panel
speedf        0
setlayer    1000


anim idle
    loop    1
    delay    5
    offset    149 222
    frame    data/chars/effects/1.gif
    frame    data/chars/effects/2.gif
    frame    data/chars/effects/3.gif
    frame    data/chars/effects/4.gif
    frame    data/chars/effects/5.gif
    frame    data/chars/effects/6.gif
    frame    data/chars/effects/7.gif

It's just simple animated effect placed in front of other entities.

Do you still have access to the mods you mentioned that use entities for rain?
Rise of Warduke has rain effect in some levels including some random encounter levels. But we actually copy the effect from other modules. I don't know where it was copied from. I only remember that some Marvel DC modules by Goresickness has rain effect also.

So basically I created an entity called rainmaker and another called rain

Do you really need it? If there are many things happening on the field, player won't pay attention much to rain effect. IOW using simple animated effect like the above is better and simpler.
 
I was referring to this when I mention rain:
Code:
name        rain
type        panel
speedf        0
setlayer    1000


anim idle
    loop    1
    delay    5
    offset    149 222
    frame    data/chars/effects/1.gif
    frame    data/chars/effects/2.gif
    frame    data/chars/effects/3.gif
    frame    data/chars/effects/4.gif
    frame    data/chars/effects/5.gif
    frame    data/chars/effects/6.gif
    frame    data/chars/effects/7.gif

It's just simple animated effect placed in front of other entities.


Rise of Warduke has rain effect in some levels including some random encounter levels. But we actually copy the effect from other modules. I don't know where it was copied from. I only remember that some Marvel DC modules by Goresickness has rain effect also.



Do you really need it? If there are many things happening on the field, player won't pay attention much to rain effect. IOW using simple animated effect like the above is better and simpler.


Yeah, I kinda do need it because I'm trying to build a certain mood for a particular scene... and thank you for the examples you provided. I think I'm going to use a hybrid of both.
 
rainmaker creates a rain entity via a script called shooter 3, this script is able to create an entity and spawn the rain drop with a certain velocity. The rain entity has a short life span.
I can imagine how that works.

A suggestion I could give is to spawn rain similar to Meteor Storm spell shown here:


Each Meteor is spawned like this:
@cmd Rspawn1 "Meteor" 0 240 0 140 25 2 -4 0
here's the function:
C:
void Rspawn1(void vName, float fX, float fY, float fZ, float Rx, float Rz, float Vx, float Vy, float Vz)
{//Spawns other entity in random spot relative to screen edge and move it with random speed
 //vName: Model name of entity to be spawned in
 //fX: X deviation relative to screen edge
 //fZ: Z deviation relative to center of playing field
 //Rx: Maximum x deviation
 //Rz: Maximum z deviation
 //Vx: X speed
 //Vz: Z speed

   void self = getlocalvar("self"); //Get calling entity
   int Direction = getentityproperty(self, "direction");
   int Screen = openborvariant("hResolution"); // Get screen width
   void vSpawn; //Spawn object
   int iDX;
   int iDZ;

   if(Rx!=0){
     iDX = rand()%Rx+fX;
   } else {
     iDX = 0;
   }

   if(Rz!=0){
     iDZ = rand()%Rz+fZ;
   } else {
     iDZ = 0;
   }

   if(Direction==0){
     Vx = -Vx;
   }

   vSpawn = spawn04(vName, iDX, fY, iDZ, Screen); //Spawn in entity
   changeentityproperty(vSpawn, "velocity", Vx, Vz, Vy);
   changeentityproperty(vSpawn, "direction", Direction);

   return vSpawn; //Return spawn
}

void spawn04(void vName, float fX, float fY, float fZ, int Edge)
{
    //Spawns entity based on left screen edge and center of playing field
    //
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
      //fZ: Z location adjustment

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int Direction = getentityproperty(self, "direction");
        int XPos = openborvariant("xpos"); //Get screen edge's position

    clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (Direction == 0){ //Is entity facing left?                  
      fX = Edge-fX; //Reverse X direction to match facing and screen length
   }

      fZ = fZ+(openborvariant("PLAYER_MIN_Z") + openborvariant("PLAYER_MAX_Z") )/2 ;

    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX + XPos, fZ, fY); //Set spawn location.
    return vSpawn; //Return spawn.
}
 
I can imagine how that works.

A suggestion I could give is to spawn rain similar to Meteor Storm spell shown here:


Each Meteor is spawned like this:

here's the function:
C:
void Rspawn1(void vName, float fX, float fY, float fZ, float Rx, float Rz, float Vx, float Vy, float Vz)
{//Spawns other entity in random spot relative to screen edge and move it with random speed
 //vName: Model name of entity to be spawned in
 //fX: X deviation relative to screen edge
 //fZ: Z deviation relative to center of playing field
 //Rx: Maximum x deviation
 //Rz: Maximum z deviation
 //Vx: X speed
 //Vz: Z speed

   void self = getlocalvar("self"); //Get calling entity
   int Direction = getentityproperty(self, "direction");
   int Screen = openborvariant("hResolution"); // Get screen width
   void vSpawn; //Spawn object
   int iDX;
   int iDZ;

   if(Rx!=0){
     iDX = rand()%Rx+fX;
   } else {
     iDX = 0;
   }

   if(Rz!=0){
     iDZ = rand()%Rz+fZ;
   } else {
     iDZ = 0;
   }

   if(Direction==0){
     Vx = -Vx;
   }

   vSpawn = spawn04(vName, iDX, fY, iDZ, Screen); //Spawn in entity
   changeentityproperty(vSpawn, "velocity", Vx, Vz, Vy);
   changeentityproperty(vSpawn, "direction", Direction);

   return vSpawn; //Return spawn
}

void spawn04(void vName, float fX, float fY, float fZ, int Edge)
{
    //Spawns entity based on left screen edge and center of playing field
    //
    //vName: Model name of entity to be spawned in.
    //fX: X distance relative to left edge
    //fY: Y height from ground
      //fZ: Z location adjustment

    void self = getlocalvar("self"); //Get calling entity.
    void vSpawn; //Spawn object.
    int Direction = getentityproperty(self, "direction");
        int XPos = openborvariant("xpos"); //Get screen edge's position

    clearspawnentry(); //Clear current spawn entry.
      setspawnentry("name", vName); //Acquire spawn entity by name.

   if (Direction == 0){ //Is entity facing left?               
      fX = Edge-fX; //Reverse X direction to match facing and screen length
   }

      fZ = fZ+(openborvariant("PLAYER_MIN_Z") + openborvariant("PLAYER_MAX_Z") )/2 ;

    vSpawn = spawn(); //Spawn in entity.

    changeentityproperty(vSpawn, "position", fX + XPos, fZ, fY); //Set spawn location.
    return vSpawn; //Return spawn.
}
Very cool, thanks.

Your random code is way better and less limited then the way I have mine set up currently. Thank you again.

(And btw than dungeon and dragons openbor game looks awesome! Great work!)
 
(And btw than dungeon and dragons openbor game looks awesome! Great work!)

You say that like it's a preview. That game was released several years ago:

 
All the more impressive.
I'm always overwhelmed by the sheer talent and dedication of many of the members and engine developers on this site. It's truly mind blowing.
 
Back
Top Bottom