Teenage Mutant Ninja Turtles - Shell Shocked

Canceled Teenage Mutant Ninja Turtles: Shell Shocked 5850

No permission to download
Project is halted prior to completion and will not receive further updates.
BeasTie said:
Nice work WD.

@ O - nah it doesn't pull them in it spins them away from you

thanks!! Yes it works on foot and rock soldier!!
Next time I upload the demo in another filehosting.
Any advice?

O Ilusionista said:
And the code check the target distance and adapt the animation, right?

Right!! ;)
 
@ O - nah it doesn't pull them in it spins them away from you
no, its not my point (WD got it already). What I mean is: if the move hits the enemy that is near, you will see less pieces of the "chain". If the enemy is far away, you will see more pieces. IOW it will put more or less pieces dinamically. Or, you use the anipos trick stored on a variable
 
O Ilusionista said:
@ O - nah it doesn't pull them in it spins them away from you
no, its not my point (WD got it already). What I mean is: if the move hits the enemy that is near, you will see less pieces of the "chain". If the enemy is far away, you will see more pieces. IOW it will put more or less pieces dinamically. Or, you use the anipos trick stored on a variable

- Mike launches the hook, and so he spawns a new entity (the hook).
- so mike goes in a stall (loop of frames)
- in didhit event, the hook change animation in a empty frames (so I can handle the weap)
- now the hook spawns all chain pieces: distance/piece_width = num of pieces

however the difficult is to handle the position if for any reason mike changes his position and more hard is
to avoid bugs if soldier or mike are in pain when mike hold a soldier with the hook (or while launching the hook).

only the hook is about 600 code lines (my personal lib excluded)  ;D
 
only the hook is about 600 code lines
wow, maybe using the anipos trick could be lighter.

Let me try to draw it and explain...

Imagine that "|" is the turtle, and the "-" are chain pieces. So you have this as, say, freespecial2:
frame 0 |-
frame 1 |--
frame 2 |---
frame 3 |----
frame 4 |-----
frame 5 |------

Then you make the same  animation as a follow anim but reversed:
|------
|-----
|----
|---
|--
|-

So, if you store the anipos of the turtle in a variable and use that value to change the anipos on the Follow anim. To make it easier to code, I suggest you to use a full animation, duplicating the whole animation:
|-
|--
|---
|----
|-----
|------
|-----
|----
|---
|--
|-

So, if the hit happened in the 5th frame, you will go to Follow anim but will jump to 5TH frame and play the rest of the animation.

Then, if each pice has 20pixels in the frame 5, were we have 5 pieces, the total length is 100 pixels. this will be your value for the binding.

have you got my idea?
 
mmm... no with animpos trick is a huge code.
hee my code on didhit:
Code:
#import "data/scripts/lib.c"

void main() {
    void self = getlocalvar("self");
    int drop = getlocalvar("drop");
    int damage = getlocalvar("damage");
    void parent = getentityproperty(self, "parent");
    void opp = getentityproperty(self,"opponent");
    int attacktype = getlocalvar("attacktype");

    setentityvar(self,"opp",opp);
    damage = getentityvar(self,"damage");
    if ( damage != NULL() ) damage = getentityvar(self,"damage");
    else damage = 10;

    check_hit_type(self,parent,opp,attacktype,damage,drop);

    //check_retire_hook(self); // on animationscript
    //performattack(self,openborconstant("ANI_DIE"),1); // use this one instead retire_hook!
}

