General actions can be used in both objects and explosions.
apply_map_effect ( <string> map_effect )
add_angle_speed ( <float> amount, <float> amount_var = 0 )
Adds a specific amount and amount variation to the angular speed of the object. See also: Ratio variation
add_speed ( <float> amount, <float> amount_var = 0, <float> offset = 0, <float> offset_var = 0 )
Adds a specific amount and amount variation to the angular speed of the object using a different angle offset and offset variation. See also: Ratio variation
create_explosion( <string> explosion )
Creates an explosion on the current position of the object.
custom_event( <int> index )
Will trigger the custom event indexed as index in the target particle. Note that this action needs to be inside a detection event or an event that interacts with other objects.
damage ( <float> amount, <float> amount_var, <float> max_distance )
Will damage the object by the amount value. Will only work on detection events involving an object with health, specified by the property health = <float>. If the max_distance parameter is set to a number > 0 the damage will fade from amount to 0 damage when the distance from the damaged object to the damager is equal to max_distance.
Good usage would be if it was used with on detect_range(a,b,[x1,x2,x3]), then it would damage all objects in collision layers and/or worms specified in the .
damp ( <float> factor )
It will multiply the detected object speed by this factor. When the factor:
push ( <float> factor )
Adds the speed of the owner object to the object that caused the event to trigger. The factor variable will multiply the speed to be added. Note that this action will obviously only work when called in an event that gets triggered by an object, for example, it wont do anything if you use it on a timer trigger.
put_particle ( <string> type, <float> x, <float> y, <float> xspd = 0, <float> yspd = 0, <float> angle = 0 )
It will create a single particle of the type passed in the position specified on the map. This is normally used not for mods, but for map objects that need to create things on some other position ( Like buttons etc ).
After this action gets called, the owner particle will disappear.
Good usage would be to make SURE all objects you create are removed eventually (unless you specifically don't want to remove them). Unremoved objects may slow down the game severely. For example, in a bazooka you may want to use it like this:
on ground_collision() create_explosion(x.exp) remove() on detect_range(10,0,[worms]) create_explosion(x.exp) remove()
repel ( <float> max_force, <float> max_distance, <float> min_force = 0 )
It will push the target object away from the owner object. If the distance between the two objects is 0 the force of repel will be equal to max_force, if the distance between both is equal to max_distance the repel force will be equal to min_force.
run_script( <string> file_name )
It will run the script that matches with name. The script will be passed the reference to the object that called it, and if this action was triggered from an event that involves a second object it will also be passed as a second parameter.
set_alpha_fade( <int> frames , <int> dest = 0 )
Once this action is called the objects alpha fades to the dest alpha in the specified frames. Can only be used if the object property blender is set to something different than NONE.
An example of usage would be:
blender=add alpha=100 on_creation() set_alpha_fade(100,0) on timer(100) remove()
This would cause a particle to begin with 100 alpha and gradually fade to 0 over 100 frames and remove itself.
shoot_particles ( <string> type, <int> amount, <float> speed = 0, <float> speed_var = 0, <float> motion_inheritance = 0, <int> amount_var = 0, <float> distribution = 360, <float> angle_offs = 0, <float> distance_offs = 0 )
For example, motionInheritance = 2 transfers twice the amount of speed of the owner to the shot particles.
This is a useful feature for making particles not detect the particle that created them.
Will shoot particles from the position the owner object is placed.
uniform_shoot_particles ( <string> type, <int> amount, <float> speed = 0, <float> speed_var = 0, <float> motion_inheritance = 0, <int> amount_var = 0, <float> distribution = 360, <float> angle_offs = 0, <float> distance_offs = 0 )
Works in the same way as shoot_particles except the particles wont be shot at random directions inside the distribution. Instead, the angle in which particles will be shot is distribution / ( total number of particles ). TODO: Add an image that explains this.
delay_fire ( <int> time, <int> time_var = 0 )
Will disable firing of the weapon for time + random from 0 to time_var ( time_var is a positive variation. Works only on weapon events.)
delay_fire is used not as reload time, but as the amount of time between each projectile (aka, firing rate). If used in the “on_primary_press” event, delay_fire equates to the amount of time needed before the weapon fires the “on_primary_shoot” event. If used in the “on_primary_shoot” event, delay_fire equates to firing rate.
show_firecone ( <string> sprite, <int> frames, <int> draw_distance = 0 )
It will show the firecone image passed as sprite during the passed number of frames. draw_distance will offset the image away from the center of the worm.
use_ammo ( <int> amount )
It drains an amount of weapon ammo. This is needed whenever a bullet is shot from the weapon. If this is not used, the weapon has unlimited ammunition, even if there is a limit specified (never spends the amount).
play_sound ( <string|string> sound, <float> loudness = 100, <float> pitch = 1, <float> pitch_var = 0 )
Will play a 3D sound that will follow the position of the owner object, soundFile is the name of the sound to play ( See the list of supported sound formats ). loudness is directly related to how loud it will be heard from the distance. pitch is a modifier of the sound play frequency and pitchVariation is a ratio variation of it.
Tip: Rather than creating several different sounds for a single object (dropping shells, for example), you can use pitch variation to create differences between each time the sound is played.
play_sound_static ( <string|string> sound, <float> loudness = 100, <float> pitch = 1, <float> pitch_var = 0 )
Behaves exactly the same as play_sound but the sound will not follow the object. Once the sound is created, it will stay in the same place and not move.
play_global_sound ( <string|string> sound, <float> volume, <float> volume_var, <float> pitch = 1, <float> pitch_var = 0 )
Will play a sound in no particular position. The sound can always be heard no and wont fade with distance. If more than one sound is passed as first param then the sound to play will be chosen at random from that list.