Training Lessons

dantedevil

Well-known member
I have the idea of ​​doing a lesson-based training. In order to advance to the next lesson you must fulfill a goal. Like they had some fighting games in training.
To make this possible, I think you would need a script that gives the enemy immunity to all attack animations, except one that we can specify.
I need this script to give the enemy immunity against attack animations and not against certain attacks, since there are many animations that share the same type of attack.
So this way the lesson only can advance when you connect the attack animation.
 
Thanks for the new update my friend!

I try to update my mod with the new system,  but still find some problems.
I send you a PM with a little demo of my Mod, using this system.

You see the next problems:

1) I want avoid the reset in the first lesson (Combo), but I can't.

2) In the Lesson 22 "FINAL.COMBO" (ANI_FOLLOW32), the reset turns on after the combo end. This look very bad. So I don't want the reset when this lesson is successfully.

3) When the Lesson 22 ends, comes the 23 No Mercy. Here the enemy appear with low health (20), this is ok.
But the problem is after the hero execute the No Mercy, then enemy dies and the reset turns on.
This reset only reset the position of the player,  but the enemy still dead.
The reset come really fast for this deaths animation and not look good.
I think the reset would look better, if it runs when the death animation ends. Perhaps the reset could be placed at the end of the enemy's death animations.

After testing the demo I sent you, it will certainly be easier to find the best solution.
 
I continue working on this and after some tests, I came up with an idea that could work very well to avoid reset and everything would look better. The idea would be that when one enemy dies, it spawn another, until all the lessons are finally fulfilled. So just adding the spawn in the end of death animations, that's way all runs ok.
Then after the final Lesson, no more spawn enemies and finish the training.
 
I continue working on the new training and I have been able to solve some problems.

1) I want avoid the reset in the first lesson (Combo), but I can't.
I was able to solve this.

2) In the Lesson 22 "FINAL.COMBO" (ANI_FOLLOW32), the reset turns on after the combo end. This look very bad. So I don't want the reset when this lesson is successfully.
With this I still have problems. Because if I set the script to avoid the reset, the enmigo does not appear with 20 health.

As for the number 3), I use this idea :
The idea would be that when one enemy dies, it spawn another, until all the lessons are finally fulfilled.

I just created a new training stage.
At the top of the screen is a huge pipe, where a new enemy falls when we kill one.

Now the problem comes when I kill an enemy, because the hero executes fatality, but the enemy does not die by executing the fatality animation.
It only rises without energy.
I have tried to change this and I still do not understand it.

For you to understand me better friend (Bloodbane), I sent you the link of a new demo by PM.
Surely there you can better understand each problem.
Thank you for all your help!
 
Well, still testing a lot this new system and now can confirm how can solve the last problem.
I only need this still working until now:
When the Lesson 22 ends, comes the 23 No Mercy. Here the enemy appear with low health (20), this is ok.

No other reset is necessary, because with my system, if the enemy dies for the wrong animation, a new enemy is spawned.

So I try tu update the script to work like this, but I can't.
 
I've figured out a way to spawn new enemy after current one are is killed either with correct fatality or with anything else. Just need to figure out a trick to set immunity against regular attack during fatality lessons
 
Bloodbane said:
I've figured out a way to spawn new enemy after current one are is killed either with correct fatality or with anything else. Just need to figure out a trick to set immunity against regular attack during fatality lessons

I'm glad to know that, my friend!

After studying all the possibilities, I think everything would work well with ywo things:

1) When the Lesson 22 ends, comes the 23 No Mercy. Here the enemy appear with low health (20)

2) I need these animations to let the enemy die normally

22  FATALITY1                  anim follow20
23  FATALITY2                  anim follow42
24  FATALITY3                  anim follow43
25  FATALITY4                  anim follow44
26  Standard Stage Fat.  anim freespecial35

In  all this dead animation of the enemy : No Mercy  and the four fatalities, they actually have the spawn for a new enemy in the last frame.

