Grendal-777
Veteran
I have been working on a scene prop that can be placed under ground and then raised via an action. Once raised it can then be destroyed and will fall back below ground. I have tried it several ways and believe I am close to achieving my objective. However, I get an error when I compile and am not knowledgeable enough to track down the cause.
These are located in my module_scene_props.py:
and
If your curious about the "],2000)," I am using the prop hit point modifying script located here: http://forums.taleworlds.com/index.php/topic,58596.0.html
It is working fine on several other props in the same file.
However, I also tried editing it out and using;
and got the exact same error when compiling.
The error I am getting is:
Anyone have any idea where I am messing up, or how to better do this?
These are located in my module_scene_props.py:
Code:
check_ftower_destroy = (ti_on_scene_prop_use,
[
(store_trigger_param_1, ":agent_id"),
(store_trigger_param_2, ":player_no"),
(store_trigger_param_3, ":instance_id"),
(multiplayer_is_server),
(assign, ":cost", 500),
(player_is_active, ":player_no"),
(agent_get_player_id,":player_no",":agent_id"),
(player_get_gold, ":player_gold", ":player_no"),
(try_begin),
(ge, ":player_gold", ":cost"), #Make sure player has gold
(prop_instance_get_position, pos2, ":instance_id"),
(position_move_z,pos2,1200),
(prop_instance_animate_to_position, ":instance_id", 2, 800),
(val_sub, ":player_gold", ":cost"),
(player_set_gold, ":player_no", ":player_gold", multi_max_gold_that_can_be_stored),
(try_end),
])
Code:
("a_ftower_destructible",sokf_destructible|sokf_moveable|spr_use_time(2),"castle_f_tower_a","bo_castle_f_tower_a",[
(ti_on_scene_prop_use, [
check_ftower_destroy,
]),
(ti_on_scene_prop_destroy, [
(store_trigger_param_1, ":instance_no"),
(display_message, "@You destroyed the tower!"),
(prop_instance_get_position, pos2, ":instance_no"),
(play_sound, "snd_dummy_destroyed"),
# (particle_system_burst, "psys_explosion_fire", pos1, 100), #percentage_burst_strength is 100
#(position_rotate_x, 5), #use these if you wish to rotate it
#(position_rotate_y, 5),
#(position_rotate_z, 5),
(position_move_z, pos2, -2200), #up/down #move the door out of the way (underground)
#(position_move_x, pos2, -200), #left/right
#(position_move_y, pos2, -200), #forward/back
(prop_instance_animate_to_position, ":instance_no", 2, 800), #animate to position in 8 seconds
]),
(ti_on_scene_prop_hit,
[
(play_sound, "snd_dummy_hit"),
(particle_system_burst, "psys_dummy_smoke", pos1, 100), #percentage_burst_strength is 100
]),
],2000),
It is working fine on several other props in the same file.
However, I also tried editing it out and using;
("a_ftower_destructible",sokf_destructible|sokf_moveable|spr_use_time(2),"castle_f_tower_a","bo_castle_f_tower_a",[
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 2000),
]),
(ti_on_scene_prop_use, [
check_ftower_destroy,
]),
(ti_on_scene_prop_destroy, [
(store_trigger_param_1, ":instance_no"),
(display_message, "@You destroyed the tower!"),
(prop_instance_get_position, pos2, ":instance_no"),
(play_sound, "snd_dummy_destroyed"),
# (particle_system_burst, "psys_explosion_fire", pos1, 100), #percentage_burst_strength is 100
#(position_rotate_x, 5), #use these if you wish to rotate it
#(position_rotate_y, 5),
#(position_rotate_z, 5),
(position_move_z, pos2, -2200), #up/down #move the door out of the way (underground)
#(position_move_x, pos2, -200), #left/right
#(position_move_y, pos2, -200), #forward/back
(prop_instance_animate_to_position, ":instance_no", 2, 800), #animate to position in 8 seconds
]),
(ti_on_scene_prop_hit,
[
(play_sound, "snd_dummy_hit"),
(particle_system_burst, "psys_dummy_smoke", pos1, 100), #percentage_burst_strength is 100
]),
]),
(ti_on_init_scene_prop,
[
(store_trigger_param_1, ":instance_no"),
(scene_prop_set_hit_points, ":instance_no", 2000),
]),
(ti_on_scene_prop_use, [
check_ftower_destroy,
]),
(ti_on_scene_prop_destroy, [
(store_trigger_param_1, ":instance_no"),
(display_message, "@You destroyed the tower!"),
(prop_instance_get_position, pos2, ":instance_no"),
(play_sound, "snd_dummy_destroyed"),
# (particle_system_burst, "psys_explosion_fire", pos1, 100), #percentage_burst_strength is 100
#(position_rotate_x, 5), #use these if you wish to rotate it
#(position_rotate_y, 5),
#(position_rotate_z, 5),
(position_move_z, pos2, -2200), #up/down #move the door out of the way (underground)
#(position_move_x, pos2, -200), #left/right
#(position_move_y, pos2, -200), #forward/back
(prop_instance_animate_to_position, ":instance_no", 2, 800), #animate to position in 8 seconds
]),
(ti_on_scene_prop_hit,
[
(play_sound, "snd_dummy_hit"),
(particle_system_burst, "psys_dummy_smoke", pos1, 100), #percentage_burst_strength is 100
]),
]),
The error I am getting is:
Exporting scene props...
Traceback (most recent call last):
File "process_scene_props.py", line 40, in <module>
save_scene_props(variables,variable_uses,tag_uses,quick_strings)
File "process_scene_props.py", line 23, in save_scene_props
save_simple_triggers(ofile,scene_prop[4] , variable_list,variable_uses,tag_
uses,quick_strings)
File "C:\Users\Chris\Desktop\M&B-M Mod\MS 1.131 fixed variables\process_operat
ions.py", line 469, in save_simple_triggers
save_statement_block(ofile,0,1,trigger[1] , variable_list, variable_uses,ta
g_uses,quick_strings)
File "C:\Users\Chris\Desktop\M&B-M Mod\MS 1.131 fixed variables\process_operat
ions.py", line 449, in save_statement_block
save_statement(ofile,opcode,no_variables,statement,variable_list,variable_us
es,local_vars, local_var_uses,tag_uses,quick_strings)
File "C:\Users\Chris\Desktop\M&B-M Mod\MS 1.131 fixed variables\process_operat
ions.py", line 401, in save_statement
ofile.write("%d "%operand)
TypeError: %d format: a number is required, not list
Anyone have any idea where I am messing up, or how to better do this?