Sonic Adventure Revolution

In Progress Sonic Adventure: Revolution[V12] 12.0

No permission to download
The project is currently under development.
weapons will use respawn animation when you switch, you can override it with script to play a follow animation.

saved as respawn1.c etc.

Code:
void main(){
	int player = getlocalvar("player");
	void self = getplayerproperty(player, "ent");
	{
	changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"), 1);
	}
}
 
Thanks Beastie, but I don't know it would be written in the entities file, though you reminded me of a script I used in another mod where I had these enemy spawners use random Follow anims, so I found it and copied the script over. Now the weapon entity will override the spawn anim for Follow1 or 2, summoning the board Mikey needs for speed stages. Now there's still the thing about the boards jumping in the air with me. I may just alter the jump animations to crouch so it works with the board. The problem I may be having though, is that I'm using a method Orichie_X(IIRC) showed me with my pokemon mod back on lavalit. The summoned NPC was to just float over the players head to mark them so they could keep track during brawls. It still works, but for some reason, when I try to get the board to touch ground, it disappears. This is how it looks now but I'm going to mess around with it for a while.
Code:
name	MiBoard
type	NPC
subtype follow
#alpha 1
nolife  1
#nomove 1
facing 1
setlayer 1
gfxshadow 1

palette       data/chars/Mikey/Pal

#animationscript data/scripts/script.c
#animationscript data/scripts/Map.c


anim idle
	loop	1
	delay	3
	offset	151 150
	@cmd changeentityproperty getlocalvar("self") "Subject_to_Gravity" 0
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard2.gif
	
anim Walk
	loop	1
	delay	3
	offset	151 150
	@cmd changeentityproperty getlocalvar("self") "Subject_to_Gravity" 0
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard2.gif

x)
 
you just save it and put it in the scripts folder.

I dunno but I think white dragon already did this in his mod.  Doubt you should be using NPC at all, it should probably just be spawnbind to the player.
 
Ok, I searched around and found the Spawnbind script and added it. After changing the board to type none, it works almost perfectly, it no longer waits till I move to follow me. Now there's still the matter of the board jumping in the air with me when I want it to stay down.

BTW, this is how I have it setup, it's kinda of a mess but I it works:
Code:
anim    Spawn
      	@script
    void self = getlocalvar("self");
    if( frame == 1){
      int r = rand()%100;
      if( r > 11){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
      } else if( r < 0){
        changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW2"));
      }
    }
	@end_script
	loop	1
	delay	1
	offset	151 150
           #spawnframe 0 0 0 1 0
           #custentity MiBoard
	#@cmd	spawn01 "MiBoard" 0 0 0
	frame	data/chars/Mikey/Idle1.gif
	frame	data/chars/Mikey/Idle1.gif
	frame	data/chars/Mikey/Idle1.gif

anim    FOLLOW1
        loop	        0
	delay	1
	offset	151 150
           #spawnframe 0 0 0 1 0
           #custentity MiBoard
	#@cmd	spawn01 "MiBoard" 0 0 0
        @cmd   spawnbind2 "MiBoard" 0 0 0 1 0
	frame	data/chars/Mikey/Idle1.gif
	frame	data/chars/Mikey/Idle1.gif

anim    FOLLOW2
        loop 	0
	delay	1
	offset	151 150
           #spawnframe 0 0 0 1 0
           #custentity MiBoard
	#@cmd	spawn01 "MiBoard" 0 0 0
        @cmd   spawnbind2 "MiBoard" 0 0 0 1 0
	frame	data/chars/Mikey/Idle1.gif
	frame	data/chars/Mikey/Idle1.gif

x)
 
dunno if it'd work, maybe you can have jumpframe in the board constantly forcing it down.  You probably need script thou, maybe Bloodbane has something in mind.

There no need to use random like that.  Try this script to change animation.

Add it to your animation script and use it like this.

@cmd anichange "ANI_FOLLOW1" 0

Code:
void anichange(void Ani, int Frame)
{// Animation changer
    void self = getlocalvar("self");

    changeentityproperty(self, "animation", openborconstant(Ani), 2); //Change the animation
    updateframe(self, Frame);
}
 
