How do you guys use spawnframe more than once ?

PS_VITA

Active member
How do you guys use spawnframe more than once , say while performing an attack,  death or follow anim?

For example imagine that I wanted
An enemy to summon an ice spell and a fire spell using anim attack during the first  and second frame.

Or is spawnframe limited to only be used once per animation category?

I hope I'm explaining myself correctly.
 
The answer to the topic is no. We don't use spawnframe more than once cause it only spawn once.

That's why we use script to spawn entities or shoot projectiles in single animation.

Are you using animation script with any spawning function in it? if yes, I could show some examples.
 
Back before script, there were tricks to spawn more than one item per animation, using the different shot commands. This was still very limited and awkward as each spawn command has different behaviors, and still only gave a couple more at most. There was also the Daisy Chain technique by yours truly. Each spawn spawns something else in a chain. Less limited, but extremely messy because each spawn is its own model. Essentially, it's a giant script built with unique models instead of code.

In this old demo of mine from ~2006, the dog and magic are all done without script by spawning some invisible projectile, that spawned something else, that spawned something else and so on. It was a MESS and took tons of trial and error to get working right. These days you can do any of it in ten minutes with four or five lines of script.


I'm just mentioning these for posterity. They're all outdated and not worth attempting. See also: That's why we have script. :)

DC

PS: Anyone remember all the arbitrary limitations we had back then? Just a few highlights were 4 attack types, 4 follow animations, 32 frames per animation, 50 models total IIRC, 3 layers, one universal 256 color palette, and the engine didn't reuse sprites. Pretty much anything you wanted to do required a crazy hack-around that usually broke all your other hack-arounds, and we still thought it was a huge advancement over previous versions. Those were the days, lol.
 
Oh nice this is news to me it should be noted on spawnframe and summonframe too. Something to change velocity and animation on a frame to frame basis that should be enough for someone to use the engine without needing any scripts and they could still make a very good game.
 
Bloodbane said:
The answer to the topic is no. We don't use spawnframe more than once cause it only spawn once.

That's why we use script to spawn entities or shoot projectiles in single animation.

Are you using animation script with any spawning function in it? if yes, I could show some examples.




Nothing special I suppose - here's the code
where I tried to spawnframe the same entity twice but in different frames.

Code:
anim fall
	loop	0
	offset	77 170
       spawnframe 7 -60 0 55 0
       custentity hobstacles
      spawnframe 5 -60 0 55 0
       custentity hobstacles
bbox	10 85 90 80
	delay   8
      landframe 7
      @cmd    degravity -0.15
      @cmd bind 0 0 0 0 0
      @cmd    depost 0
	frame	data/chars/williams2/fall06a.gif
      frame	data/chars/williams2/fall06a.gif
      delay   10
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
      frame	data/chars/williams2/fall01.gif
      frame	data/chars/williams2/fall01.gif
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
      frame	data/chars/williams2/fall01.gif
      delay   20
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
      frame	data/chars/williams2/fall02.gif
      delay   500
      frame	data/chars/williams2/fall02.gif
bbox	0 0 0 0
      delay   8
      sound	data/sounds/falll.wav
	frame	data/chars/williams2/fall02.gif
	frame	data/chars/williams2/rise0.gif
      delay   2
      @cmd    anichange "ANI_FOLLOW80"
      frame	data/chars/williams2/rise0.gif

could anyone modify the code and let me see how this looks with projectile instead of spawnframe?



 
Well, looking at posted animation, I can see that you are using animation script. I'm just going to assume that it has spawning script in it. Here's how it should be with spawn scripts:
Code:
anim fall
	offset	77 170
	bbox	10 85 90 80
	delay   8
      landframe 7
      @cmd    degravity -0.15
      @cmd bind 0 0 0 0 0
      @cmd    depost 0
	frame	data/chars/williams2/fall06a.gif
      frame	data/chars/williams2/fall06a.gif
      delay   10
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
      frame	data/chars/williams2/fall01.gif
      frame	data/chars/williams2/fall01.gif
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
      frame	data/chars/williams2/fall01.gif
      delay   20
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
	@cmd	spawn01 "hobstacles" -60 55 0
      frame	data/chars/williams2/fall02.gif
      delay   500
      frame	data/chars/williams2/fall02.gif
bbox	0 0 0 0
      delay   8
      sound	data/sounds/falll.wav
	@cmd	spawn01 "hobstacles" -60 55 0
	frame	data/chars/williams2/fall02.gif
	frame	data/chars/williams2/rise0.gif
      delay   2
      @cmd    anichange "ANI_FOLLOW80"
      frame	data/chars/williams2/rise0.gif

Just a minute, this animation doesn't have attackboxes in it. Did you remove them or there was none ?
 
