[SCRIPT] Water Puddle Effect v1.61 (old version)

however, the problem is certainly not the script.
To see if something is in conflict you can try to put comments about the functions of my script and see what are the functions that create problems.
 
i found it
its this line on (water_puddle_script.c)
if ( openborvariant("in_level") && getlevelproperty("type") != 2 )
int check_entities(void self) {
    int i = 0;
    int water_puddle_found_flag = 0, water_puddle_is_on = 0;

    if ( openborvariant("in_level") && getlevelproperty("type") != 2 ) { // Waiting, Select
        for (i = 0; i < openborvariant("count_entities"); ++i) { // openborconstant("MAX_ENTS")
            void ent = getentity(i);

            if ( getentityproperty(ent, "exists") ) {
                /// WATER PUDDLE ///
                if ( getentityvar(ent, 0) == "water_puddle" ) {
                    int anim_id = getentityproperty(self,"animationid");
                    int water_puddle_flag = 0;

                    water_puddle_found_flag = 1;
                    if ( anim_id == openborconstant("ANI_SPAWN") || anim_id == openborconstant("ANI_RESPAWN") ) {
                        int anim_pos = getentityproperty(self,"animpos");
                        if ( anim_pos <= 1 ) water_puddle_flag = 1;
                    }
                    if ( !water_puddle_flag && !water_puddle_is_on ) water_puddle_is_on = check_water_puddle(self, ent);
                    if ( !water_puddle_is_on && getlocalvar("water_puddle_found") != 1 ) setlocalvar("water_puddle_found",1);
                }
            } // fine if exists
        } // fine for all_ents

        /// WATER PUDDLE RESET ///
        if ( !water_puddle_found_flag || water_puddle_is_on <= 0 ) {
            reset_water_puddle(self);
        }
    }
}

if you remove the:
if ( openborvariant("in_level") && getlevelproperty("type") != 2 )

the game wont crash on player select screen... and the water effect is on
 
thanks :D
there is still a minor diference from the previuos lib_water_puddle.c
iam earing the splash.wav sound a bit louder and with some eco
its like its spawning 2/3 splashs when the player jumps...

ive tried changin this lines in lib_water_puddle
Code:
void spawn_splash(void self, char water_splash_name, char splash_sound_name, int frame, int map) {
    void splash;
    float base = gep(self,"base");

    if ( map == NULL() ) map = 0;

    splash = spawnsubentity_relative(water_splash_name,RIPPLE_XSHIFT,1,NULL(),self);
    changeentityproperty(splash,"position",NULL(),NULL(),base+RIPPLE_ASHIFT+get_water_height()-WATER_H_FIX);
    changeentityproperty(splash,"parent",self);
    changeentityproperty(splash,"map",map);

    if ( frame != NULL() ) {
        changeentityproperty(splash,"animpos",frame);
        playsample(loadsample(splash_sound_name));
    }

    return splash;
}

// return 0 if it doesn't exists
int check_splash_pos(void self, void splash, char model_name) {
    if ( gep(splash,"exists") ) {
        int anim_pos = gep(splash,"animpos");

        if ( !is_name(splash,"defaultmodel",model_name) || !is_for(splash,self) ) return 0;

        if ( anim_pos <= SPLASH_DOWN_START_FRAME ) {
            float x = gep(self,"x");
            float z = gep(self,"z");
            float a = gep(self,"a");
            float base = gep(self,"base");
            int dir = gep(self,"direction");
            float ex = gep(splash,"x");
            float xshift = RIPPLE_XSHIFT;

            if ( !dir ) xshift *= -1;
            if ( ex != x+xshift ) {
                cep(splash,"position",x+xshift,z+1,base+RIPPLE_ASHIFT+get_water_height()-WATER_H_FIX);
            }
        } // fine if animpos

        return 1;
    } else return 0; // fine if exists
}

but nothing happens the splash change doesnt seem to be coming from here...
can you give me a hint from what is causing the splash to spawn 2/3 times
 
