Alternate Spawn Animations

mersox

Active member
Can it be done? Can you have more than one spawn animation and specify which one to use and when in the level's txt file?
 
There is only one SPAWN and RESPAWN animation. You can certainly make more, but will have to use script to do so.

DC
 
Mersox, to define alternate SPAWN animations, you can use FOLLOW animations.
Don't forget to extend number of follow animations with maxfollows command in models.txt if you need many alternate spawn animations.
 
Hi Bloodbane, thank for replying.

I'm very confused. According to the manual, follow{#} plays if a character is hit during a specific frame, which is not what I'm looking for.

I performed a search and found another topic in which you propose a script to activate an alternate spawn:

spawn Galsia
@script
void main()
{
    void self = getlocalvar("self");
    changeentityproperty(self, "animation", openborconstant("ANI_FOLLOW1"));
}
@end_script
map  1
coords  680 464
at  50

So I tried it with an enemy char of mine. I created a follow1 animation, and added "maxfollows 1" to models.txt. When I ran Openbor it just ignored the script, the character spawned as usual.

:S

I also tried the script you proposed for use with players:
spawn  empty
@script
void main()
{
    int P1 = getplayerproperty(0, "entity");
    int P2 = getplayerproperty(1, "entity");

    if(P1){
      changeentityproperty(P1, "animation", openborconstant("ANI_FOLLOW1"));
    }
    if(P2){
      changeentityproperty(P2, "animation", openborconstant("ANI_FOLLOW1"));
    }
}
@end_script

This time Openbor crashed when loading the stage, and the log says:
Fatal: No cache entry for 'empty' within 'data/levels/cityday.txt'

Je suis dumb :S
 
So I tried it with an enemy char of mine. I created a follow1 animation, and added "maxfollows 1" to models.txt. When I ran Openbor it just ignored the script, the character spawned as usual.
before continuing, set it to maxfollows 10, for example
 
mersox said:
I'm very confused. According to the manual, follow{#} plays if a character is hit during a specific frame, which is not what I'm looking for.

Don't worry about this. What that means is that FOLLOW# is activated by the follow command, which you can put into certain animations. It was originally meant so that if an attack hit something and had follow # set, FOLLOW# would play. It was the closest thing the engine had to conditional logic before script came along.

These days FOLLOW# is the de facto choice for animations triggered by script. This concept was pioneered by yours truly several years ago, but it isn't rocket science as to why:

  • As mentioned above they are never used by the engine unless the module author specifically sets up one to play through follow conditions (or script of course).
  • They don't require or trigger any special conditions/status.
  • You can have as many of them as you want.

DC
 
Sorry, I was going to reply this yesterday but I felt asleep, lol

So I tried it with an enemy char of mine. I created a follow1 animation, and added "maxfollows 1
As DIF said, this is wrong. If you set maxfollows as 1, you will be able to use just ONE follow. Set it like maxfollows 10, which will let you use 10.

This is how I use
spawn Gunner
alias Gunner
@script void main() {
  performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW1"));
} @end_script
coords 400 165
map 1
at 200

Gunner always perform the FOLLOW 1 anim with that, even if he has a spawn anim. I can't remember if is the case, but some codes needs to come before the AT. If I am not wrong, if you put the MAP 1 bellow de AT, the engine will ignore it.

Fatal: No cache entry for 'empty' within 'data/levels/cityday.txt'

No cache entry means that an entity wasn't loaded on the memory. Again, if I am not wrong, you need to LOAD the entity on the models.txt and not KNOW only, or the engine won't recognize it.

You can put KNOW on the models.txt and put a LOAD on the stage header. Utunnels said something about this on other topic: http://www.chronocrash.com/forum/index.php?topic=402.msg2813#msg2813

utunnels said:
Another hint is use load switch in a level. For example:

load Effect1 3
load Effect2 3
....


After this level, the model will be unloaded as well as its sprites. This is useful when you spawn level specific boss character or  anmated panels/visual effects.

but I don't know What the value after the name means? Can someone explain what each value does?
So I can update the manual.

load "entity_name" 0 # -> load entity for any level
load "entity_name" 1 # -> load entity for current level only

but other? 2 flag? differences between 1 and 3?
 
Thanks guys for replying. I still don't know how to implement this, though.

O Ilusionista said:
This is how I use
spawn Gunner
alias Gunner
@script void main() {
  performattack(getlocalvar("self"), openborconstant("ANI_FOLLOW1"));
} @end_script
coords 400 165
map 1
at 200

Gunner always perform the FOLLOW 1 anim with that, even if he has a spawn anim. I can't remember if is the case, but some codes needs to come before the AT. If I am not wrong, if you put the MAP 1 bellow de AT, the engine will ignore it.

I tried that, and again nothing happened. Spawned as usual. Maybe it's the version of openbor I'm using? I'm using Darwin as I use a Mac.


No cache entry means that an entity wasn't loaded on the memory. Again, if I am not wrong, you need to LOAD the entity on the models.txt and not KNOW only, or the engine won't recognize it.

That part I know, what I don't understand is the "empty" entity. What is it supposed to be? A char? What is its .txt supposed to contain? I have no idea, I just copied Bloodbanes' script.
 
Maybe it's the version of openbor I'm using? I'm using Darwin as I use a Mac.
hum, so maybe its your BOR version.

Fatal: No cache entry for 'empty' within 'data/levels/cityday.txt'

The engine is tryind to load the entity called EMPTY at the stage "cityday.txt". You need to remove the entity from the stage (if you don't have it) or load it at the models.txt
 
About using empty entity, it's just one way to set level scripts in a level. It's not a must to use that entity. You can define the script in other entity you spawned at 0.

The idea is to have script run as soon as level starts.
 
Thank you. I added the script to a table I had spawning at 0, and nothing. The script was ignored and the player spawned as usual.

I strongly believe it's because I'm using OpenBoR v3.0 Build 3742, which I think is the newest Darwin version. It's dated Dec 7, 2012.
 
I would if I could! I can't find information about Darwin anywhere. It seems that the version I have is the latest. The following builds weren't ported to Mac it seems. There's no love for Mac users. :P

The Parallels Desktop thing is I think too extreme for my slow laptop. Wineskin works but it doesn't let me use my gamepad, so... I'll keep using Darwin.
 
Back
Top Bottom