I'll adjust that later. I went and played white dragon's TMNT mod then extracted the files.(Hope he's cool with that). I tried applying his script and it's not working, says it failed to parse.

Code:
name	MiBoard
type	none
subtype follow
#alpha 1
nolife  1
#nomove 1
facing 1
setlayer 1
gfxshadow 1

subject_to_gravity 1
no_adjust_base 0

palette       data/chars/Mikey/Pal

ondrawscript 	data/scripts/board_script.c
onspawnscript	data/scripts/board_spawn_script.c


anim idle
	@script
		void self = getlocalvar("self");
		int frame = getlocalvar("frame");

		if ( frame == 0 ) {
			void subent;

			clearspawnentry();
			setspawnentry("name","surf_shadow");
			subent = spawn();
			changeentityproperty(subent,"parent",self);
			changeentityproperty(subent,"setlayer",getentityproperty(self,"setlayer")-2);
			bindentity(subent,self,0,0,0,1,0);
		}
	@end_script
	loop	1 1 2
	delay	3
	offset	151 150
	#@cmd changeentityproperty getlocalvar("self") "Subject_to_Gravity" 0
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard2.gif
	frame	data/chars/Mikey/SBoard0.gif
	
anim Walk
	loop	1
	delay	3
	offset	151 150
	#@cmd changeentityproperty getlocalvar("self") "Subject_to_Gravity" 0
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard2.gif

(ondrawscript data/scripts/board_script.c)
Code:
#include "data/scripts/defines.h"
#import "data/scripts/lib.c"

#import "data/scripts/player_check_entities.c"

#import "data/scripts/wave.c"
#import "data/scripts/stairs.c"

// ENTITYVARS: "scene"

void main() {
    void self = getlocalvar("self");
    void parent = getentityproperty(self,"parent");

    /*if ( getentityproperty(parent,"exists") ) {
        //if ( getentityproperty(parent,"no_adjust_base") && !is_on_base(parent) ) {
        if ( !is_on_base(parent) ) {
            wave_flag = check_wave_ents(self);
        }
    }*/
    check_entities(self);

    if ( getentityvar(self,"scene") != 1 ) {
        check_altitude(self,parent);
        check_position(self,parent);
    }

    check_existence(self,parent);

    setlocalvar("wave_is_on_board_flag",NULL());
    setlocalvar("stair_is_on_board_flag",NULL());
    //drawstring(0,100,0,"esisto!");
}

int check_existence(void self, void parent) {
    if ( !getentityproperty(parent,"exists") && getlocalvar("candie") != NULL() ) {
        bindentity(self,NULL());
        killentity(self);
    } else {
        setlocalvar("candie",1);
    }
}

int check_position(void self, void parent) {
    if ( getentityproperty(parent,"exists") ) {
        float x = getentityproperty(self,"x");
        float z = getentityproperty(self,"z");
        float a = getentityproperty(self,"y");
        float base = getentityproperty(self,"base");
        int dir = getentityproperty(self,"direction");
        float px = getentityvar(parent,"x");
        float pz = getentityvar(parent,"z");
        float pa = getentityvar(parent,"y");
        float pbase = getentityvar(parent,"base");
        float pxdir = getentityproperty(parent,"xdir");
        float pzdir = getentityproperty(parent,"zdir");
        float ptossv = getentityproperty(parent,"tossv");
        int pdir = getentityvar(parent,"direction");
        int p_ent_type = getentityproperty(parent,"type");
        char defaultmodel = getentityproperty(self,"defaultmodel");
        float scr_posy = openborvariant("ypos");
        int wave_flag = getlocalvar("wave_is_on_board_flag");
        int stair_flag = getlocalvar("stair_is_on_board_flag");
        float xshift = 0, zshift = 0, new_dir = 0;

        // zshift = -2 or 0 but sorid < parent

        if ( px == NULL() ) px = getentityproperty(parent, "x");
        if ( pz == NULL() ) pz = getentityproperty(parent, "z");
        if ( pa == NULL() ) pa = getentityproperty(parent, "y");
        if ( pbase == NULL() ) pbase = getentityproperty(parent, "base");
        if ( pdir == NULL() ) pdir = getentityproperty(parent, "direction");

        if ( p_ent_type == openborconstant("TYPE_PLAYER") ) {
            new_dir = 1;
        } else if ( p_ent_type == openborconstant("TYPE_ENEMY") ) {
            new_dir = 0;
        }

        if ( defaultmodel == "surf" ) {
            xshift = 5;
            if ( !dir ) xshift *= 1;
            //zshift = 20;
        } else if ( defaultmodel == "esurf" ) {
            xshift = 0;
            if ( !dir ) xshift *= 1;
            //zshift = 18;
        } else if ( defaultmodel == "skate" ) {
            xshift = 2;
            if ( !dir ) xshift *= 1;
            //zshift = 10;
        } else if ( defaultmodel == "eskate" ) {
            xshift = -1;
            if ( !dir ) xshift *= 1;
            //zshift = 10;
        } else if ( defaultmodel == "ufo" ) {
            xshift = 5;
            if ( !dir ) xshift *= 1;
            //zshift = 20;
        } else if ( defaultmodel == "eufo" ) {
            if ( !dir ) xshift = -2;
            else xshift = 1;
            //zshift = 20;
        } else if ( defaultmodel == "snow" ) {
            xshift = 5;
            if ( !dir ) xshift *= 1;
            //zshift = 20;
        } else if ( defaultmodel == "esnow" ) {
            if ( !dir ) xshift = -2;
            else xshift = 1;
            //zshift = 20;
        }

        //drawstring( 10,50,0,"Var (board x):  "+px );
        //drawstring( 10,60,0,"Var (board z):  "+pz );
        //drawstring( 10,60,0,"Var:  "+getentityproperty(self,"speed") );

        //bindentity(self,parent,xshift,zshift,-1*(pa-pbase),0,0);
        //bindentity(self,NULL());

        /*float threshold = 0.001, inc = 1;
        float decimal_px, decimal_pz;
        decimal_px = px-trunc(px);
        decimal_pz = pz-trunc(pz);
        if ( decimal_px >= threshold ) {
            if ( !pdir ) inc *= -1;
            px = px + inc;
        } else px = px;
        if ( decimal_pz >= threshold ) {
            if ( getentityproperty(parent,"zdir") < 0 ) inc *= -1;
            pz = pz + inc;
        } else pz = pz;*/

        //if ( glv("aaa") == NULL() ) {
            //if ( pzdir == 0 ) zshift = -1;
            changeentityproperty(self,"position",px+xshift,pz+zshift,NULL()); // pbase
            //slv("aaa",1);
        //}

        //changeentityproperty(self,"speed",getentityproperty(parent,"speed"));
        //changeentityproperty(self,"aiflag","running","speed",getentityproperty(parent,"aiflag","running","speed"));
        changeentityproperty(self,"velocity",pxdir/2,pzdir/2,NULL());

        if ( (wave_flag == NULL() || wave_flag == 0) && (stair_flag == NULL() || stair_flag == 0) ) {
            if ( pa <= pbase ) {
                changeentityproperty(self,"no_adjust_base",1);
            } else {
                if ( getentityproperty(self,"no_adjust_base") == 1 ) changeentityproperty(self,"no_adjust_base",0);
            }
        }

        if ( pa <= pbase && ptossv == 0 ) {
            changeentityproperty(self,"base",pbase);
            changeentityproperty(self,"position",NULL(),NULL(),pbase);
        }
        if ( is_on_base(parent) && base != pbase && ptossv == 0 ) {
            changeentityproperty(self,"base",pbase);
        }

        if ( dir != new_dir ) changeentityproperty(self,"direction",new_dir);
    }
}

int check_altitude(void self, void parent) {
    if ( getentityproperty(parent,"exists") ) {
        float x = getentityproperty(self,"x");
        float z = getentityproperty(self,"z");
        float a = getentityproperty(self,"y");
        float base = getentityproperty(self,"base");
        float px = getentityproperty(parent,"x");
        float pz = getentityproperty(parent,"z");
        float pa = getentityproperty(parent,"y");
        float pbase = getentityproperty(parent,"base");

        if ( pa < a ) {
            changeentityproperty(self,"position",NULL(),NULL(),pa);
            changeentityproperty(self,"base",pbase);
        }
    }
}

int check_entities(void self) {
    int i = 0;
    int stair_found_flag = 0, stair_is_on = 0, tmp_stair_is_on = 0;
    int wave_found_flag = 0, wave_is_on = 0;
    void parent = getentityproperty(self,"parent");

    if ( getglobalvar("in_menu") != 1 && openborvariant("in_level") ) { // Waiting, Select
        if ( getlevelproperty("type") != 2 ) {

            check_interact_entities(self);
            for (i = 0; i < get_interact_ent_size(); ++i) { // openborvariant("count_entities") --- openborconstant("MAX_ENTS")
                void ent = get_interact_ent(i);

                if ( getentityproperty(ent, "exists") ) {
                    int type = getentityproperty(self,"type");
                    char ent_type = getentityvar(ent, "type");

                    /// WAVE ///
                    if ( getentityproperty(parent,"exists") ) {
                        if ( !is_on_base(parent) ) {
                            if ( ent_type == "wave_r" || ent_type == "wave_l" || ent_type == "wave_c" ) {
                                wave_found_flag = 1;
                                if ( !wave_is_on || wave_is_on == 2 ) {
                                    wave_is_on = check_wave(self, ent);
                                    setlocalvar("wave_is_on_board_flag",wave_is_on);
                                }
                                //if (wave_is_on == 1) break;
                            } // fine if wave
                        }
                    }

                    /// STAIR ///
                    if ( ent_type == "stair_r" || ent_type == "stair_l" || ent_type == "stair_q" ) {
                        stair_found_flag = 1;
                        if ( !stair_is_on || stair_is_on == 2 ) {
                            tmp_stair_is_on = check_side_stairs(self, ent);
                            if ( tmp_stair_is_on ) { stair_is_on = tmp_stair_is_on; setlocalvar("stair_is_on_board_flag",stair_is_on); }
                        }
                        //if (stair_is_on == 1) break;
                    } else if ( ent_type == "stair_c" ) {
                        stair_found_flag = 1;
                        if ( !stair_is_on || stair_is_on == 2 ) {
                            tmp_stair_is_on = check_frontal_stairs(self, ent);
                            if ( tmp_stair_is_on ) { stair_is_on = tmp_stair_is_on; setlocalvar("stair_is_on_board_flag",stair_is_on); }
                        }
                        //if (stair_is_on == 1) break;
                    } // fine if stair
                } // fine if exists
            } // fine for all_ents

            /// WAVE ///
            if ( !wave_found_flag || wave_is_on <= 0 ) {
                reset_wave(self);
                setlocalvar("wave_is_on_board_flag",NULL());
            }

            /// STAIR ///
            if ( !stair_found_flag || stair_is_on <= 0 ) {
                reset_stairs(self);
                setlocalvar("stair_is_on_board_flag",NULL());
            }
        }
    }
}

(onspawnscript data/scripts/board_spawn_script.c)
Code:
#include "data/scripts/defines.h"
#import "data/scripts/lib.c"

void main() {
    void self = getlocalvar("self");

    if ( !gep(self,"no_adjust_base") ) cep(self,"no_adjust_base",1);

    spawn_dust(self);
}

int spawn_dust(void self) {
        float x = gep(self,"x");
        float z = gep(self,"z");
        float y = gep(self,"y");
        float base = gep(self,"base");
        int dir = gep(self,"direction");
        char defaultmodel = gep(self,"defaultmodel");
        char dust_name = "board_dust";
        void ent;

        if ( defaultmodel == "surf" ) {

        } else if ( defaultmodel == "esurf" ) {

        } else if ( defaultmodel == "skate" ) {

        } else if ( defaultmodel == "eskate" ) {

        } else if ( defaultmodel == "ufo" ) {

        } else if ( defaultmodel == "eufo" ) {

        } else if ( defaultmodel == "snow" ) {
            float xshift = 36;

            if ( !dir ) xshift *= -1;

            //ent = spawnsubentity_relative(dust_name,0,-2,0,self);
            ent = spawnsubentity_parent(dust_name,x,z-1,y,self);
            bindentity(ent,self,xshift,-1,0,-1,0);
            cep(ent,"map",3);
            //cep(ent,"direction",dir);
        } else if ( defaultmodel == "esnow" ) {
            float xshift = 36;

            if ( !dir ) xshift *= -1;

            //ent = spawnsubentity_relative(dust_name,0,-2,0,self);
            ent = spawnsubentity_parent(dust_name,x,z-1,y,self);
            bindentity(ent,self,xshift,-1,0,-1,0);
            cep(ent,"map",3);
            //cep(ent,"direction",dir);
        }
}

========================================================================

Looking at the log files, these scripts are trying to import a bunch of other scripts. Gonna see if I can cut down on some and still make this work. I tried just cutting down the functions in scripts that causing the mod to crash, but it seems it still crashes because it's missing.
Code:
Script compile error: can't find function 'is_on_base'

Script compile error in 'ondrawscript': is_on_base line 149, column 13

x)
 
