Author Topic: Naming Flags (coding?)  (Read 1514 times)

0 Members and 1 Guest are viewing this topic.

Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1661
  • Leader of 1er Suisse, Ski Instructor, Paintballer
    • View Profile
    • My Youtube Channel
  • Nick: J-Man11
  • Side: Union
Naming Flags (coding?)
« on: October 28, 2020, 08:26:04 pm »
So, I've been working on a map here which is a conquest map.  It works great, I've tested it, only one problem I don't know how to name the flags.  Picture attached below for what I mean that I don't want, and what I DO want (for example).

What I have, and don't want

[close]
What I want to have

[close]

Offline Zebaad

  • First Lieutenant
  • *
  • Posts: 879
  • alea iacta est
    • View Profile
    • Bastion Maps
  • Nick: 47th_Cpt_Zebaad_Peritz
  • Side: Union
Re: Naming Flags (coding?)
« Reply #1 on: October 28, 2020, 08:32:16 pm »
Ahh, sorry! Said I'd get to checking this for you and it slipped my mind! Ok so from memory you want to edit the strings.py in the source code- changing the "custom_flag_X" to the name you want to be used. You then need to adjust the flags in-game to display the corresponding custom flag name, so need the variable to suit (afraid this bit will need checking to find the values). Once you've built the module, you need to transfer the strings.txt file across to the server the map is to be used on.
I've assumed you have a grasp on the module system, so can translate what I've said, if not, there are several great tutorials on taleworlds for using the module system (relevant both in native and nw)


Offline Zebaad

  • First Lieutenant
  • *
  • Posts: 879
  • alea iacta est
    • View Profile
    • Bastion Maps
  • Nick: 47th_Cpt_Zebaad_Peritz
  • Side: Union
Re: Naming Flags (coding?)
« Reply #2 on: October 28, 2020, 08:51:55 pm »
OK,
following the above message;

Entery Points - Place the entry points near the flag you would like the team to spawn.
Entry point 64 = Team 1 flag
Entry point 65 = Team 2 flag

Scene Prop - Flag scene props for either team to cap.
headquarters_flag_red"    - Team 1 Flag
headquarters_flag_blue"  - Team 2 Flag
headquarters_flag_gray"  - Neutral Flag

For custom names, follow these steps-
  • Inside the scene editor, you must tell the game that your flags should show a different name. This is done by calling a value from the list of names which will be explained further down this post.
    Start by placing an item/ prop called spr_headquaters_base_flag_names.
    This prop is invisible, but once placed inside the map permits changes to its variables.
    example
    [close]
    In the above example, I have used Var1 of 1 and Var2 of 2, meaning team 1 headquaters flag is called the first item from the list, and team 2 flag is called the second item from the list.

    Next, we need to make sure any additional flags we place call from the same list.
    example
    [close]
    In the example, it calls the fifth flag from the list due to a Var1 of 5.
    Once you have made sure every flag has a unique variable, proceed to the next step.
  • Inside the module code, navigate to strings.py and open it up in an edditor (I use notepad++)
    From here, search for the term "custom_flag" and rename the second section of the name to anything you want, making sure to keep within the quotation marks and not using fancy characters.
    example
    [close]
    From here, simply save, build the module and transfer the ,sco map file and scene code as normal, but also the strings.txt generated when you build the module to the server files.

Let me know if I can clarify anything here! :)

