Few things I need to fix

NED

Well-known member
---------------------------------
Big post : May I split it in different parts/subjects?
Sorry if I did it wrong (??)
---------------------------------
Is there a way to make a spawn a particular effect displayed only on low level life

Code:
@cmd spawn01 "bdrop" 0 112 3#--name x y z--

I used to display it only in faint anim, But I would like to have it possible in
walk
run
idle
and a custom "dizzy" anim.
liedown

This is why I need to have it possible based on "life level" and not only in faint anim.

----------------------------------------------------------------------
I don't know why but when my player rises normally (without using riseattack)
She seems to be invincible to any attack.

Fall anim:
Code:
anim fall
	quakeframe	1 1 -11
	loop	0
	landframe	2 dus
	forcedirection	1
	delay	15
	offset	96 177
	bbox	67 82 62 90
	attack	67 82 62 90 5 1 0 1 15 0
	sound	data/chars/rachel/rdam3.wav
	frame	data/chars/rachel/fall1.gif
	bbox	58 100 81 54
	attack	58 100 81 54 5 1 0 1 15 0
	delay	300
	frame	data/chars/rachel/fall2.gif

	delay	55
	bbox	43 148 113 43
	frame	data/chars/rachel/fall4.gif

	delay	40
	bbox	43 148 113 43
	frame	data/chars/rachel/fall4.gif

2nd fall anim:

Code:
anim fall2
	quakeframe	1 1 -11
	loop	0
	landframe	2 dus
	forcedirection	1
	delay	15
	offset	96 177
	bbox	67 82 62 90
	attack	67 82 62 90 5 1 0 1 15 0
	sound	data/chars/rachel/rdam3.wav
	frame	data/chars/rachel/fall1.gif
	bbox	58 100 81 54
	attack	58 100 81 54 5 1 0 1 15 0
	delay	300
	frame	data/chars/rachel/fall2.gif

	delay	55
	bbox	43 148 113 43
	frame	data/chars/rachel/fall4.gif

	delay	40
	bbox	43 148 113 43
	frame	data/chars/rachel/fall4.gif

automatic rise (rise)

Code:
anim	rise
#	subentity	dus#t
#	summonframe	4 0
cancel 1 2 0 S freespecial34# forward reverse roll
cancel 1 2 0 F freespecial34# forward reverse roll
cancel 1 2 0 A freespecial38# LA VRAIE RISE ATTACK
	loop	0
	offset	96 177
	bbox	0 0 0 0

	delay	10
	frame	data/chars/rachel/fall4.gif#for reverse system
	delay	2
	frame	data/chars/rachel/fall4.gif#for reverse system

	delay	11#9
	frame	data/chars/rachel/rise1.gif
	frame	data/chars/rachel/rise2.gif
	frame	data/chars/rachel/j01.gif


rise faster (named riseattack)

Code:
anim	riseattack
cancel 1 2 0 S freespecial34# forward reverse roll
cancel 1 2 0 F freespecial34# forward reverse roll
cancel 1 2 0 A freespecial38# LA VRAIE RISE ATTACK
	loop	0
	offset	96 177
	bbox	0 0 0 0

	delay	10
	frame	data/chars/rachel/fall4.gif#for reverse system
	delay	2
	frame	data/chars/rachel/fall4.gif#for reverse system

	delay	11#9
	frame	data/chars/rachel/rise1.gif
	frame	data/chars/rachel/rise2.gif
	frame	data/chars/rachel/j01.gif


real rise attack (a freespecial)

Code:
anim	freespecial38
	damageonlanding 0 1#l'enemi peut faire des indirect damage
	subentity	dus#t
	summonframe	8 0
	loop	0
	offset	96 177
	bbox	0 0 0 0
	delay	8#11#9
	frame	data/chars/rachel/riseat1.gif
	hitfx	data/sounds/knee.wav
	attack	92 85 79 65 5 1 0 0 14 0
	dropv	5 3
	frame	data/chars/rachel/riseat2.gif
	attack	0 0 0 0 0 0
	sound	data/chars/rachel/kiai2.wav
	frame	data/chars/rachel/riseat3.gif
	frame	data/chars/rachel/riseat4.gif
	hitfx	data/sounds/beat2.wav
	attack	92 85 79 65 7 1 0 0 14 0
	frame	data/chars/rachel/riseat5.gif
	attack	0 0 0 0 0 0
	frame	data/chars/rachel/riseat6.gif
	frame	data/chars/rachel/riseat7.gif
	sound	data/sounds/land.wav
	frame	data/chars/rachel/j01.gif

------------------------------------------------------------------------------------------
My enemy character "Mex" have a taunt that is triggered in a particular range.
But IMO, It's a little too "scripted", I mean it happen really few times.
But When he's on the right range, he seems to over-do it. (repeat several times)

