Sir_Pink
Veteran
I made this bleed script for Native multiplayer and it works great. If the player aka player_agent hp = 50% health then the players health starts to minus from its current value until it reaches 0. When the players hp hits 1, then the death sound is played. Then the players sound is stopped and the player is killed.
My question is how can I position the (particle_system_burst, "psys_game_blood_2", pos1), on a specific location on the player agent. If I track the player agents position, then set the particle burst at the player agents position the effect appears under his feet. I'm curious if it would be possible to add to the current agents Y axis for example. Say the agent is at 0,60,0 but i need the particle effect to appear above his position so it spurts from his chest. I would have to add 30 so it would be 0,90,0, then set the burst effect to execute at that updated position.
My second idea is to have the particle effect to continuously spurt from where the player was hit from last, then track that position on the player agent. If someone could help me on steam or point me in the right direction of which operators i could use in header_operations, I would greatly appreciate it.
my steam name is coawie13337 (there are 3 threes, a lot of people make the mistake of only typing two ^_^)
Thank you for taking the time to read my wall of text. screen shot with color coding bellow and copy and paste mode for the source.
Copy and paste version:
Viewing version:
Bonus:
My question is how can I position the (particle_system_burst, "psys_game_blood_2", pos1), on a specific location on the player agent. If I track the player agents position, then set the particle burst at the player agents position the effect appears under his feet. I'm curious if it would be possible to add to the current agents Y axis for example. Say the agent is at 0,60,0 but i need the particle effect to appear above his position so it spurts from his chest. I would have to add 30 so it would be 0,90,0, then set the burst effect to execute at that updated position.
My second idea is to have the particle effect to continuously spurt from where the player was hit from last, then track that position on the player agent. If someone could help me on steam or point me in the right direction of which operators i could use in header_operations, I would greatly appreciate it.
my steam name is coawie13337 (there are 3 threes, a lot of people make the mistake of only typing two ^_^)
Thank you for taking the time to read my wall of text. screen shot with color coding bellow and copy and paste mode for the source.
Copy and paste version:
Code:
hurtplayer = (
#1,0,0,[(store_current_scene,":current_scene"),(multiplayer_is_server),(eq,":current_scene","scn_multi_blankmap")],
1.5,0,0,[], #Fires every 1second
[
(multiplayer_is_server), # test for a multiplayer server.
#(set_fixed_point_multiplier, 10),
(try_for_agents,":cur_agent"), # loops through all players.
(agent_is_alive,":cur_agent"), # test for alive players.
(agent_is_human,":cur_agent"), # test for player that are human.
(store_agent_hit_points,":cur_agent_hp",":cur_agent", 1), # stores the hp value of the alive and human players.
(gt, ":cur_agent_hp",27.5), #55 = max? #27.5 = 50% # test if the players hp is greater than 27.5 and if true exit the loop.
(store_add,":cur_full_health", ":cur_agent_hp",0),
(agent_set_hit_points,":cur_agent", ":cur_full_health",1),
(else_try),
(store_sub,":damage",":cur_agent_hp",1), # if the above try_for_agents statement failed, store the players hp and subtract 1 from it.
(agent_set_hit_points,":cur_agent", ":damage",1), # update the players hp value with the new calculation value from above.
####################################
# Blood Spurt code START #
####################################
#(agent_get_position,pos1,":cur_agent"),
#(position_get_z,":cur_agent_z",pos1),
#(store_add,":cur_agent_z_above", ":cur_agent_z", 60),
#(position_set_z, pos2, ":cur_agent_z_above"),
#(agent_set_position,":cur_agent", pos2), # (agent_set_position,<agent_id>,<position_no>),
#(agent_get_position,pos2,":cur_agent"),
#(particle_system_burst, "psys_game_blood_2", pos1),
####################################
# Blood Spurt code END #
####################################
(try_begin), # test if the players hp equals 1.
(eq, ":damage", 1),
(agent_play_sound, ":cur_agent", "snd_man_die"), # if the value is one then play death sound.
(try_end),
(try_begin), # test if the players hp value is 0, if so kill him and stop the sounds.
(le,":damage",0),
(agent_stop_sound, ":cur_agent"),
#(try_begin),
#(player_get_death_count, ":player_kill_count", ":cur_agent"),
(remove_agent, ":cur_agent"), # Alternative = (agent_deliver_damage_to_agent,":cur_agent",":cur_agent"),
#(val_sub, ":player_kill_count", 1),
#(player_set_death_count, ":cur_agent", ":player_kill_count"),
#(player_get_agent_id, ":bleeding_agent", ":cur_agent"),
(try_end),
(try_end),
(try_end),
])
Viewing version:
Bonus: