MysticalMist
Active member
I have a character whom uses a special move that's essentially the blinding light move from Orochi (KOF). The light animaton is spawned in the form of a panel. Pretty straight forward stuff.
However, when the panel is spawned using this spawn05 code below, it works when the player is facing one direction, but in the other, it is not visible (and if so, maybe for like a frame or two at most).
I have text entities that rely on spawn05 that also take up the screen. The problem is that they also struggle with the same thing. I know it has something to do with the fact it's based on the left part of the screen, but all I want is to be able to spawn either a text or panel entity on a fixed position of the screen, regardless of the player's direction.
Code:
name lightattack
health 0
type panel
speed 10
alpha 1
setlayer 255
lifespan 15
However, when the panel is spawned using this spawn05 code below, it works when the player is facing one direction, but in the other, it is not visible (and if so, maybe for like a frame or two at most).
Code:
void spawn05(void vName, float fX, float fY, float fZ)
{
//Spawns entity based on left screen edge and z axis
//
//vName: Model name of entity to be spawned in.
//fX: X distance relative to left edge
//fY: Y height from ground
//fZ: Z coordinate
void self = getlocalvar("self"); //Get calling entity.
void vSpawn; //Spawn object.
int Direction = getentityproperty(self, "direction");
int XPos = openborvariant("xpos"); //Get screen edge's position
int Screen = openborvariant("hResolution"); // Get screen width
clearspawnentry(); //Clear current spawn entry.
setspawnentry("name", vName); //Acquire spawn entity by name.
if (Direction == 0){ //Is entity facing left?
fX = Screen-fX; //Reverse X direction to match facing and screen length
}
vSpawn = spawn(); //Spawn in entity.
changeentityproperty(vSpawn, "position", fX + XPos, fZ, fY); //Set spawn location.
return vSpawn; //Return spawn
}
I have text entities that rely on spawn05 that also take up the screen. The problem is that they also struggle with the same thing. I know it has something to do with the fact it's based on the left part of the screen, but all I want is to be able to spawn either a text or panel entity on a fixed position of the screen, regardless of the player's direction.
Last edited: