Hello friends,
I have created a glass bottle to break it in single as in multiplayer, with saber or with shots.
The code I copied it from the element "gourd", but I want that after breaking this bottle an already broken one appears. I have the bottle, the broken bottle, the particles and the sound, I just need to know what to add to make that broken bottle appear, without the game crashing, since without the spawn line, everything is perfect.
The code is the following
Thanks in advance
I have created a glass bottle to break it in single as in multiplayer, with saber or with shots.
The code I copied it from the element "gourd", but I want that after breaking this bottle an already broken one appears. I have the bottle, the broken bottle, the particles and the sound, I just need to know what to add to make that broken bottle appear, without the game crashing, since without the spawn line, everything is perfect.
The code is the following
Code:
("botella",sokf_moveable|sokf_destructible|spr_hit_points(1),"botella","bo_botella",
[
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 1),
]),
(ti_on_scene_prop_destroy,
[
(store_trigger_param_1, ":instance_no"),
(val_add, "$g_last_destroyed_gourds", 1),
(prop_instance_get_position, pos1, ":instance_no"),
(copy_position, pos2, pos1),
(position_set_z, pos2, -100000),
(particle_system_burst, "psys_dummy_straw", pos1, 2),
(particle_system_burst, "psys_prt_botella1_q1", pos1, 1),
(particle_system_burst, "psys_prt_botella1_q2", pos1, 15),
(particle_system_burst, "psys_prt_botella1_q3", pos1, 1),
(prop_instance_animate_to_position, ":instance_no", pos2, 1),
# (spawn_scene_prop, "spr_botella_destruida"),
(play_sound, "snd_vidrio_roto"),
]),
(ti_on_scene_prop_hit,
[
(play_sound, "snd_vidrio_roto"),
(particle_system_burst, "psys_dummy_straw", pos1, 10),
]),
]),