maxman
Well-known member
I know using spawnframe and custentity works well with this kind in onspawnscript. This works for some (e.g. UDD, because of the specific engine used that works?), but it doesn't work for others (including my SF project, because I use one of the older versions for it?).
It doesn't work on mine, but I want it to spawn its shared palette based on the parent/source entity itself. spawn01map works well, but what I really want is to spawn it directly (counting) as a screen offset like the 5th parameter as 1 in spawnframe. It works like spawning Hadoken with specified palette.
I tried these with the same shared palettes but spawning one doesn't share the same colors (custentity-spawnframe). Let alone being only shown with the default palette.
This is spawn01map:
What I'm trying to make is for it to spawn like using spawnframe and custentity by counting screen offset but spawning one entity which shares the same color palette as the player. How can I do it? I can't use spawnframe and custentity/subentity for this.
C:
void main(){
changePalette();
}
void changePalette(){
void self = getlocalvar("self");
void parent = getentityproperty(self, "parent");
int Pmap = getentityproperty(parent, "map");
if(Pmap){
changeentityproperty(self, "map", Pmap);
}
}
It doesn't work on mine, but I want it to spawn its shared palette based on the parent/source entity itself. spawn01map works well, but what I really want is to spawn it directly (counting) as a screen offset like the 5th parameter as 1 in spawnframe. It works like spawning Hadoken with specified palette.
I tried these with the same shared palettes but spawning one doesn't share the same colors (custentity-spawnframe). Let alone being only shown with the default palette.
Code:
name ARyu
type player
health 100
speed 14
icon data/chars/aryu/ryu.png 1
palette data/chars/aryu/pal.png
alternatepal data/chars/aryu/palettes/alt01.png
alternatepal data/chars/aryu/palettes/alt02.png
alternatepal data/chars/aryu/palettes/alt03.png
alternatepal data/chars/aryu/palettes/alt04.png
alternatepal data/chars/aryu/palettes/alt05.png
alternatepal data/chars/aryu/palettes/alt06.png
alternatepal data/chars/aryu/palettes/alt07.png
Code:
anim follow15 #YOU LOSE!
offset 97 177
delay 9
#spawnframe 6 91 182 0 1
#custentity ARyuCont
frame data/CHARS/ARyu/loss01.png
frame data/CHARS/ARyu/loss02.png
frame data/CHARS/ARyu/loss03.png
frame data/CHARS/ARyu/loss04.png
frame data/CHARS/ARyu/loss05.png
delay 339
frame data/CHARS/ARyu/loss06.png
@cmd suicide
@cmd spawn01map "ARyuCont" 0 0 0
frame data/CHARS/ARyu/loss06.png
Code:
name ARyuCont
type npc
health 10
shadow 0
speed 10
nomove 1
antigravity 100
death 1
nopain 1
facing 1
subject_to_minz 0
subject_to_maxz 0
subject_to_wall 0
subject_to_platform 0
subject_to_obstacle 0
nodieblink 2
palette data/chars/aryu/pal.png
alternatepal data/chars/aryu/palettes/alt01.png
alternatepal data/chars/aryu/palettes/alt02.png
alternatepal data/chars/aryu/palettes/alt03.png
alternatepal data/chars/aryu/palettes/alt04.png
alternatepal data/chars/aryu/palettes/alt05.png
alternatepal data/chars/aryu/palettes/alt06.png
alternatepal data/chars/aryu/palettes/alt07.png
Code:
anim idle
loop 1
offset 97 177
delay 30
bbox 74 81 40 96
frame data/CHARS/ARyu/dizzy00.png
frame data/CHARS/ARyu/dizzy01.png
frame data/CHARS/ARyu/dizzy02.png
frame data/CHARS/ARyu/dizzy03.png
frame data/CHARS/ARyu/dizzy04.png
frame data/CHARS/ARyu/dizzy05.png
This is spawn01map:
C:
void spawn01map(void vName, float fX, float fY, float fZ)
{
//spawn01 (Generic spawner)
//Damon Vaughn Caskey + Douglas Baldan
//07/06/2007
//
//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.
int iMap = getentityproperty(self, "map"); // Get caller's remap.
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, "map", iMap); //Set map.
return vSpawn; //Return spawn.
}
What I'm trying to make is for it to spawn like using spawnframe and custentity by counting screen offset but spawning one entity which shares the same color palette as the player. How can I do it? I can't use spawnframe and custentity/subentity for this.