void generate_rope(void self, void opp, void parent) {
    if ( getentityproperty(opp, "exists") && getentityproperty(parent, "exists") ) {
        int opp_anim_id = getentityproperty(opp, "animationid");
        int o_defaultmodel = getentityproperty(opp, "defaultmodel");
        //int layer = getentityproperty(opp, "setlayer")-1; // in questo modo la corda apparirà sempre dietro il player!!
        float x = getentityproperty(parent, "x");
        float z = getentityproperty(parent, "z");
        float a = getentityproperty(parent, "y");
        float base = getentityproperty(parent, "base");
        float x_distance = 0;
        float ox = getentityproperty(opp, "x");
        float oz = getentityproperty(opp, "z");
        float oa = getentityproperty(opp, "y");
        float obase = getentityproperty(opp, "base");
        int i, rope_width = 16, pg_width = 40;
        float x_shift = 84;

        if ( ox < x ) x_distance = x-ox;
        else x_distance = ox-x;

        // Ora sappiamo che la distanza è di ox-x e sappiamo anche la larghezza della corda e del personaggio.
        if ( x_distance >= pg_width ) x_distance = (x_distance-pg_width)/rope_width; // dividiamo per la larghezza della rope
        else x_distance = x_distance/rope_width;

        x_distance -= 2;

        // Se il player sta più in su del nemico allora facciamo in modo che comunque la corda stia dietro il player!!
        // Infatti prima sistemiamo la z del rodney ed in base a questa quella dell'opp
        check_safe_pos(parent,0,1);
        x = getentityproperty(parent, "x");
        z = getentityproperty(parent, "z");
        a = getentityproperty(parent, "y");
        base = getentityproperty(parent, "base");

        for ( i = 0; i < x_distance; ++i ) {
            if ( getentityvar(self,"rope_"+i) == NULL() ) {
                void ent;

                clearspawnentry();
                setspawnentry("name", "turtle_rope_part");
                ent = spawn();

                changeentityproperty(opp, "position", ox, z+1, oa); // il +1 lo facciamo per le z con la virgola!
                if ( getentityproperty(parent, "direction") == 0 ) {
                    changeentityproperty(ent, "position", x-x_shift-(rope_width*i), z, a+0);
                    setentityvar(ent,"weap_shiftx",0-x_shift-(rope_width*i));
                    setentityvar(ent,"weap_shifta",0);
                } else {
                    changeentityproperty(ent, "position", x+x_shift+(rope_width*i), z, a+0);
                    setentityvar(ent,"weap_shiftx",0+x_shift+(rope_width*i));
                    setentityvar(ent,"weap_shifta",0);
                }
                changeentityproperty(ent, "base", a+0);
                setentityvar(self,"rope_"+i, ent);
                changeentityproperty(ent, "parent", parent); // così muore quando muore il padre (self)

                if ( getentityproperty(self, "direction") == 1 ) changeentityproperty(ent, "direction", 1);
                else  changeentityproperty(ent, "direction", 0);

                //changeentityproperty(ent, "setlayer", layer);
            }
        } // fine for
        setentityvar(self,"rope_num", x_distance);
    }
}

int rope_clear() { // resettiamo le variabili globali!!
    if ( getlocalvar("rope_num") != NULL() && getlocalvar("rope_num") >= 0 ) {
        int i;

        for ( i = 0; i < getlocalvar("rope_num"); ++i ) {
            void rope_part = getlocalvar("rope_"+i);

            if ( rope_part != NULL() && getentityproperty(rope_part,"exists") ) {
                killentity(rope_part);
                setlocalvar("rope_"+i, NULL());
            }
        } // fine for
    }

    if ( getlocalvar("hook_color_map") != NULL() && getentityproperty(getlocalvar("hook_color_map"),"exists") ) {
        bindentity(getlocalvar("hook_color_map"),NULL(),0,0,0,1,0);
        killentity(getlocalvar("hook_color_map"));
        setlocalvar("hook_color_map", NULL());
    }
}

/*void check_retire_hook(void self) {
    int anim_id = getentityproperty(self, "animationid");
    //int anim_pos = getentityproperty(self, "animpos");
    int next_frame = 0;
    int hook_frame = getentityvar(self,0);
    int health = getentityproperty(self,"health");

    if ( hook_frame == NULL() ) return;
    //if ( anim_id != openborconstant("ANI_DIE") ) return;

    performattack(self,openborconstant("ANI_DIE"),1);
    //damageentity(self,self,health,0,openborconstant("ATK_NORMAL"));

    // 7 frames + 1 per idle 5+1 per death
    // 3 -> 1, 2 -> 2, 1 -> 3, 0 -> 4 EX. 4-3=1,4-2=2 etc...
    if ( hook_frame >= 4 ) next_frame = 0;
    else next_frame = 4-hook_frame;
    changeentityproperty(self,"animpos",next_frame);
}*/