In the last lesson : 26  Standard Stage Fat.  anim freespecial35
I want use jumptobranch or something like this, to end the training and goes to the menu again.


Ahh and do not forget this:
Bloodbane said:
I'm going to update this further to accept projectiles too :)
 
Bravo, Bravo, Bloodbane !
You did it again, my dear friend!

The last demo you send me works ok. Your works it's wonderful.

There are only a few minor changes and corrections, but the most important thing is already.

1) I see that it still needs to be updated to accept projectiles.

Since these animations do not admit them as correct:

Here Raiden Spawn a ray:
Code:
anim attackbackward
	loop	0
	delay	4
	offset	87 177
	bbox	65 76 34 104
	sound   data/chars/raiden/elec.wav
        @cmd    spawn01  "ray3" -8 35 1
	frame	data/chars/raiden/sp0.png
	frame	data/chars/raiden/back02.png
	frame	data/chars/raiden/back03.png
	frame	data/chars/raiden/back04.png
	delay	30
	frame	data/chars/raiden/back04.png
	delay	9
	frame	data/chars/raiden/back03.png
	frame	data/chars/raiden/t5.png

And here Jago spawn the shadows in his Super attack:
Code:
anim special
	loop	0
   @script
   void vSelf = getlocalvar("self");
   int   iMP = getentityproperty(vSelf, "mp");
   if ( frame == 0 && iMP < 100 )
     {
        //then play can't animation
        performattack(vSelf, openborconstant("ANI_CANT"), 1);
     }
   if ( frame == 1 ){
        changeentityproperty(vSelf, "mp", iMP - 100);
        }
   @end_script
	offset	87 177
	delay   14
	bbox	0 0 0 0
	frame	data/chars/jago/magic01.png
	frame	data/chars/jago/magic02.png
        @cmd    spawn01 "fmagic" 0 0 1
	sound	data/sounds/magic.wav
	frame	data/chars/jago/magic02.png
   @script
   void vSelf = getlocalvar("self");                 //Caller.
   void vEntity;                                     //Target entity placeholder.    
   int  iEntity;                                     //Entity enumeration holder.    
   int  iType;                                       //Entity type.    
   int  iMax      = openborvariant("ent_max");       //Entity count.    
   if(frame==1){                                     //Enumerate and loop through entity collection.      
   for(iEntity=0; iEntity<iMax; iEntity++){            
       vEntity = getentity(iEntity);                     //Get target entity from current loop.  
      
       iType   = getentityproperty(vEntity,    "type"); //Get target type.        
                                                        //Enemy type?        
       if (iType == openborconstant("TYPE_ENEMY")){          
   void iTime = openborvariant("elapsed_time") + getentityproperty(vEntity, "freezetime");          
   changeentityproperty(vEntity, "frozen", 1);          
   changeentityproperty(vEntity, "freezetime", iTime + 4*200);
         }      }    }
   @end_script 
	delay   14
	frame	data/chars/jago/magic01.png
	delay   25
	frame	data/chars/jago/magic00.png
	delay   12
	frame	data/chars/jago/magic01.png
	frame	data/chars/jago/magic02.png
	delay   9
        @cmd    spawn01 "jshadows" 0 0 -1
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	delay   6
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic02.png
	delay   14
	frame	data/chars/jago/magic02.png
	frame	data/chars/jago/magic01.png


2) And the other problem is that I have noticed that the training enemy does not use the random name (manUsa0) and randomPal scripts that it has in the anim spawn.

Code:
anim spawn
       	loop	0
@script
    if(frame==1){
      void self = getlocalvar("self");

      setglobalvar("Opp", self);
    }
