O Ilusionista
Captain 100K
To not derail the original topic, let me open a new topic @DCurrent .I don't want to derail the conversation, but SortID can be tricky before you get used to it. Can you describe what you did and maybe I can help.
DC
As I was explaining, I have an issue when using many entities on the same z position, as they start to flick.
Take a look on the video below. As far as I can notice, they start to flick once they get hit:
If I am not mistaken, you made this sortID script to me (bundled in the same script that turn boxes into enemies), as a spawnscript():
C-like:
void main()
{
void self = getlocalvar("self");
changeentityproperty(self, "type", openborconstant("TYPE_ENEMY"));
changeentityproperty(self, "velocity", 0, 0, 0);
changeentityproperty(self, "speed", 0);
int i;
for (i = 0; i < openborvariant("count_entities"); ++i)
{
// If we on an odd box, don't do anything.
if(i % 2)
{
continue;
}
void ent = getentity(i);
char name = getentityproperty(ent,"defaultname");
if ( getentityproperty(ent, "exists") && (name == "box"))
{
int sort = getentityproperty(ent,"sortid");
sort++;
changeentityproperty(ent,"sortid", sort);
changeentityproperty(ent,"setlayer",sort);
}
}
}
The stage code, if it helps:
I am using build 6315/6330. Should I move this code to a ondrawscript?music data/music/sentinel_4.ogg
background data/bgs/porto/pceu.gif
water data/bgs/porto/pagua2.gif 3
bglayer data/bgs/porto/porto-shadow.gif 1 0 0 0 0 0 -1 1 1 5 0 0 0 0 0
panel data/bgs/porto/porto-final-new2.gif
type 1 0 1
direction both
settime 30
notime 0
order a
spawn1 0 20 120
spawn2 0 20 160
spawn3 0 60 120
spawn4 0 60 160
light 35 60
at 0
shadowcolor 1
at 0
shadowalpha 6
at 0
spawn hudItem
coords 240 260
at 0
#-------1
spawn empty
@script
void main()
{
int P1 = getplayerproperty(0, "entity");
int P2 = getplayerproperty(1, "entity");
void stageType;
setglobalvar("stageType","bonus");
if(P1){
changeopenborvariant("nojoin", 1);
changeentityproperty(P1, "position", 50,160, 0);
changeentityproperty(P1, "direction", 1); //Face right
changeentityproperty(P1, "animation", openborconstant("ANI_GET"));
}
if(P2){
changeentityproperty(P2, "position", 450,160, 0);
changeentityproperty(P2, "direction", 0); //Face left
changeentityproperty(P2, "animation", openborconstant("ANI_GET"));
}
//changeopenborvariant("gfx_y_offset_adj", -20);
//changeopenborvariant("ypos", 0);
}
@end_script
coords 180 189
at 0
#----------------
spawn textControl
@script void main() {
performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW11"));
} @end_script
coords 240 200 90
flip 1
at 0
#FAKE Miss
spawn afake
@script void main() {
performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW21"));
} @end_script
coords 498 110
at 0
group 1 39
at 0
#------caixas
spawn box
spawnscript data/scripts/enemy.c
coords 150 120
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 185 120
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 220 120
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 255 120
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 290 120
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 325 120
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 360 120
health 120
2phealth 180
at 0
#--------
#------caixas up
spawn box
spawnscript data/scripts/enemy.c
coords 165 121 56
health 120
2phealth 180
item avid
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 200 121 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 235 121 56
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 270 121 56
health 120
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 305 121 56
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 340 121 56
health 120
2phealth 180
at 0
#--------
#------caixas
spawn box
spawnscript data/scripts/enemy.c
coords 150 140
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 185 140
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 220 140
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 255 140
health 120
2phealth 180
item iMP
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 290 140
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 325 140
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 360 140
health 120
2phealth 180
item money
at 0
#--------
#------caixas up
spawn box
spawnscript data/scripts/enemy.c
coords 165 141 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 200 141 56
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 235 141 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 270 141 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 305 141 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 340 141 56
health 120
2phealth 180
at 0
#--------
#------caixas
spawn box
spawnscript data/scripts/enemy.c
coords 150 160
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 185 160
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 220 160
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 255 160
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 290 160
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 325 160
health 120
2phealth 180
item coin
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 360 160
health 120
2phealth 180
item coin
at 0
#--------
#------caixas up
spawn box
spawnscript data/scripts/enemy.c
coords 165 161 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 200 161 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 235 161 56
health 120
2phealth 180
item money
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 270 161 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 305 161 56
health 120
2phealth 180
at 0
spawn box
spawnscript data/scripts/enemy.c
coords 340 161 56
health 120
2phealth 180
item money
at 0
#--------
group 1 1
at 0
spawn delay
health 20
coords 160 200
at 0
spawn textControl
@script void main() {
performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW13"));
} @end_script
coords 240 200 90
flip 1
at 0
Any help is appreciated