Bloodbane said:
Well, looking at posted animation, I can see that you are using animation script. I'm just going to assume that it has spawning script in it. Here's how it should be with spawn scripts:
Code:
anim fall
	offset	77 170
	bbox	10 85 90 80
	delay   8
      landframe 7
      @cmd    degravity -0.15
      @cmd bind 0 0 0 0 0
      @cmd    depost 0
	frame	data/chars/williams2/fall06a.gif
      frame	data/chars/williams2/fall06a.gif
      delay   10
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
      frame	data/chars/williams2/fall01.gif
      frame	data/chars/williams2/fall01.gif
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
      frame	data/chars/williams2/fall01.gif
      delay   20
      @cmd    antiwall4 -20 "ANI_FOLLOW37"
	@cmd	spawn01 "hobstacles" -60 55 0
      frame	data/chars/williams2/fall02.gif
      delay   500
      frame	data/chars/williams2/fall02.gif
bbox	0 0 0 0
      delay   8
      sound	data/sounds/falll.wav
	@cmd	spawn01 "hobstacles" -60 55 0
	frame	data/chars/williams2/fall02.gif
	frame	data/chars/williams2/rise0.gif
      delay   2
      @cmd    anichange "ANI_FOLLOW80"
      frame	data/chars/williams2/rise0.gif

Just a minute, this animation doesn't have attackboxes in it. Did you remove them or there was none ?

The example in the OP
Is not related to the actual code that I wanted to modify... I'm trying to spawn 2 "hobstacles" entities.  Hey Bloodbane thanks for modifying my code , I'm going to give it a try later and see how it goes.
 
How can I spawnframe or (whatever) an enemy with a specific  map color?
Say you break a box and an enemy pops from this box . How would I code the game to choose say map4 for that enemy?
 
You'd need to code special function for that, like this:
Code:
void spawnMap(void Name, float dx, float dy, float dz, int Map)
{ // Spawn a entity and defines its map
   void self = getlocalvar("self");
   void Spawn;

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

Copy this function into animationscript you are using.

Declare it in similar way as spawn01 function but don't forget to define the extra parameter. Ex:
@cmd spawnMap "Enemy" 0 0 0 4
 
Bloodbane said:
You'd need to code special function for that, like this:
Code:
void spawnMap(void Name, float dx, float dy, float dz, int Map)
{ // Spawn a entity and defines its map
   void self = getlocalvar("self");
   void Spawn;

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

Copy this function into animationscript you are using.

Declare it in similar way as spawn01 function but don't forget to define the extra parameter. Ex:
@cmd spawnMap "Enemy" 0 0 0 4

Thanks,

This worked Bloodbane
, except you capitalized the word "Map" and I had fix that.


O Ilusionista said:
The native function "projectile" can do the same, take a look at the manual.

Yeah, I tried to use it  but I couldn't figure out how to make it work.

You mentioned it's a native function, but when I used it for anim follow  it wont work like other natvie functions,  such as spawnframe, attackone, bbox, landframe, ect.

 
What O Ilusionista means is that it's a native script function. The @cmd tag calls script functions. They can be ones you created yourself, or that are already included in the script engine (i.e. native). Projectile is a native script function.

DC
 
Damon Caskey said:
What O Ilusionista means is that it's a native script function. The @cmd tag calls script functions. They can be ones you created yourself, or that are already included in the script engine (i.e. native). Projectile is a native script function.

DC

I looked for the word projectile in all of the scripts by using note pad++ and I could not  any scripts related to that.

So that's why I gave up on using @cmd projectile

Now, I did find a script called shooter2 , which I then modified it to include @bloodbanes int map , so I was able to multple spawn entities,  give them velocity,  and assign a color map if I chose to do so.

But, no I don't know what the projectile script looks like or where to even put it.
 
PS VITA said:
I looked for the word projectile in all of the scripts by using note pad++ and I could not  any scripts related to that.
So that's why I gave up on using @cmd projectile
Err.. I told you to look at the manual :)
https://dcemulation.org/index.php?title=OpenBORManual#Engine_defined_functions_.28Native_functions.29
 
O Ilusionista said:
PS VITA said:
I looked for the word projectile in all of the scripts by using note pad++ and I could not  any scripts related to that.
So that's why I gave up on using @cmd projectile
Err.. I told you to look at the manual :)
https://dcemulation.org/index.php?title=OpenBORManual#Engine_defined_functions_.28Native_functions.29

Damn it!
I will double check again but I'm not sure if the manual PDF I downloaded  had this excerpt

"@cmd projectile 0 "nameoftheprojectile" 20 1 30 0 0 0"

I will try this again, cool and thanks
 
Back
Top Bottom