spawn moving objects

Gurtag

Active member
hello ppl, i still working an a outoscroll/riding level and use an entity to spawn anotter on diferent follows using spawnani script, been the follows diferent kind of objects and obstacles, however i am having problems making the entity move along with scrolling floor, the thing is, jumpframe and move commands work but in a very unreliable way and it gets worse if you spawn several entitys, if there is only one entity on screen it usually moves as intended, but if number increases they start to stuter moving at diferent rates.
is there a way to solve or workaround this issue?
 
Have you tried to set velocity to to spawned objects IOW shoot them?

That's what I do when creating shape spawners for Rainbow. Shapes are simply shot by the spawner and the former will remove themselves if they goes offscreen left.
 
yea the thing is i dont want to make a projectile for every obstacle i spawn, using a type enemy entity and it´s many follows gives versatility and save space on models ;p the thing is i cant find a way to make tose follows anim move reliably.
is there a spawnAni script that can spawn entities at set velocity?
 
You don't have to set projectile type for shot entities.

is there a spawnAni script that can spawn entities at set velocity?

You can modify the function to apply velocities. If you want to keep the original, make clone of spawnAni function and have that clone apply velocities.
 
Bloodbane said:
You don't have to set projectile type for shot entities.

is there a spawnAni script that can spawn entities at set velocity?

You can modify the function to apply velocities. If you want to keep the original, make clone of spawnAni function and have that clone apply velocities.

tryed this one ilu shared time ago and it works, but it shows the same erratic behabior.

Code:
void spawnAnisp(void vName, float fX, float fY, float fZ, void Ani, float Vx, float Vy, float Vz)
{
	//spawnB (Generic spawner) + Specific animation + velocities
	//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.
	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.
    performattack(vSpawn, openborconstant(Ani)); 
	changeentityproperty(vSpawn, "velocity", Vx, Vy, Vz);

	return vSpawn; //Return spawn.
}

chek this video about the midle to see what i mean, it like obstacles comes fine and then they push the brakes lol

 
That happens exactly the same when I go back to the left edge of the screen in one of my games (Art of Fighting: Trouble in Southtown). This is because it reflects the speed at which the car is going. If you go back, it slows down. If you advance, it goes faster. I don't know if it will be programmed the same there.
 
Bloodbane said:
Oh I thought you deliberately pull the brake briefly at middle of video  :o

That's strange  ???, you sure the "brake" comes from spawning obstacles?
Toranks said:
That happens exactly the same when I go back to the left edge of the screen in one of my games (Art of Fighting: Trouble in Southtown). This is because it reflects the speed at which the car is going. If you go back, it slows down. If you advance, it goes faster. I don't know if it will be programmed the same there.

it hapens when idle too so i think it is just random, could be the engine unable to process so many objects  been spawn by script? i think i remember ilu mentioning something about script microloading once though dont know if that is the case.
 
The only way I was able to get rid of the stutter/shake/slow down was to turn the spawned object into a stage panel (fglayer) and make the interaction and invisible entity but it was just for 1 interaction really early on in the stage, not sure what to do for multiples.

Fglayer spawing script maybe
 
danno said:
The only way I was able to get rid of the stutter/shake/slow down was to turn the spawned object into a stage panel (fglayer) and make the interaction and invisible entity but it was just for 1 interaction really early on in the stage, not sure what to do for multiples.

Fglayer spawing script maybe

that sound quite trycky but i am frustrated with this bug, how could you interact with a fglayer?
 
Gurtag said:

Gurtag & danno

There are nowhere near enough objects there to slow down the engine unless it's a really weak platform. I think there's something else going on. Not sure what off the top of my head though. If it were me, I'd start removing small bits until the slowdown went away, and that might narrow down the cause.

DC
 
Damon Caskey said:
Gurtag said:

Gurtag & danno

There are nowhere near enough objects there to slow down the engine unless it's a really weak platform. I think there's something else going on. Not sure what off the top of my head though. If it were me, I'd start removing small bits until the slowdown went away, and that might narrow down the cause.

DC

my pc runs the game at 100fps or more most of the time so i dont belive that is the case, for the most part have tryed several ways, "move" "@cmdmove" "jumpframe" and the result is allways the same, only way to work around it so far is faking movement with offset and seting move command but on intervals that way doesnt get overloaded.
example of what i mean:

stuter anim:
anim follow1
loop 1
delay 1
move 6
offset 100 145
frame data/chars/misc/obstac24.gif
frame data/chars/misc/obstac24.gif
frame data/chars/misc/obstac24.gif
frame data/chars/misc/obstac24.gif

work around anim.
anim follow1
loop 1
delay 1
move 24
offset 100 145
frame data/chars/misc/obstac24.gif
move 0
offset 94 145
frame data/chars/misc/obstac24.gif
offset 88 145
frame data/chars/misc/obstac24.gif
offset 82 145
frame data/chars/misc/obstac24.gif



Bloodbane said:
BTW Gurtag, have you set offscreenkill to moving obstacles to ensure they are removed after leaving screen?

sure man, i set it to 900 also lifespan  3
 
Back
Top Bottom