menus and item interaction

Users who are viewing this thread

Kosolov325

Recruit
Were i can found the menus like the button "i" and were i can found the messages whom emites from objects in orange like the doors "Open" ? I'm trying to do some custom things to my native server like to press F in a door and came a simple menu were says "lock, unlock" i already done the script, but i dont know how to make this menu or access the game menus or the message emited to change to Open for Closed
 
Solution
Use ti_on_scene_prop_use trigger. You can find many example of it in module_scene_props.py, mostly with doors.

Python:
("winch_b",sokf_moveable|spr_use_time(5),"winch_b","bo_winch", [
   (ti_on_scene_prop_use,
    [
      (store_trigger_param_1, ":agent_id"),
      (store_trigger_param_2, ":instance_id"),

      #for only server itself-----------------------------------------------------------------------------------------------
      (call_script, "script_use_item", ":instance_id", ":agent_id"),
      #for only server itself-----------------------------------------------------------------------------------------------
      (get_max_players, ":num_players"),                               
      (try_for_range, ":player_no", 1...
Use ti_on_scene_prop_use trigger. You can find many example of it in module_scene_props.py, mostly with doors.

Python:
("winch_b",sokf_moveable|spr_use_time(5),"winch_b","bo_winch", [
   (ti_on_scene_prop_use,
    [
      (store_trigger_param_1, ":agent_id"),
      (store_trigger_param_2, ":instance_id"),

      #for only server itself-----------------------------------------------------------------------------------------------
      (call_script, "script_use_item", ":instance_id", ":agent_id"),
      #for only server itself-----------------------------------------------------------------------------------------------
      (get_max_players, ":num_players"),                               
      (try_for_range, ":player_no", 1, ":num_players"), #0 is server so starting from 1
        (player_is_active, ":player_no"),
        (multiplayer_send_2_int_to_player, ":player_no", multiplayer_event_use_item, ":instance_id", ":agent_id"),
      (try_end),
    ]),
  ]),


Keep in mind its client-side feature. If you want to add "useable" property to any new item, you have to patch client mod as well.
But you can use props which already have property "usable" and change their code. That's how "teleporting doors" scripts are made.
 
Upvote 0
Solution
Back
Top Bottom