WB Coding What is wrong with this code? Usable Scene Props

Users who are viewing this thread

beratsalun

Recruit
hi everyone I want to add a usable scene prop to my scene. I want it to work like a chest, which we can interact with.

This is the code I added to module_scene_props
Code:
("gomu",(spr_use_time(0)),"chest_b","bo_chest_b", [check_item_use_trigger, (ti_on_scene_prop_use,[
    (entry_point_get_position, pos2, 8),
    (set_spawn_position, pos2),(spawn_scene_prop, "spr_fire_big"),
    ]),]),
and then I added this code to module_scripts, under "game_get_use_string"
Python:
(else_try),
         (eq, ":scene_prop_id", "spr_gomu"),
         (str_store_string, s0, "@Dig In"),
but when I get into the scene nothing happens even if I get close to my scene prop. whats wrong anyone helpp
 
Solution
Do you fullfill this conditions?
spr_use_time(x)determines how long it takes to use the scene prop. Typically used in multiplayer, make sure to set can_use_scene_props_in_single_player = 1 in module.ini to make scene props useable in singleplayer too. Keep in mind that a scene prop needs to have a collision mesh for this to work. This flag is also need to be set to make use of the trigger ti_on_scene_prop_use.
And do you also not see the new string or does the string show up and just nothing happens?

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
Do you fullfill this conditions?
spr_use_time(x)determines how long it takes to use the scene prop. Typically used in multiplayer, make sure to set can_use_scene_props_in_single_player = 1 in module.ini to make scene props useable in singleplayer too. Keep in mind that a scene prop needs to have a collision mesh for this to work. This flag is also need to be set to make use of the trigger ti_on_scene_prop_use.
And do you also not see the new string or does the string show up and just nothing happens?
 
Upvote 0
Solution

beratsalun

Recruit
Do you fullfill this conditions?

And do you also not see the new string or does the string show up and just nothing happens?
I didn't edit anything in module.ini
And about collision mesh, I have just copied a chest prop and renamed it as "gomu". Didn't anything in module_meshes.

I don't see a string, nothing shows up
 
Upvote 0

Eärendil Ardamírë

Subforum Moderator
WBWF&SM&B
You might have forgotten to add your scene prop within that list at game_get_use_string.
Code:
     (try_begin),
       (this_or_next|eq, ":scene_prop_id", "spr_winch_b"),
       (eq, ":scene_prop_id", "spr_winch"),
       (assign, ":effected_object", "spr_portcullis"),
     (else_try),
       (this_or_next|eq, ":scene_prop_id", "spr_door_destructible"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_f_door_b"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_e_sally_door_a"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_f_sally_door_a"),
       (this_or_next|eq, ":scene_prop_id", "spr_earth_sally_gate_left"),
       (this_or_next|eq, ":scene_prop_id", "spr_earth_sally_gate_right"),
       (this_or_next|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_left"),
       (this_or_next|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_right"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_f_door_a"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_6m"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_8m"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_10m"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_12m"),
       (eq, ":scene_prop_id", "spr_siege_ladder_move_14m"),
       (assign, ":effected_object", ":scene_prop_id"),
     (try_end),
Better show your full script (use the code tags environment) if you are unsure.
 
Upvote 0

beratsalun

Recruit
You might have forgotten to add your scene prop within that list at game_get_use_string.
Code:
     (try_begin),
       (this_or_next|eq, ":scene_prop_id", "spr_winch_b"),
       (eq, ":scene_prop_id", "spr_winch"),
       (assign, ":effected_object", "spr_portcullis"),
     (else_try),
       (this_or_next|eq, ":scene_prop_id", "spr_door_destructible"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_f_door_b"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_e_sally_door_a"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_f_sally_door_a"),
       (this_or_next|eq, ":scene_prop_id", "spr_earth_sally_gate_left"),
       (this_or_next|eq, ":scene_prop_id", "spr_earth_sally_gate_right"),
       (this_or_next|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_left"),
       (this_or_next|eq, ":scene_prop_id", "spr_viking_keep_destroy_sally_door_right"),
       (this_or_next|eq, ":scene_prop_id", "spr_castle_f_door_a"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_6m"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_8m"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_10m"),
       (this_or_next|eq, ":scene_prop_id", "spr_siege_ladder_move_12m"),
       (eq, ":scene_prop_id", "spr_siege_ladder_move_14m"),
       (assign, ":effected_object", ":scene_prop_id"),
     (try_end),
Better show your full script (use the code tags environment) if you are unsure.
I edited can_use_scene_props_in_single_player = 0 to can_use_scene_props_in_single_player = 1 in module.ini and it worked! Thank you very much
 
Upvote 0
Top Bottom