Author Topic: Editing Ze Treasure  (Read 784 times)

0 Members and 1 Guest are viewing this topic.

Offline Vileius Scoundralis

  • Volunteer
  • *
  • Posts: 3
    • View Profile
Editing Ze Treasure
« on: February 16, 2018, 06:13:34 pm »
How would I go about editing Ze Treasure to give certain things based on the variable number (Which would be server-side)?

Offline Noorwegian

  • Senior Moderator
  • **
  • Posts: 4164
  • Слава Павловскому!
    • View Profile
    • 85e Regiment
  • Side: Confederacy
Re: Editing Ze Treasure
« Reply #1 on: February 16, 2018, 06:15:26 pm »
Nothing really too complicated about it.   just need to change 2 lines of code if you are changing what what they give.

Spoiler
("ze_treasure",spr_use_time(4),"chest_b","bo_ze_treasure", [
    (ti_on_scene_prop_use,
    [
      (store_trigger_param_1, ":agent_id"),
      #(store_trigger_param_2, ":instance_id"),

      #(neg|scene_prop_slot_eq, ":instance_id", scene_prop_slot_just_fired, 1), # abuse just_fired for already used.
     
      (agent_is_active,":agent_id"),
      (agent_is_alive,":agent_id"),
     
      # remove his shit.
      #(try_for_range_backwards,":equipment_slot",0,4), # ,ek_item_0,ek_head),
      #  (agent_get_item_slot, ":item_id", ":agent_id", ":equipment_slot"),
       
      #  (gt,":item_id",-1), # even have a item there?
       
      #  (agent_unequip_item, ":agent_id", ":item_id", ":equipment_slot"),
      #(try_end),
      (try_begin),
        (agent_get_item_slot, ":item_id", ":agent_id", 4), #ek_head
        (gt,":item_id",-1), # even have a item there?
        (agent_unequip_item, ":agent_id", ":item_id", 4), #ek_head
      (try_end),
     
      # add ze goodies.
      (agent_equip_item,":agent_id","itm_pirate_hat"),
      #(agent_equip_item,":agent_id","itm_french_officer_pistol"),
      #(agent_equip_item,":agent_id","itm_pistol_ammo"),
      #(agent_equip_item,":agent_id","itm_spyglass"),
      #(agent_equip_item,":agent_id","itm_french_light_cav_off_sabre"),
     
      #(agent_set_wielded_item,":agent_id","itm_french_officer_pistol"),
     
      #(scene_prop_set_slot,":instance_id",scene_prop_slot_just_fired,1),
     
      (try_for_players, ":player_no", 1),
        (player_is_active, ":player_no"),
        (multiplayer_send_3_int_to_player, ":player_no", multiplayer_event_return_agent_set_item, ":agent_id", "itm_pirate_hat", 4),
      (try_end),
    ]),
  ]),
[close]

Offline Vileius Scoundralis

  • Volunteer
  • *
  • Posts: 3
    • View Profile
Re: Editing Ze Treasure
« Reply #2 on: February 16, 2018, 06:19:07 pm »
Nothing really too complicated about it.   just need to change 2 lines of code if you are changing what what they give.

Spoiler
("ze_treasure",spr_use_time(4),"chest_b","bo_ze_treasure", [
    (ti_on_scene_prop_use,
    [
      (store_trigger_param_1, ":agent_id"),
      #(store_trigger_param_2, ":instance_id"),

      #(neg|scene_prop_slot_eq, ":instance_id", scene_prop_slot_just_fired, 1), # abuse just_fired for already used.
     
      (agent_is_active,":agent_id"),
      (agent_is_alive,":agent_id"),
     
      # remove his shit.
      #(try_for_range_backwards,":equipment_slot",0,4), # ,ek_item_0,ek_head),
      #  (agent_get_item_slot, ":item_id", ":agent_id", ":equipment_slot"),
       
      #  (gt,":item_id",-1), # even have a item there?
       
      #  (agent_unequip_item, ":agent_id", ":item_id", ":equipment_slot"),
      #(try_end),
      (try_begin),
        (agent_get_item_slot, ":item_id", ":agent_id", 4), #ek_head
        (gt,":item_id",-1), # even have a item there?
        (agent_unequip_item, ":agent_id", ":item_id", 4), #ek_head
      (try_end),
     
      # add ze goodies.
      (agent_equip_item,":agent_id","itm_pirate_hat"),
      #(agent_equip_item,":agent_id","itm_french_officer_pistol"),
      #(agent_equip_item,":agent_id","itm_pistol_ammo"),
      #(agent_equip_item,":agent_id","itm_spyglass"),
      #(agent_equip_item,":agent_id","itm_french_light_cav_off_sabre"),
     
      #(agent_set_wielded_item,":agent_id","itm_french_officer_pistol"),
     
      #(scene_prop_set_slot,":instance_id",scene_prop_slot_just_fired,1),
     
      (try_for_players, ":player_no", 1),
        (player_is_active, ":player_no"),
        (multiplayer_send_3_int_to_player, ":player_no", multiplayer_event_return_agent_set_item, ":agent_id", "itm_pirate_hat", 4),
      (try_end),
    ]),
  ]),
[close]

Which part of that would be the variable, If you don't mind me asking?

Offline Thunderstormer

  • FSE Developer
  • ****
  • Posts: 5946
  • Worse than Hotler
    • View Profile
  • Side: Neutral
Re: Editing Ze Treasure
« Reply #3 on: February 16, 2018, 06:25:45 pm »
if you want to do stuff based on the variable one or two,(or both) you will have to get the variable of the prop in question(their are operations for that), check what the value is, and then code in what will happen if the variable = the value you want.  you can find examples of that in the code.  just look around the various files and see how it works.
Should you need to talk to me regarding NA1 or or something regarding admining or the admins, PM me here on the forums and not on steam.  *

*This does not include Official Server Admins.

Offline Vileius Scoundralis

  • Volunteer
  • *
  • Posts: 3
    • View Profile
Re: Editing Ze Treasure
« Reply #4 on: February 16, 2018, 06:26:37 pm »
if you want to do stuff based on the variable one or two,(or both) you will have to get the variable of the prop in question(their are operations for that), check what the value is, and then code in what will happen if the variable = the value you want.  you can find examples of that in the code.  just look around the various files and see how it works.

Thanks!