How can I use random code to make him doing it really randomly
Where the code have to be ? In idle and walk anims?

----------------------------------------------------------------------------------------

I'm coding a super move:
at the start it spawn a darker screen effect that pauses the action.
THis seems to work well, but sometimes, the effect isn't spawned at all.

Is there a limitation or something?


This is the start of super move with the spawn place.

Code:
#SUPER 2
anim	freespecial46
#energycost 300 1#100 1
      followcond 2
      followanim 6#2#8
	delay	8
	loop	0
	jugglecost	1
	offset	96 177
	jumpframe	3 1.4 4.3#3 3.9 4.3#3 4 4.1#3 4.2 4.1#3 4.3 4.5#3 3.9 4.3#3 4.5 4#2 3 1.6# frame Y X...
	landframe	12 dus#11 dus#10 dus
      attackone 1
	hitfx	data/sounds/empty.wav
	frame	data/chars/rachel/supB00.gif
	delay	1#11#14#15
	frame	data/chars/rachel/supB01.gif
...
...
...

This is the spawned effect file.

Code:
name	pause
type	text
subtype  noskip 
shadow	0
setlayer    -1


anim	idle
	loop	0
	delay	40
	offset	532 308
	bbox	0 0 0 0
	sound	data/sounds/energy.wav
drawmethod alpha 2
	frame	data/sprites/grey1
	@cmd	killentity getlocalvar("self")
	frame	data/sprites/empty.gif
 
That's a function you should add in your animationscript. After you add that function, you should call it like this:

anim death10
quakeframe 1 1 -11
landframe 0 dus
delay 4
bbox 36 132 139 54
sound data/chars/mex/mex_out.wav

offset 96 177
frame data/chars/mex/fall4b.gif
offset 94 177
        @cmd      spawnRandom bloodf -50 10 -1 50
frame data/chars/mex/fall4b.gif
offset 96 177
frame data/chars/mex/fall4b.gif
offset 94 177
frame data/chars/mex/fall4b.gif
offset 96 177
frame data/chars/mex/fall4b.gif
offset 94 177
frame data/chars/mex/fall4b.gif
offset 96 177
frame data/chars/mex/fall4b.gif
offset 94 177
frame data/chars/mex/fall4b.gif
offset 96 177
frame data/chars/mex/fall4b.gif
offset 94 177
frame data/chars/mex/fall4b.gif

offset 96 177
delay 40
frame data/chars/mex/fall4.gif
 
Thanks.
I edited the script file with the function.
I added the line to call it, just like you did.

it crashes. Log file says:

Code:
Script error: data/scripts/slam.c, line 929: Invalid external declaration '}' (in production 1)

}
^

Did the fact there is already another spawn01 text can cause the problem?
Or is it normal?


---------------------------------------
EDIT

Let's go crazy.
I tried to edit the script, trying to delete the sign pointed out by the log file.
Code:
}
so the script is like that:
Code:
void spawnRandom(void Name, float dx, float dy, float dz, int Rand)
{ // Spawn defined entity randomly
   void self = getlocalvar("self");

   if(Rand >=  50 - rand()%50)
     spawn01(Name, dx, dy, dz);
   }

The mod can now be launched but still crash later.
Log file:
Code:
Script compile error in 'animationscript': bloodf line 245, column 24
 
No problem
It seems to work very well!!
Thanks a lot!

Now I have to tweak it to have actually 40% of probability.

is this settings right?

In MEX:
@cmd      spawnRandom "bloodf" -50 10 -1 40


In scripts:
void spawnRandom(void Name, float dx, float dy, float dz, int Rand)
{ // Spawn defined entity randomly
  void self = getlocalvar("self");

  if(Rand >=  40 - rand()%40)
    spawn01(Name, dx, dy, dz);
  }
 
No, don't tamper the function. It's already good as it is. I happen to use same random value for Rand. Rand value doesn't have any corelation to any value in function.

Just set any value you want for Rand between 0 and 100 that is
 
Thanks!
It's fixed.
I applied the script just like you said.

----------------------------

I think I have already asked for it some weeks ago, but is there a way to have something to avoid OTG/ground moves abuse.
As you know I have several moves made to hit OTG mainly "kick stomp" and "elbow drop"

I want to find a way to make these moves not too broken/abusive.
my tries was.

-Lowerring the damage value (but it feels weird to have moves that takes almost nothing on enemy life)
-making these moves "not free" I meanusing magic bar to use them. (but again, its weird to have it)

Now, I'm thinking about something the ideas:
-lowering the damage value progressively (something like damage dampering. the more you hit, the less it takes)
or
-making the enemy auto get up randomly when he is in this particular fall anim / perhaps a counter system that send to his reversal attack??


I precise these moves send to special "fall" and "death" anims.
These moves cannot hit stand enemies

-------------------------------