I'm not sure why your SPAWN animation didn't work before but I'm glad you got it solved

Now for your board, I just remembered a solution I had before. This is the board text:
name Board
type none
gfxshadow 1


anim idle
@script
    void self = getlocalvar("self");
    void Parent = getentityproperty(self, "parent");

    if(Parent!=NULL()){
      float Tx = getentityproperty(Parent,"x");
      float Tz = getentityproperty(Parent,"z");
      float Health = getentityproperty(Parent,"health");

      if(Health>0){
        changeentityproperty(self, "position", Tx, Tz);
      } else {
        killentity(self);
      }
    }
@end_script
loop 1
delay 1
offset 45 11
frame data/chars/misc/board.gif
frame data/chars/misc/board.gif

You can adjust offset and used sprites for your need
That board is spawned like this in SPAWN animation:
anim spawn
delay 8
offset  27 48
seta 40
frame data/chars/knbot/knbot2.png
@cmd spawner "Board" 0 -40 0
frame data/chars/knbot/knbot3.png

This is spawner function:
Code:
void spawner(void Name, float dx, float dy, float dz)
{ // Spawn certain entity and set it as child
   void self = getlocalvar("self");
   void Spawn;

   Spawn = spawn01(Name, dx, dy, dz);
   changeentityproperty(Spawn, "parent", self);
}