@end_script
	offset	82 177
	landframe  9 dust
	bbox	    0 0 0 0
        @cmd    layer -1
        fshadow 0
        @cmd    randomPal
        @cmd    manUsa0
	sound   data/sounds/klunk.wav
	delay   50
	frame	data/chars/gang1/bee/empty.png
	delay   4
        jumpframe 2  1.3 4
	sound   data/sounds/klunk.wav
	frame	data/chars/gang1/bee/fall2.png
	frame	data/chars/gang1/bee/fall2.png
	frame	data/chars/gang1/bee/fall2.png
	frame	data/chars/gang1/bee/fall2.png
	delay   20
	sound   data/sounds/m5fall.wav
	frame	data/chars/gang1/bee/fall2.png
	sound   data/sounds/m5fall.wav
	delay   10
        @cmd    layer 0
	frame	data/chars/gang1/bee/fall3.png
	delay   999
	frame	data/chars/gang1/bee/fall3.png
	delay   1
	sound   data/sounds/fall1.wav
	frame	data/chars/gang1/bee/fall4.png
	delay   100
	frame	data/chars/gang1/bee/fall4.png
	delay   1
        @cmd    anichange "ANI_RISE" 0
	frame	data/chars/gang1/bee/fall4.png


PD: In the thread of my mod you can see the video of the Training Lessons. http://www.chronocrash.com/forum/index.php?topic=1871.msg49141#msg49141
 
#1. Can you send lesson demo with Jago and Raiden? I have an idea to solve this but I'm gonna need them and their projectiles

#2. I believe that's because of first frame bug. It usually happens when spawning an entity with script run in its first frame of SPAWN. Try adding a single frame like this:

anim spawn
      loop 0
@script
    if(frame==1){
      void self = getlocalvar("self");

      setglobalvar("Opp", self);
    }
@end_script
offset 82 177
delay  1
landframe  10 dust
bbox     0 0 0 0
        fshadow 0
frame data/chars/gang1/bee/empty.png # added frame
delay  50
        @cmd    layer -1
        @cmd    randomPal
        @cmd    manUsa0
sound  data/sounds/klunk.wav
frame data/chars/gang1/bee/empty.png
delay  4
        jumpframe 2  1.3 4
sound  data/sounds/klunk.wav
frame data/chars/gang1/bee/fall2.png
frame data/chars/gang1/bee/fall2.png
frame data/chars/gang1/bee/fall2.png
frame data/chars/gang1/bee/fall2.png
delay  20
sound  data/sounds/m5fall.wav
frame data/chars/gang1/bee/fall2.png
sound  data/sounds/m5fall.wav
delay  10
        @cmd    layer 0
frame data/chars/gang1/bee/fall3.png
delay  999
frame data/chars/gang1/bee/fall3.png
delay  1
sound  data/sounds/fall1.wav
frame data/chars/gang1/bee/fall4.png
delay  100
frame data/chars/gang1/bee/fall4.png
delay  1
        @cmd    anichange "ANI_RISE" 0
frame data/chars/gang1/bee/fall4.png

Related to this, this enemy is spawned using Lessoner entity which applies its alias to the former. With this randomname script, that feature is redundant. I suggest you clear the redundant lines by deleting blue lines from this script in Lessoner.txt:

anim follow1
@script
    if(frame == 1){
      void self = getlocalvar("self");
      char Name = getentityproperty(self,"name");
      int x = getentityproperty(self, "x");
      int z = getentityproperty(self, "z");
      void e;

      clearspawnentry();
      setspawnentry("name", "Bee_Lesson");
      e = spawn();

      changeentityproperty(e, "position", x, z, 300);
      changeentityproperty(e, "name", Name);
    }
    if(frame == 2){
      void self = getlocalvar("self");

      setidle(self, openborconstant("ANI_IDLE"));
    }
@end_script
delay 100
offset 8 8
frame data/chars/misc/empty.png
delay 10
frame data/chars/misc/empty.png
frame data/chars/misc/empty.png
 
Thanks my friend!

I send you a PM with the link of a new demo with Raiden and Jago.
So now you can check how can solve the problem 1

About the problem 2, I follow your instructions and now the random  names work ok. But the randomPal still without working. I think you can see this better in the demo.

Thanks!
 
Back
Top Bottom