*edit* been meaning to make a tutorial on this, plus all the other new additions to the game, but just not had the time :(
« Last Edit: October 28, 2020, 08:59:06 pm by Zebaad »


Offline Wolffe

  • Lieutenant Colonel
  • *
  • Posts: 1213
  • Bydand!
    • View Profile
    • 92nd Regiment of Foot
  • Nick: 92nd | Col | John Gordon
  • Side: Neutral
Re: Naming Flags (coding?)
« Reply #3 on: October 28, 2020, 11:36:22 pm »
You should try googling this stuff there’s loads of tutorials and threads about this :D

Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1661
  • Leader of 1er Suisse, Ski Instructor, Paintballer
    • View Profile
    • My Youtube Channel
  • Nick: J-Man11
  • Side: Union
Re: Naming Flags (coding?)
« Reply #4 on: October 30, 2020, 05:47:11 pm »
You should try googling this stuff there’s loads of tutorials and threads about this :D


I did, that's why I asked here

Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1661
  • Leader of 1er Suisse, Ski Instructor, Paintballer
    • View Profile
    • My Youtube Channel
  • Nick: J-Man11
  • Side: Union
Re: Naming Flags (coding?)
« Reply #5 on: October 30, 2020, 05:48:13 pm »
OK,
following the above message;

Entery Points - Place the entry points near the flag you would like the team to spawn.
Entry point 64 = Team 1 flag
Entry point 65 = Team 2 flag

Scene Prop - Flag scene props for either team to cap.
headquarters_flag_red"    - Team 1 Flag
headquarters_flag_blue"  - Team 2 Flag
headquarters_flag_gray"  - Neutral Flag

For custom names, follow these steps-
  • Inside the scene editor, you must tell the game that your flags should show a different name. This is done by calling a value from the list of names which will be explained further down this post.
    Start by placing an item/ prop called spr_headquaters_base_flag_names.
    This prop is invisible, but once placed inside the map permits changes to its variables.
    example
    [close]
    In the above example, I have used Var1 of 1 and Var2 of 2, meaning team 1 headquaters flag is called the first item from the list, and team 2 flag is called the second item from the list.

    Next, we need to make sure any additional flags we place call from the same list.
    example
    [close]
    In the example, it calls the fifth flag from the list due to a Var1 of 5.
    Once you have made sure every flag has a unique variable, proceed to the next step.
  • Inside the module code, navigate to strings.py and open it up in an edditor (I use notepad++)
    From here, search for the term "custom_flag" and rename the second section of the name to anything you want, making sure to keep within the quotation marks and not using fancy characters.
    example
    [close]
    From here, simply save, build the module and transfer the ,sco map file and scene code as normal, but also the strings.txt generated when you build the module to the server files.

Let me know if I can clarify anything here! :)

*edit* been meaning to make a tutorial on this, plus all the other new additions to the game, but just not had the time :(


Thanks, I'll give it a look when I'm back from work.  Everything you said I feel I've done, but I'll do it step by step.  And quick questions, if I'm renaming the "Custom flags", how do I differenciate between different maps.  From what I remember, those are just 1-20 or something, and not separate by map?

Offline Zebaad

  • First Lieutenant
  • *
  • Posts: 879
  • alea iacta est
    • View Profile
    • Bastion Maps
  • Nick: 47th_Cpt_Zebaad_Peritz
  • Side: Union
Re: Naming Flags (coding?)
« Reply #6 on: October 31, 2020, 09:22:02 am »
Thanks, I'll give it a look when I'm back from work.  Everything you said I feel I've done, but I'll do it step by step.  And quick questions, if I'm renaming the "Custom flags", how do I differenciate between different maps.  From what I remember, those are just 1-20 or something, and not separate by map?
One thing I think I forgot to say is you won't be able to see the custom flag names inside the game on a local server, you will need to upload both the scene and strings to a dedicated server in order for the list to be visible to players.
The ability to add custom flags was only added in V1.2 so a fairly recent change. Consequently the list only has I believe it's 50 custom flag names- and yes this list is global, so names can only be pulled from this list. My advise is keep names generic so they can be reused.


Offline Coldstreamer

  • First Lieutenant
  • *
  • Posts: 1661
  • Leader of 1er Suisse, Ski Instructor, Paintballer
    • View Profile
    • My Youtube Channel
  • Nick: J-Man11
  • Side: Union
Re: Naming Flags (coding?)
« Reply #7 on: November 02, 2020, 07:04:02 am »
Thanks, I'll give it a look when I'm back from work.  Everything you said I feel I've done, but I'll do it step by step.  And quick questions, if I'm renaming the "Custom flags", how do I differenciate between different maps.  From what I remember, those are just 1-20 or something, and not separate by map?
One thing I think I forgot to say is you won't be able to see the custom flag names inside the game on a local server, you will need to upload both the scene and strings to a dedicated server in order for the list to be visible to players.
The ability to add custom flags was only added in V1.2 so a fairly recent change. Consequently the list only has I believe it's 50 custom flag names- and yes this list is global, so names can only be pulled from this list. My advise is keep names generic so they can be reused.

Ok, and re-use I would use the same number?  Something like "River", "Forest", "Village", or "Fort" could work..