Community FAQ: Difference between revisions

From Unofficial EFPSE wiki Extended
Jump to navigation Jump to search
No edit summary
m (shoot multiple times tips)
Line 7: Line 7:


map return</blockquote>This will use a local variable that will heal the player when collected for a random value between 8 and 35 health points.
map return</blockquote>This will use a local variable that will heal the player when collected for a random value between 8 and 35 health points.
==== Is there a way to make the enemy shoot multiple times? ====
Yes. use FSM and Insert ATTACK and READY alternately. For example<blockquote>state ATTACK CHASE 0
frame 5 0.25 0 0 0 NONE
frame 5 0.25 0 0 0 NONE
frame 6 0.0625 0 0 0 READY
frame 6 0.0625 0 0 0 ATTACK
frame 5 0.25 0 0 0 READY
frame 6 0.0625 0 0 0 ATTACK
frame 5 0.25 0 0 0 READY
frame 6 0.0625 0 0 0 ATTACK
frame 5 0.25 0 0 0 READY
frame 6 0.0625 0 0 0 ATTACK
frame 5 0.25 0 0 0 READY
frame 6 0.0625 0 0 0 ATTACK
frame 5 0.25 0 0 0 READY</blockquote>If READY is not inserted, the animation will play but only one bullet will be fired.

Revision as of 04:14, 21 August 2023

Is there a way to randomize values?

Yes. To randomize a value you use variable=RANDOM(0,100). For example

HealPlayer=RANDOM(8,35)

player heal $HealPlayer

entity delete me

map return

This will use a local variable that will heal the player when collected for a random value between 8 and 35 health points.

Is there a way to make the enemy shoot multiple times?

Yes. use FSM and Insert ATTACK and READY alternately. For example

state ATTACK CHASE 0

frame 5 0.25 0 0 0 NONE

frame 5 0.25 0 0 0 NONE

frame 6 0.0625 0 0 0 READY

frame 6 0.0625 0 0 0 ATTACK

frame 5 0.25 0 0 0 READY

frame 6 0.0625 0 0 0 ATTACK

frame 5 0.25 0 0 0 READY

frame 6 0.0625 0 0 0 ATTACK

frame 5 0.25 0 0 0 READY

frame 6 0.0625 0 0 0 ATTACK

frame 5 0.25 0 0 0 READY

frame 6 0.0625 0 0 0 ATTACK

frame 5 0.25 0 0 0 READY

If READY is not inserted, the animation will play but only one bullet will be fired.