void spawn01(void vName, float fX, float fY, float fZ)
{
	//spawn01 (Generic spawner)
	//Damon Vaughn Caskey
	//07/06/2007
	//
	//Spawns entity next to caller.
	//
	//vName: Model name of entity to be spawned in.
	//fX: X location adjustment.
	//fY: Y location adjustment.
      //fZ: Z location adjustment.

	void self = getlocalvar("self"); //Get calling entity.
	void vSpawn; //Spawn object.
	int  iDirection = getentityproperty(self, "direction");

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

	if (iDirection == 0){ //Is entity facing left?                  
          fX = -fX; //Reverse X direction to match facing.
	}

      fX = fX + getentityproperty(self, "x"); //Get X location and add adjustment.
      fY = fY + getentityproperty(self, "a"); //Get Y location and add adjustment.
      fZ = fZ + getentityproperty(self, "z"); //Get Z location and add adjustment.
	
	vSpawn = spawn(); //Spawn in entity.

	changeentityproperty(vSpawn, "position", fX, fZ, fY); //Set spawn location.
	changeentityproperty(vSpawn, "direction", iDirection); //Set direction.
    
	return vSpawn; //Return spawn.
}

I hope that's understandable :)
 
Ok, I copied what you had and the board does spawn, but now it doesn't follow me.
Mikey's Follow anims(They are spawning it now and still subject to change)
Code:
anim    FOLLOW1
        loop	0
	delay	1
	offset	151 150
           #spawnframe 0 0 0 1 0
           #custentity MiBoard
	#@cmd	spawn01 "MiBoard" 0 0 0
        #@cmd   spawnbind2 "MiBoard" 0 0 0 1 0
        @cmd   spawner "MiBoard" 0 0 0
	frame	data/chars/Mikey/Idle1.gif
	frame	data/chars/Mikey/Idle1.gif