void check_hit_type(void self, void parent, void opp, int attacktype, int damage, int drop) {
    char o_model = getentityproperty(opp, "defaultmodel");
    char cFind1 = "foot", cFind2 = "FOOT", cFind3 = "rock", cFind4 = "ROCK";
    char substr1 = strinfirst(o_model, cFind1);
    char substr2 = strinfirst(o_model, cFind2);
    char substr3 = strinfirst(o_model, cFind3);
    char substr4 = strinfirst(o_model, cFind4);

    if ( attacktype == openborconstant("ATK_NORMAL62") && getentityproperty(opp,"animvalid",openborconstant("ANI_PAIN62")) ) {
        if ( substr1 != -1 || substr2 != -1 || substr3 != -1 || substr4 != -1 ) {
            check_hit_type_atk62(self,parent,opp,damage,drop);
        } else check_hit_type_normal(self,parent,opp,damage,drop);
    } else {
        check_hit_type_normal(self,parent,opp,damage,drop);
    }
}

void check_hit_type_atk62(void self, void parent, void opp, int damage, int drop) {
    void ent;

    // ---------- TYPE_ENT DAMAGE ------------
      /*if ( getentityproperty(parent,"exists") ) {
        if ( getentityproperty(parent,"type") == openborconstant("TYPE_PLAYER") ) damage *= 1.75;
      }*/
    // ---------- TYPE_ENT DAMAGE ------------

          // ---------- UCCIDI SU COLPO ----------
    if ( opp != NULL() ) {
        float oa = getentityproperty(opp,"y");
        float obase = getentityproperty(opp,"base");
        char ATTACK_TYPE = "ATK_NORMAL62";

        if ( parent == NULL() ) parent = self;

        changeentityproperty(parent, "opponent", opp);

        if ( opp == parent ) {
            changeentityproperty(self,"opponent",NULL());
            return; // escludiamo chi ha scoccato la freccia per il noreflect
        }

        // Danneggia l'avversario per il noreflect
        if ( getentityproperty(opp,"exists") ) {
            int ohealth = getentityproperty(opp,"health");
            float oa = getentityproperty(opp,"y");
            float obase = getentityproperty(opp,"base");

            //if ( oa > obase ) drop = 1;
            if ( oa > obase ) {
                drop = 1;
                ATTACK_TYPE = "ATK_NORMAL";
            } else {
                drop = 0;
                damage = 0;
            }

            if ( ohealth-damage > 0 ) damageentity(opp,parent,damage,drop,openborconstant(ATTACK_TYPE));
            else damageentity(opp,parent,damage,drop,openborconstant(ATTACK_TYPE));

            if ( !getentityproperty(opp,"aiflag","blocking") ) {
                if ( !getentityproperty(opp,"flash","noattack") ) {
                    if ( drop ) show_flash(); // Il flash è in mostra?? Se no allora eseguilo.
                    playsample(loadsample("data/sounds/punch004.wav"));
                }
            } else {
                if ( getentityproperty(self,"flash","block") ) {
                    show_block_flash();
                    playsample(loadsample("data/sounds/punch003.wav"));
                }
            }

            // ------------ MAIN ROPE CODE --------------
            generate_rope(self,opp,getentityproperty(self,"parent"));
            clearspawnentry();
            setspawnentry("name", "turtle_hook_color_map");
            ent = spawn();

            if ( getentityproperty(ent,"exists") ) {
                char o_model = getentityproperty(opp, "defaultmodel");
                char cFind1 = "foot", cFind2 = "FOOT", cFind3 = "rock", cFind4 = "ROCK";
                char substr1 = strinfirst(o_model, cFind1);
                char substr2 = strinfirst(o_model, cFind2);
                char substr3 = strinfirst(o_model, cFind3);
                char substr4 = strinfirst(o_model, cFind4);

                setentityvar(self,"hook_color_map", ent);
                setentityvar(self,"ROPE_ATK",1);
                if ( getentityproperty(parent,"exists") ) {
                    int map = getentityproperty(parent,"map");
                    int mapcount = getentityproperty(parent, "mapcount")-1;

                    // 3 sono le mappe da 0 a 3 del player e 4 sono le mappe della nuova ent
                    if ( map >= mapcount-3 && map <= mapcount ) changeentityproperty(ent, "map", map-(mapcount-4));
                    changeentityproperty(ent,"parent",parent);
                }
                if ( substr3 != -1 || substr4 != -1 ) bindentity(ent,opp,0,0,-1,1,0);
                else bindentity(ent,opp,0,0,0,1,0);
            }
            performattack(self,openborconstant("ANI_FOLLOW50"),1);
            //performattack(parent,openborconstant("ANI_FOLLOW83"),1); // <---------- AGGIUNGERE ATK BTN PER SLACCIARE!!
        }
    }
}