I'm still thinking about another thing that causes a bug.

MEX have a particular dizzy anim he plays randomly on rise. (anim follow1)
He spawns an entity for the "stars" effect of his stun anim.

The problem is this anim have to disapear when MEX recovers from dizzy, but also if he's hit.

THe idea is to have some way to destroy stars entity if he's no more in "anim follow1"

Is it possible to apply such a change?
 
I think I have already asked for it some weeks ago, but is there a way to have something to avoid OTG/ground moves abuse.

Hmmm.... I have 2 solutions in mind, one require script and the other doesn't.
1. Scripted
A script is set in FALL animation to check how many times this animation has been played in a row. If it has reached certain limit, animation will be changed to other FALL animation with no bbox preventing entity to be attacked
2. Non scripted
Use staydown on all knock down attacks. The idea is regular (non ground) moves should put enemy in long fallen state IOW give staydown 300 so enemy will stay on ground for 3 seconds.
For ground moves, give shorter, something like, staydown 100 or less so enemy will stay on ground for 1 second or less.
So when you knock down an enemy will regular attack, the latter will fall on ground and stay there long enough to be beaten however after hitting the latter with ground move, it will rise sooner preventing it from getting hit by another ground move.

#2 is best solution IMO since #1 is for preventing entity to be juggled too much.

THe idea is to have some way to destroy stars entity if he's no more in "anim follow1"

The best way for that is to use bindentity after spawning the stars. There's a parameter in that function which will remove the bound entity if parent entity (to which stars bound to) plays animation which stars don't have.
Using bindentity to bind stars is not bad idea OTOH.
 
Great!
First one is fixed!
This particular stomp move need a negative value for "staydown" so the enemy get up. And since he has a rise attack he uses it as a "counter-type" move.
Thanks!!

About "bindentity", can you be a little specific? I don't really get how to apply it.
Also, do I need to add a function in script file?
 
Glad you got #1 working :)

As for #2, yes, you need to add this function:
void spawnBind(void Name, float dx, float dy, float dz, int Dir, int Flag)
{ // Spawn entity and bind it
  void self = getlocalvar("self");
  void Spawn;

  Spawn = spawn01(Name, dx, dy, dz);
  bindentity(Spawn, self, dx, dz, dy, Dir, Flag);
}

The 1st 4 parameters are same with spawn01. For Dir, just set 1. For the last parameter set 4 so the bindentity will remove itself if its animation doesn't match.

Related to that, you have to give same animation name to stars. So if you want stars to be played just when Mex is in FOLLOW1, then stars should have FOLLOW1 animation. You can just rename IDLE to FOLLOW1 for this.
 
OK,
I tried to apply the function, but it causes a crash.
Log file don't say anything particular.

This is how I applied it:

Code:
anim	follow1# dizzy anim - randomly from rise
   	offset   96 177
	bbox	67 58 61 122

#	subentity	stun0001
##	#spawnframe {frame} {x} {z} {a} {relative} # position est par rapport a l'offset du perso
#	spawnframe	4 0 2 90 0#1 0 2 90 0#1 0 0 0 0


##	summonframe	1 0 2 90 0#1 0 0 0 0
##        unsummonframe   4


	delay	15
	frame	data/chars/mex/rise1.gif
	delay	18
	frame	data/chars/mex/rise2.gif
	delay	18
	frame	data/chars/mex/rise3.gif


  	 delay   20#30#100#15


#	spawn01(Name, dx, dy, dz)
	@cmd spawn01 "stun0001" 0 90 2#--name x y z--
#	bindentity(Spawn, self, dx, dz, dy, Dir, Flag)
	@cmd bindentity "stun0001" 0 2 90 1 4#--name X Z Y 1 4--


   	frame   data/chars/mex/pain2.gif
  	delay   25#40
@cmd spawnDmg "bdropfst" -20 108 3 0.99#--name x y z niv de life--
  	frame   data/chars/mex/pain1.gif
  	 delay   30
   	frame   data/chars/mex/pain2.gif
  	delay   25
  	frame   data/chars/mex/pain1.gif
  	delay   60
@cmd spawnDmg "bdropfst" 15 92 3 0.99#--name x y z niv de life--
  	frame   data/chars/mex/pain2.gif

the updates stun/dizzy entity
Code:
anim idle
	
	loop	1#0#1
	delay	6
	offset	42 50
	sound	data/sounds/stun.wav
	frame	data/sprites/st0001
	frame	data/sprites/st0002
	frame	data/sprites/st0003
	frame	data/sprites/st0004
	frame	data/sprites/st0005
	frame	data/sprites/st0006
	frame	data/sprites/st0007
	frame	data/sprites/st0008
	frame	data/sprites/st0009
	frame	data/sprites/st0010
	frame	data/sprites/st0011
	frame	data/sprites/st0012
	frame	data/sprites/st0013
	frame	data/sprites/st0014
	frame	data/sprites/st0015
	frame	data/sprites/st0016