anim    FOLLOW2
        loop	0
	delay	1
	offset	151 150
           #spawnframe 0 0 0 1 0
           #custentity MiBoard
	#@cmd	spawn01 "MiBoard" 0 0 0
        #@cmd   spawnbind2 "MiBoard" 0 0 0 1 0
        @cmd   spawner "MiBoard" 0 0 0
	frame	data/chars/Mikey/Idle1.gif
	frame	data/chars/Mikey/Idle1.gif

From the Board's txt(Will also be changed once I'm doing changing things around):
Code:
name	MiBoard
type	none
subtype follow
#alpha 1
nolife  1
#nomove 1
facing 1
setlayer 1
gfxshadow 1

#subject_to_gravity 1
#no_adjust_base 0

palette       data/chars/Mikey/Pal

animationscript data/scripts/script.c
#animationscript data/scripts/Map.c
#ondrawscript	data/scripts/board_script.c
#onspawnscript	data/scripts/board_spawn_script.c


anim idle
@script
    void self = getlocalvar("self");
    void Parent = getentityproperty(self, "parent");

    if(Parent!=NULL()){
      float Tx = getentityproperty(Parent,"x");
      float Tz = getentityproperty(Parent,"z");
      float Health = getentityproperty(Parent,"health");

      if(Health>0){
        changeentityproperty(self, "position", Tx, Tz);
      } else {
        killentity(self);
      }
    }
