Author Topic: Anyone know how to use the new custom buttons and labels?  (Read 500 times)

0 Members and 1 Guest are viewing this topic.

Offline pete99

  • Sergeant
  • *
  • Posts: 66
  • Gang Warily
    • View Profile
  • Nick: Drummond
  • Side: Confederacy
Anyone know how to use the new custom buttons and labels?
« on: March 17, 2018, 01:49:11 am »
Hi,
I have been looking into using the custom button options for the new Napoleonic Wars Patch, but have run into a couple of problems (primarily with getting them to work from a server side).

In Module_Scene_Props I noticed 2 separate custom buttons options.

Five different versions of this, listed 1 second, 2 second and so on....
   ]),
  ]),
  ("custom_button_1_second",spr_use_time(1),"0","cannon_button_collision", [
    (ti_on_scene_prop_use,
    [        #add custom server side code here..
    ]),
  ]),


These I managed to get working fine from the server side by just adding the (multiplayer_is_server) command.

However when i use these ones and upload to my server they don't work--as in there is no 'use' label or anything...

#  ("custom_button_1_4seconds",spr_use_time(4),"0","cannon_button_collision", [
#    (ti_on_init_scene_prop,
#      [
#        (troop_set_name, "trp_custom_button_1_4seconds", "@Use Me"), # Set custom use string here, displayed when looking at button
#      ]),
#    (ti_on_scene_prop_use,
#    [        #add custom server side code here..
#    ]),
#  ]),

I'm assuming you are meant to take away the # which I have done. I also took away the # in front of all the 4 seconds ones in Module Troops.

["custom_button_1_4seconds","{!}custom_button_1_4seconds","{!}custom_button_1_4seconds",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],

Yet nothing appears to make them show up on the server.
I can only think it is somehow connected to this part of the script:

#    (ti_on_init_scene_prop,
#      [
#        (troop_set_name, "trp_custom_button_1_4seconds", "@Use Me"), # Set custom use string here, displayed when looking at button


And this leads to my second question: How do you create custom labels?

In Module_troops it talks about changing the troop name....but is the one you change in the custom_strings_[] section, or in this part....

["custom_button_1_4seconds","{!}custom_button_1_4seconds","{!}custom_button_1_4seconds",tf_hero|tf_inactive,0,reserved,fac_neutral,[],def_attrib,0,knows_common,0],

Finally, what exactly would you add/change in this line in the scene_props to make this custom label come into effect?

#        (troop_set_name, "trp_custom_button_1_4seconds", "@Use Me"), # Set custom use string here, displayed when looking at button

Would greatly appreciate any help on these issues and questions.

Offline Grozni

  • Second Lieutenant
  • *
  • Posts: 257
    • View Profile
  • Nick: Grozni_BloodAndHonor
  • Side: Neutral
Re: Anyone know how to use the new custom buttons and labels?
« Reply #1 on: March 19, 2018, 11:12:08 am »
Hello.
Some buttons and a few other scene props were removed atm (commented out) due to reasons.
Scene props that are commented out cannot be brought back as a server-side mod by removing # characters, clients will have no clue about them.

As for other question, the ways to set label text are either through modifying appropriate troop's name in module_troops.py or by example already given (troop_set_name, "trp_custom_button_1", "@Do not press this button"),