anim follow1#follow for scripting purpose (meme num de follow que le dizzy follow1 des persos)
	
	loop	1#0#1
	delay	6
	offset	42 50
	sound	data/sounds/stun.wav
	frame	data/sprites/st0001
	frame	data/sprites/st0002
	frame	data/sprites/st0003
	frame	data/sprites/st0004
	frame	data/sprites/st0005
	frame	data/sprites/st0006
	frame	data/sprites/st0007
	frame	data/sprites/st0008
	frame	data/sprites/st0009
	frame	data/sprites/st0010
	frame	data/sprites/st0011
	frame	data/sprites/st0012
	frame	data/sprites/st0013
	frame	data/sprites/st0014
	frame	data/sprites/st0015
	frame	data/sprites/st0016

bindentity seems to cause problem.
I tested in various ways.

- @cmd bindentity "Spawn" "self" 0 2 90 1 4
- @cmd bindentity Spawn self 0 2 90 1 4
- @cmd bindentity "stun0001" "FOLLOW1" 0 2 90 1 4
- @cmd bindentity "stun0001" "mex" 0 2 90 1 4
- @cmd bindentity stun0001 mex 0 2 90 1 4

I think I don't do it the right way...
 
Is there a way to make a sound effect played by a character or enemy only if you are in a particular level.
Something like a level detect function. I'll explain.

When my characters are walking or jumping there is a loud sound of the "ring mat" to give more realism. But I would like this sound not to be played in normal "non ring" levels.

Also a better way can be to activate these particular walk and jump sound only if the entity itself is in a particular altitude, so it can happenen too when you're on top of a barell or platform. This is the best IMO, but I don't know if it's possible.
 
Yes, there is a way though, you need a simple special function for it (if you want to use single function for all SFXs to be played) or a complex generic function (if you don't mind using multiple functions, one function for each SFX).

This function(s) will be combined with script setting in each level.

Now, for standing ontop of barrel and platform case, this require extra function to detect the platform and name of platform entity before deciding which SFX to be played.

Those are just rough ideas.
 
Seems to be OK!!
I don't really need this effect for barrels and other items, this is just to make the code based on character Y position easier.
But if it's based on plateform entity ID. Let's just make it possible for ring plateform. THis is the only plaeform that really require it.

------------------------

I coded a long range slam move.
Rachel jumps forward
if she hits standing enemy, she cancels to a grapple move.
It works fine, but for some reason, the move don't work when enemy is on plateform.
I use slamstart2 script.

The move works perfectly on floor level, but if it's done on plateform (ring) Rachel (player) consider the move don't hit, and plays the miss anim.
The anim played normally when enemy is in mid air.

Is there something wrong in the code?
Or a way to avoid this bug?



In long range slam starter:

Code:
         @script
                void self = getlocalvar("self");
       if ((getentityproperty(self, "direction")==1)&&(frame == 6)){
      changeentityproperty(self, "velocity", 0.2, 0, 0);
      }
      if ((getentityproperty(self, "direction")==0)&&(frame == 6)){
      changeentityproperty(self, "velocity", -0.2, 0, 0);
      }
      if(frame == 31){
      void self = getlocalvar("self");
      changeentityproperty(self, "velocity", 0, 0, 0);
      }
   @end_script


      hitfx   data/sounds/get.wav#empty.wav
      @cmd    degravity -2
	sound	data/chars/rachel/kiai2.wav
	frame	data/chars/rachel/supB09.gif
	sound	data/sounds/get.wav
	frame	data/chars/rachel/supB09.gif
	delay	5#7#10#8
      @cmd    entergrab
      @cmd    slamstart2
...
...
...



Script itself:

Code:
void slamstart2()
{ // Slam Starter for nongrab slams
// Use finish or throw after using this
   void self = getlocalvar("self");
   void target = getlocalvar("Target" + self);

   if(target==NULL())
   {
     target = getentityproperty(self, "opponent");
     setlocalvar("Target" + self, target);
   }
   if(target!=NULL())
   {
     damageentity(target, self, 0, 1, openborconstant("ATK_NORMAL7")); // Slam Starter
   }
}
 
I don't have the script for SFX now, been focusing on making video right now.

As for long range slam, nothing in script code checks for altitude so if the attack misses, it's more likely caused by something else. Can you confirm that the attackbox you used to initiate the slam connects when enemy is on platform?
 
Ok I'll ask later about FX.

For long range slam, I checked. I'm sure it hits.
When the move hits a non stand/ground enemy it cancels to
"anim follow7"

And this is the animation we can see when the move is done on the ring. :(
So, yes it hits but consider the enemy non stand.

I don't know why it causes this bug.
 
Back
Top Bottom