@end_script
	loop	1
	delay	3
	offset	151 150
	#@cmd changeentityproperty getlocalvar("self") "Subject_to_Gravity" 0
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard2.gif

x)
 
Try this:
anim    FOLLOW1
delay 1
offset 151 150
frame data/chars/Mikey/Idle1.gif
        @cmd  spawner "MiBoard" 0 0 0
frame data/chars/Mikey/Idle1.gif

anim    FOLLOW2
delay 1
offset 151 150
frame data/chars/Mikey/Idle1.gif
        @cmd  spawner "MiBoard" 0 0 0
frame data/chars/Mikey/Idle1.gif
 
Ok, I tried this a few times but eventually it worked, the board follows me and stays on the ground now when I jump. Thanks Bloodbane.  8)


There's this small thing though, the board kinda lags behind the player a little while moving, not to much but it does. Anyway, here's how it looks now:
Code:
name	MiBoard
type	none
setlayer 1
gfxshadow 1

palette       data/chars/Mikey/Pal


anim idle
@script
    void self = getlocalvar("self");
    void Parent = getentityproperty(self, "parent");

    if(Parent!=NULL()){
      float Tx = getentityproperty(Parent,"x");
      float Tz = getentityproperty(Parent,"z");
      float Health = getentityproperty(Parent,"health");

      if(Health>0){
        changeentityproperty(self, "position", Tx, Tz);
      } else {
        killentity(self);
      }
    }
@end_script
	loop	1
	delay	3
	offset	151 150
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard2.gif

x)
 
Glad you got the boards working :)

As for lags a bit, you can fix it by breaking down the animation like this:
Code:
anim idle
@script
    void self = getlocalvar("self");
    void Parent = getentityproperty(self, "parent");

    if(Parent!=NULL()){
      float Tx = getentityproperty(Parent,"x");
      float Tz = getentityproperty(Parent,"z");
      float Health = getentityproperty(Parent,"health");

      if(Health>0){
        changeentityproperty(self, "position", Tx, Tz);
      } else {
        killentity(self);
      }
    }
@end_script
	loop	1
	delay	1
	offset	151 150
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard1.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard0.gif
	frame	data/chars/Mikey/SBoard2.gif
	frame	data/chars/Mikey/SBoard2.gif
	frame	data/chars/Mikey/SBoard2.gif
 
Added the fix. The lag is still there but a lot less noticeable now. The board is only 2 pixels behind Mikey when he moves which I really ha to pause the game and examine it to see.

Thanks again Bloodbane. While I'm still here though, I want to start using more traps in my speed stages soon. Is there a way to delay spawning? They would be spawned at the same "at #", but have them spawn one after the other rather then all of them at once. It would help in the future.

x)
 
Is there a way to delay spawning? They would be spawned at the same "at #", but have them spawn one after the other rather then all of them at once

Hmm... the best way I had in mind right now is to use blank SPAWN animation or alternate one with controllable delay
 
I think the former is pretty simple, don't know why I didn't think of that. Making about 5 or 6 separate entities of the same traps with delays from 100-600(would test first) before being active would do the trick. I was thinking of having the trap flash at the edge of the screen so players know it's on the way, which I could do just by using panel entities, I used 3 to summon flying enemies in the background of one of my stages.

