question about custbomb

BurnKing

Member
hey brothers been forever hope youre all doing good.

i have an openbor question, im setting up a death anim that would spawn the creatures head as a custbomb and fire it off, ive loaded all the info for the alternatepals but it always only throws the head as the original map, how would i change that?
 
Hey BurnKing your avatar reminds me of Lavalit lol


So you could try adding this before your heads first animation frame


Code:
@script

void self = getlocalvar("self");
if(frame==0){


changeentityproperty(self, "map", 1);


}
@end_script


I have not tested but it should work just replace the 1 with the remap you want.
 
well you could spawn the head with a custom name for different attacks line like:


spawn  head
alias ANI_ATTACK2
coords  150 280
at      0


and have my above code before each attacks first frame.


add this line before the first fame of spawn:


@cmd anichange getentityproperty(getlocalvar("self") "name")


you can change the name later by code if you need to. Oh and if you need a code to spawn with alias.



Code:
void spawn02(void vName, float fX, float fY, float fZ, void Alias)
{
	//spawn02 (Generic spawner with alias)
	//Spawns entity next to caller.
	//vName: Model name of entity to be spawned in.
	//fX: X location adjustment.
	//fZ: Y location adjustment.
        //fY: 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.
    	changeentityproperty(vSpawn, "name", Alias); //Set Alias to spawned entity
	return vSpawn; //Return spawn.
}
 
Glad to see you around Burnking.
About color swap for element, I think JonSilva used similar script for some of his enemies slams (in Southtown mod) The enemies based on Hugo have some body parts in alternate layer with palette checking or something during it.
anyway, good luck!
 
if all 3 remaps are the exact same enemy you need a custom spawn code that matches the parents map to the spawned head ilu posted something like this i can think how to do this right now try searching for map scripts i am sure you ill find what your looking for.
 
Hi Burnking, long time no see :)

For spawning entity with same palette as spawner, I usually use this spawnM function:

Code:
void spawnM(void Name, float dx, float dy, float dz)
{ // Spawn certain entity and matches its map with own's map
   void self = getlocalvar("self");
   int map = getentityproperty(self,"map");
   void Spawn;

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

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.
}

However, your tossed head shouldn't be set like a bomb IOW just set it like regular entity like this:
name Durian
type none
gfxshadow 1
no_adjust_base 0
subject_to_hole 1
subject_to_wall 1
bounce 1
candamage enemy obstacle


anim spawn
@script
    if(frame==22){
      void self = getlocalvar("self");
      killentity(self);
    }
@end_script
loop 1 1 9
delay 10
offset 35 35
landframe 12
bouncefactor 2
attack 5 5 56 56 16 1
frame data/chars/monkeyboy/fruits/durian1.png
frame data/chars/monkeyboy/fruits/durian2.png
frame data/chars/monkeyboy/fruits/durian3.png
frame data/chars/monkeyboy/fruits/durian4.png
frame data/chars/monkeyboy/fruits/durian5.png
frame data/chars/monkeyboy/fruits/durian6.png
frame data/chars/monkeyboy/fruits/durian7.png
frame data/chars/monkeyboy/fruits/durian8.png #
frame data/chars/monkeyboy/fruits/durian1.png
frame data/chars/monkeyboy/fruits/durian2.png
frame data/chars/monkeyboy/fruits/durian3.png
frame data/chars/monkeyboy/fruits/durian4.png
attack 0
offset 35 50
frame data/chars/monkeyboy/fruits/durian1.png
frame data/chars/monkeyboy/fruits/durian2.png
frame data/chars/monkeyboy/fruits/durian3.png
frame data/chars/monkeyboy/fruits/durian4.png
frame data/chars/monkeyboy/fruits/durian5.png
frame data/chars/monkeyboy/fruits/durian6.png
frame data/chars/monkeyboy/fruits/durian7.png
frame data/chars/monkeyboy/fruits/durian8.png #
frame data/chars/misc/empty.gif
frame data/chars/misc/empty.gif

This Durian has no ATTACK1 nor ATTACK2 animation
Your tossed head doesn't have to copy this, this is just example of entity which can be tossed and bounces on landing
 
glad to see all you guys again too, im a bit rusty, how do i implement that script to the char, i made a script of it and labelled in his header script and location but now when its time to throw the head it says there is  an exception in changeentity script....
 
here


Release game data............ Done!
Release timer................ Done!
Release input hardware....... Done!
Release sound system......... Done!

**************** Done *****************

There's an exception while executing script 'updateentityscript'.


####animationscript function main#####
# data/chars/misc/blood2.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animnum = getlocalvar("animnum");
    if(animnum==8)
    {
        if(frame==0)
        {
            velo001(-2, 0, 0);

        }
        return;
    }

}

####animationscript function main#####
# data/chars/Vehelits/origin.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animnum = getlocalvar("animnum");
    if(animnum==0)
    {
        if(frame==0)
        {
            suicidePar();

        }
        if(frame==0)
        {
            mapPar();

        }
        if(frame==1)
        {
            suicidePar();

        }
        if(frame==1)
        {
            mapPar();

        }
        return;
    }
    if(animnum==23)
    {
        if(frame==1)
        {
            suicide();

        }
        return;
    }
    if(animnum==5)
    {
        if(frame==0)
        {
            stop();

        }
        if(frame==1)
        {
            beidle();

        }
        return;
    }

}