Little change about int check_ripple() function. (see 1st post)
Tested, only 1 splash for time!

If you want to make a test, insert a global var that increase itself about "1" when spawn a splash in check_ripple() function.
example:
if (ggv("test")!=NULL()) sgv("test",ggv("test")+1); else sgv("test",0);

then draw the string:
drawstring(x,y,0,"var: "+ggv("test"));

you'll see only 1 increment for a splash!

jonsilva said:
can you give me a hint from what is causing the splash to spawn 2/3 times
FOUND YOUR PROBLEM:
Comment splash.wav in splash entity!

name water_splash
type none
toflip 1
nomove 1 0

#antigravity 100
subject_to_wall 0
subject_to_obstacle 0
subject_to_platform 0
subject_to_gravity 0
no_adjust_base 1

anim idle
delay 6
offset  26  58
    frame data/chars/misc/water/water_splash/water_splash01.gif
#sound data/sounds/water_splash01.wav
    frame data/chars/misc/water/water_splash/water_splash02.gif
offset  24  58
    frame data/chars/misc/water/water_splash/water_splash03.gif
offset  25  73
    frame data/chars/misc/water/water_splash/water_splash04.gif
offset  30  61
    frame data/chars/misc/water/water_splash/water_splash05.gif
    frame data/chars/misc/water/water_splash/water_splash06.gif
offset  30  62
    frame data/chars/misc/water/water_splash/water_splash07.gif
offset  29  59
    frame data/chars/misc/water/water_splash/water_splash08.gif
offset  31  59
    frame data/chars/misc/water/water_splash/water_splash09.gif
@cmd killentity getlocalvar("self")
    frame data/chars/misc/water/water_splash/water_splash09.gif
 
hahaha pretty cool! But the character should make bigger splashes when he runs, no?
And when he falls from those super jump combos too.
 
thanks for the nice comments
character should make bigger splashes when he runs
And when he falls from those super jump combos too
thats just a matter of changing the sprites in water ripple and water splash entities to one that fits the game you re on...

falling down from building cutscene effect.
its very easy the rock break and player fall is a noskip text entity (rvfall.txt). with slowmotion 1... mr karate turn slowmotion 0 once he lands from the jump...
the level screen scrolls down automatically. (its a fake falling scene the player is already down playing his spawn anim)
Code:
spawn   rvfall
coords  130 940 600
at      0

spawn   rvfall
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW1"));
} @end_script
flip    1
coords  140 740 350
at      0


#----------------------
spawn   splash
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW4"));
} @end_script
coords  350 900 50
at      0

spawn   splash
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW4"));
} @end_script
coords  480 900 50
at      0

spawn   splash
@script void main() {
   performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW4"));
} @end_script
coords  425 910 50
at      0
#----------------------

 
So let me get this a little straight:
- Make a no skip that will enable slowmotion
- Put the player already at the bottom of the level (the level assuming has cameratype 1 in it)
- A dummy goes down the level and the camera with him.
- The dummy then sets slowmotion 0 and the noskip is then discarded

Am I right?
 
yes that way will work
- A dummy goes down the level and the camera with him.
theres no need for a dummy the level scrolls down automatically once the noskip text entity is dead... mr karate then turns slow motion off in is spawn anim

ive also put the rock break and players fall in the same noskip text entity
spawn  rvfall
coords  130 940 600
at      0

spawn  rvfall
@script void main() {
  performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW1"));
} @end_script
flip    1
coords  140 740 350
at      0

rvfall.txt pallete
pal.gif



 
That will be very useful jonsilva, I'll consider it. Thanks (and sorry I'm pointing something too far off the main topic, I was just curious on how you did it  :-[)
 
Many Thanks for script! But I have a question. How we can fix this bug? In this script, entities who have alpha effect do not work. Se this example The aura of Bardock!
If we put ondrawscript on header of this aura, the drawnmethod effect of it will desable. If remove, the script will not work.
17523148_632916853563730_1593932876606211424_n.jpg
 
Back
Top Bottom