Gurtag said:sure but you must use entities for the job as level layers cant scroll vertically
Damon Caskey said: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.
Gurtag said:sorry i meant autoscroll.
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.
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.
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
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 still have access to the mods you mentioned that use entities for rain?
So basically I created an entity called rainmaker and another called rain
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.
I can imagine how that works.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.
here's the function:@cmd Rspawn1 "Meteor" 0 240 0 140 25 2 -4 0
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.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. }
(And btw than dungeon and dragons openbor game looks awesome! Great work!)