void check_hit_type_normal(void self, void parent, void opp, int damage, int drop) {
  // ------------- PARATI SOLO DALL'ATTACCO NORMALE -----------
  /*if ( getentityproperty(opp,"aiflag","blocking") ) { // && oa <= obase
	show_block_flash(opp);
	changeentityproperty(opp,"aiflag","blocking",1);
	changeentityproperty(opp,"takeaction","common_block",1);
	opp = NULL();
  }*/

   // ---------- TYPE_ENT DAMAGE ------------
  /*if ( getentityproperty(parent,"exists") ) {
	if ( getentityproperty(parent,"type") == openborconstant("TYPE_PLAYER") ) damage *= 1.75;
  }*/
  // ---------- TYPE_ENT DAMAGE ------------

  // ---------- UCCIDI SU COLPO ----------
  if ( opp != NULL() ) {

    if ( parent == NULL() ) parent = self;

	changeentityproperty(parent, "opponent", opp);

	if ( opp == parent ) {
		changeentityproperty(self,"opponent",NULL());
		return; // escludiamo chi ha scoccato la freccia per il noreflect
	}

	// Danneggia l'avversario per il noreflect
	if ( getentityproperty(opp,"exists") ) {
		int ohealth = getentityproperty(opp,"health");
		float oa = getentityproperty(opp,"y");
		float obase = getentityproperty(opp,"base");

        //if ( oa > obase ) drop = 1;
        drop = 1;

		if ( ohealth-damage > 0 ) damageentity(opp,parent,damage,drop,openborconstant("ATK_NORMAL"));
		else damageentity(opp,parent,damage,drop,openborconstant("ATK_NORMAL"));

        if ( !getentityproperty(opp,"aiflag","blocking") ) {
            if ( !getentityproperty(opp,"flash","noattack") ) {
                show_flash(); // Il flash è in mostra?? Se no allora eseguilo.
                playsample(loadsample("data/sounds/punch004.wav"));
            }
        } else {
            if ( getentityproperty(self,"flash","block") ) {
                show_block_flash();
                playsample(loadsample("data/sounds/punch003.wav"));
            }
        }

	}
  }
}
 
your idea is good 'O but is strict dependent by sprites.
with my code the file size is small and I can handle the launcher in any way.
However I can adapt your idea for foot soldier with hook.
good work however!
 
Rock!

ps: in attachment; Funny! Verycool test :D

[attachment deleted by admin]
 
stin said:
Rock!

ps: in attachment; Funny! Verycool test :D

hihi wait for next release 5762, I fixed that bug yet =)

magggas said:
O Ilusionista said:
are you sure? I think its like 10 lines of code or less versus 600 lines.
but its up to you :)

600 lines i don´t think is a problem for White Dragon, since i think he is not even a human being. Looking to he's codes he must be for sure an computer  ;D

White Dragon thanks for the demo, lets give it a try  ;D

ahahah thanks =)
 
BeasTie said:
@WD - if you play the surfing stage and then start a new game in arcade, you will spawn with the surf board.
stin said:
Rock!

ps: in attachment; Funny! Verycool test :D

Hehe... this is because teh Turtles used a DeLorean to go back from the future! ;D ;D ;D
 
to White Dragon :)
here's the foot i test them in game(( i hope you add them White Dragon))
to test the foot out un zip the pak and drop this in the foot folder.
there cool i just want to share or i can just make a mod for myself :(

ps the bo staff may need sume codeing......thanks i hope you add thim

http://www.mediafire.com/download/zs1941qd71ka24s/new+foot+3.rar

[attachment deleted by admin]
 
Back
Top Bottom