####animationscript function main#####
# data/chars/Vehelits/neck.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animnum = getlocalvar("animnum");
    if(animnum==0)
    {
        if(frame==0)
        {
            suicidePar();

        }
        if(frame==0)
        {
            mapPar();

        }
        if(frame==0)
        {
            telechain();

        }
        if(frame==1)
        {
            suicidePar();

        }
        if(frame==1)
        {
            mapPar();

        }
        if(frame==1)
        {
            telechain();

        }
        return;
    }
    if(animnum==23)
    {
        if(frame==0)
        {
            degravity(0);

        }
        if(frame==1)
        {
            suicide();

        }
        return;
    }
    if(animnum==5)
    {
        if(frame==0)
        {
            stop();

        }
        if(frame==1)
        {
            beidle();

        }
        return;
    }

}

####animationscript function main#####
# data/chars/Vehelits/Vehelits.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animnum = getlocalvar("animnum");
    if(animnum==22)
    {
        if(frame==1)
        {
            spawnChainPoint("Origin", 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("Neck", 0.875, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("Neck", 0.75, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("Neck", 0.625, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("Neck", 0.5, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("Neck", 0.375, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("Neck", 0.25, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("Neck", 0.125, 0, 0, 0);

        }
        if(frame==3)
        {
            anichange("ANI_FOLLOW1");

        }
        return;
    }
    if(animnum==81)
    {
        if(frame==1)
        {
            attack1(-160, 0, 0, 70, "ANI_FOLLOW2");

        }
        return;
    }
    if(animnum==23)
    {
        if(frame==2)
        {
            suicide();

        }
        return;
    }
    if(animnum==69)
    {
        if(frame==0)
        {
            dasher(-4, 0, 0);

        }
        if(frame==1)
        {
            stop();

        }
        return;
    }
    if(animnum==5)
    {
        if(frame==0)
        {
            dasher(-4, 0, 0);

        }
        if(frame==1)
        {
            stop();

        }
        if(frame==2)
        {
            beidle();

        }
        return;
    }

}

####animationscript function main#####
# data/chars/Vehelits/rorigin.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animnum = getlocalvar("animnum");
    if(animnum==0)
    {
        if(frame==0)
        {
            suicidePar();

        }
        if(frame==0)
        {
            mapPar();

        }
        if(frame==1)
        {
            suicidePar();

        }
        if(frame==1)
        {
            mapPar();

        }
        return;
    }
    if(animnum==23)
    {
        if(frame==1)
        {
            suicide();

        }
        return;
    }
    if(animnum==5)
    {
        if(frame==0)
        {
            stop();

        }
        if(frame==1)
        {
            beidle();

        }
        return;
    }

}

####animationscript function main#####
# data/chars/Vehelits/robobody.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animnum = getlocalvar("animnum");
    if(animnum==0)
    {
        if(frame==0)
        {
            suicidePar();

        }
        if(frame==0)
        {
            mapPar();

        }
        if(frame==0)
        {
            telechain();

        }
        if(frame==1)
        {
            suicidePar();

        }
        if(frame==1)
        {
            mapPar();

        }
        if(frame==1)
        {
            telechain();

        }
        return;
    }
    if(animnum==23)
    {
        if(frame==0)
        {
            degravity(0);

        }
        if(frame==1)
        {
            suicide();

        }
        return;
    }
    if(animnum==5)
    {
        if(frame==0)
        {
            stop();

        }
        if(frame==1)
        {
            beidle();

        }
        return;
    }

}

####animationscript function main#####
# data/chars/Vehelits/robo.txt
########################################
void main()
{
    int frame = getlocalvar("frame");
    int animnum = getlocalvar("animnum");
    if(animnum==22)
    {
        if(frame==1)
        {
            spawnChainPoint("rorigin", 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("robobody", 0.875, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("robobody", 0.75, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("robobody", 0.625, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("robobody", 0.5, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("robobody", 0.375, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("robobody", 0.25, 0, 0, 0);

        }
        if(frame==2)
        {
            spawnChainLink("robobody", 0.125, 0, 0, 0);

        }
        if(frame==3)
        {
            anichange("ANI_FOLLOW1");

        }
        return;
    }
    if(animnum==81)
    {
        if(frame==1)
        {
            attack1(-160, 0, 0, 70, "ANI_FOLLOW2");

        }
        return;
    }
    if(animnum==23)
    {
        if(frame==2)
        {
            suicide();

        }
        return;
    }
    if(animnum==4)
    {
        if(frame==0)
        {
            dasher(-4, 0, 0);

        }
        if(frame==1)
        {
            stop();

        }
        return;
    }
    if(animnum==69)
    {
        if(frame==0)
        {
            dasher(-4, 0, 0);

        }
        if(frame==1)
        {
            stop();

        }
        return;
    }
    if(animnum==5)
    {
        if(frame==0)
        {
            dasher(-4, 0, 0);

        }
        if(frame==1)
        {
            stop();

        }
        if(frame==2)
        {
            beidle();

        }
        return;
    }

}

 
to be clear, ive just copy pasted the script bloodbane wrote, am i meant to input names in that code in specific places? sorry but scripts have always been the part i understood the least.
 
The spawnm fuction should be saved as a txt file and renamed to spawnm.c then declare it with animationscript in characters header

Then spawn in death animation with @cmd spawnm name x y z
 
Let me confirm couple things:
1. Do you have animation script containing at least two functions I posted above?
2. Have you declared that animationscript in entity's header?
3. How exactly you declare the function?
 
i copy pasted the script you posted into a text and named it spawnm.c loaded it as animationscript data/script/spawnm.c and then in the death i wrote @cmd spawnm head. log says cant compile script.
 
Back
Top Bottom