x)
 
Actually, you can give a trap multiple "spawn" animations i.e use FOLLOW animations for the alternate spawn animations
Then to set or rather choose spawn animation, you spawn the trap with script like this:
spawn trap
@script
void main()
{
    void self = getlocalvar("self");
    performattack(self, openborconstant("ANI_FOLLOW1"));
}
@end_script
coords 400 225
at 0

The script will force trap entity to play FOLLOW1 animation when it's spawned

Alternatively, you can create this kind of SPAWN animation:
Code:
anim	spawn
@script
    if(frame==2){
      void self = getlocalvar("self");
      void Delay = getentityvar(self, 2);

      if(Delay > 0){
        setentityvar(self, 2, Delay-1);
	updateframe(self, 0);
      }
    }
@end_script
	delay	10
	offset	1 1
        frame   data/chars/misc/empty.gif
	delay	100
        frame   data/chars/misc/empty.gif
	delay	1
        frame   data/chars/misc/empty.gif
        frame   data/chars/misc/empty.gif

I could explain in detail how the script work but in short, the script will delay this entity's appearance by setting certain entity variable
Here's an example:
spawn Flobber
@script
void main()
{
      void self = getlocalvar("self");
      setentityvar(self, 1, 10);
      setentityvar(self, 2, 5);
}
@end_script
health 10
flip 1
coords 320 464 200
at 0

The script caused Flobber entity to delay its act for 5 second after it's spawned. Flobber is spawner entity whose task is to spawn Flobs with certain time periods BTW

Both methods can be used and the good thing is, both method allow efficient entity usage i.e one entity for multiple spawn delays
 
Ok Blood, it took some testing but I got the traps spawning, though the script worked on the first try, and I didn't know you could make entities use certain animations from the level txts, that ma help later on.

Rather then delay via script, I just added more empty frames to each Follow animation, so now they spawn in an orderly fashion.


Now with that done, there's 1 more thing I need help with. I want to be able to spawn text according to what character each player is playing as. Something that gets information on who the first detected player is (In case player 1 isn't there, but player 1 of the other 3), then what get which character they have, then spawn something based on them. I'm thinking of using panels. This way at certain times during gameplay, characters currently on screen will have their own dialogue for the story, and more players will make the dialogue more diverse.

EDIT:
Had to go to work shortly after I posted this, but I felt I should explain this a bit about the script. Still don't know how to actually write them but something like this might work:

Code:
anim spawn
frame	data/chars/misc/empty.gif
frame	data/chars/misc/empty.gif
   getlocalvar("Player1_Entity")
   If Sonic - performattack("ANI_FOLLOW1")
   if Knuckles - performattack("ANI_FOLLOW2")
   getlocalvar("Player2_Entity")// "If Player 1 isn't detected"
   If Sonic - performattack("ANI_FOLLOW1")
   if Knuckles - performattack("ANI_FOLLOW2")
frame	data/chars/misc/empty.gif
frame	data/chars/misc/empty.gif

anim FOLLOW1
frame	data/chars/misc/Sonictxt.gif
   getlocalvar("Player2_Entity")
   If Sonic - performattack("ANI_FOLLOW101")
   if Knuckles - performattack("ANI_FOLLOW102")
   getlocalvar("Player3_Entity")// "If Player 2 isn't detected"
   If Shadow - performattack("ANI_FOLLOW101")
   if Razor - performattack("ANI_FOLLOW102")
frame	data/chars/misc/empty.gif
frame	data/chars/misc/empty.gif

Hope that explains it. Had a thought and decided I could just use Follow anims and show text through frames.

x)
 
There are multiple ways to spawn proper dialogue from using single dialogue entity to using multiple dialogue entities
But the most important part here is which player will decide which dialogue to played?
 
That's the thing blood, I want the entity that's spawning text to decide based on which character the first detected player is using, if it can scan players in what order I set them in, like in my example. To be clear though, I'll be using frames to display text, kinda like here except the words will be a part of the window displaying the text: https://youtu.be/m04kKKoyfhQ?t=42s

x)
 
Back
Top Bottom