• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Timed Turn Based Fighting System

Status
Not open for further replies.
Level 3
Joined
Aug 18, 2016
Messages
42
Hello, I am a noob. I'm trying to build a D&D type map. What I mean by that is the units will be used as figurines and they will have custom spells and abilities to fight with. I have done quite a bit already, but one problem I am running into is that I want to create a system where players take turns after being assigned numbers for their turns. I also want them to have only 180 seconds or 3 min to make their turn before moving on to the next player.

I have a system for players to choose their heroes/figurines. I placed power circles on the ground in front of pre-placed hero units and gave the players whisps to use as indicators to choose which power circle to step on. When they step on the circle the whisp is removed and the players hero/figurine appears at a specified region.

Once the player gets their hero/figurine how to I tell the computer to "freeze" all the figurines on the map during a battle mode sequence?

One thing I've been tinkering with is changing the ownership of the players hero/figurine to neutral passive but then how do I tell the world editor to change the ownership back to the previous owner and then move on to the next player in the initiative sequence order?

I'm sorry if I haven't explained my problem well. If you feel that my question is lacking info please let me know. Maybe I can give you more details.

Also if you do have an answer for me please remember i'm a noob and I need it explained in a very simple way.

One last thing. I don't know if this is related to my first question or not but I need the heros/figurines to only move a certain distance. In the world of D&D it would be 30ft i'm not sure how to replicate that in the world editor.

Finally thank you for reading this and for any help you can give me.
 
Level 3
Joined
Aug 18, 2016
Messages
42
Would it be possible for player 1/Dungeon Master to type "-battle mode on" in order to start the Timed Turned Based Fighting Sequence?
 

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
Creating a turn based system is complicated for new mapmakers. I suggest working on something easier when youve just started mapping to gain experience, then progressively increase difficulty of your projects.

Judging from what you wrote you are an absolute beginner in terms of triggering. Recreating D&D combat mechanics is way beyond your current mapping skill.

Im not saying this to discourage you. Its just that mappers with way too ambitious projects usually get frustrated and waste their time on projects that will never see the light of day.
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
Creating a turn based system is complicated for new mapmakers. I suggest working on something easier when youve just started mapping to gain experience, then progressively increase difficulty of your projects.

Judging from what you wrote you are an absolute beginner in terms of triggering. Recreating D&D combat mechanics is way beyond your current mapping skill.

Im not saying this to discourage you. Its just that mappers with way too ambitious projects usually get frustrated and waste their time on projects that will never see the light of day.

This doesn't answer the question.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
As Zwiebelchen said, it's complicated, and there's many ways of going about it. He's trying to help you not repeat the same mistake most of us have made in the past.

But that aside...

Pausing units has the unwanted (but sometimes useful) effect of freezing a unit's buffs/debuffs. So say you cast Bloodrage on a unit, then pause it, the Bloodrage buff's timer will pause as well, and it will resume after the unit is Unpaused. This means the Bloodrage could last a lot longer than intended.

With that being said, how exactly do you want your map to work? The more details the better.

For example, would you want to use Pause knowing it pauses buffs? Or would you prefer changing the owner of the unit because that's possible as well. What happens if you attack one of these Paused/Changed units? Do they fight back? Etc...
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
As Zwiebelchen said, it's complicated, and there's many ways of going about it. He's trying to help you not repeat the same mistake most of us have made in the past.

But that aside...

Pausing units has the unwanted (but sometimes useful) effect of freezing a unit's buffs/debuffs. So say you cast Bloodrage on a unit, then pause it, the Bloodrage buff's timer will pause as well, and it will resume after the unit is Unpaused. This means the Bloodrage could last a lot longer than intended.

With that being said, how exactly do you want your map to work? The more details the better.

For example, would you want to use Pause knowing it pauses buffs? Or would you prefer changing the owner of the unit because that's possible as well. What happens if you attack one of these Paused/Changed units? Do they fight back? Etc...


For now I don't mind pausing the buffs, but I might look into that later on.

I uploaded my map to this post. Perhaps looking at it in world editor might give you a better perspective on what I'm trying to do. Basically i'm creating a D&D playing mat with live action figurines.

Also I think i ran into a new problem. When players choose their hero they sometimes get booted from the game.
 

Attachments

  • IMEK DND Map 2.w3x
    84.7 KB · Views: 22

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Here's an example map I threw together. Pick your units with the Wisp's Select Unit ability, then type -start to begin the game. Unit's can move for 5 seconds before they become Paused.

I'll check out your map now.
 

Attachments

  • D&D Example 1.w3m
    30.6 KB · Views: 27

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
I see already in your map you're going the hard route with everything.

What you want to do is store each Player's units in a Unit Group. This way you can interact with ALL of them whenever you want.

This way you can Pause ALL units belonging to a Player and Unpause ALL units belonging to a Player.

Edit: I see you were attempting to do that, but I'll show you a better way of going about it.

Oh and can you open my map? I'm using the latest patch (1.32+)


I attached a slightly edited version of your map with some examples of using Arrays and combining triggers to make things easier and more organized. I didn't implement everything you wanted as that will take some time but hopefully looking at this map and my D&D Example map will help you in some way.
 

Attachments

  • IMEK DND Map 2 Uncle 1.w3x
    86.1 KB · Views: 27
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
I see already in your map you're going the hard route with everything.

What you want to do is store each Player's units in a Unit Group. This way you can interact with ALL of them whenever you want.

This way you can Pause ALL units belonging to a Player and Unpause ALL units belonging to a Player.

Edit: I see you were attempting to do that, but I'll show you a better way of going about it.

Oh and can you open my map? I'm using the latest patch (1.32+)


I attached a slightly edited version of your map with some examples of using Arrays and combining triggers to make things easier and more organized. I didn't implement everything you wanted as that will take some time but hopefully looking at this map and my D&D Example map will help you in some way.

Thank you! I'll take a look at everything and post the results of my attempts. I have D&D tonight so around 7:30pm I'll have to try again tomorrow.
 
Level 3
Joined
Aug 18, 2016
Messages
42
I see already in your map you're going the hard route with everything.

What you want to do is store each Player's units in a Unit Group. This way you can interact with ALL of them whenever you want.

This way you can Pause ALL units belonging to a Player and Unpause ALL units belonging to a Player.

Edit: I see you were attempting to do that, but I'll show you a better way of going about it.

Oh and can you open my map? I'm using the latest patch (1.32+)

I attached a slightly edited version of your map with some examples of using Arrays and combining triggers to make things easier and more organized. I didn't implement everything you wanted as that will take some time but hopefully looking at this map and my D&D Example map will help you in some way.



So here's what I understand from looking at the adjustments you made to my map. Please correct me if I'm wrong and set me on the right path.

For DM Unit Command Setup trigger you are using variables instead of all the triggers i made to spawn units. A variable array of 1 to store the unit type, and a variable array of 1 to store the command to summon it.

For DM Type Spawn Unit trigger you are using For Loop to run an If_Then do_Else do. The condition is that the chat message is equal to one of the commands stored in the variable array of 1 called DM Unit Command from the DM Unit Command Setup trigger. You use "Integer A" as a way of saying "the number in the array that is associated with the text/string command used to summon each unit" and the main action is that the unit stored in the variable array of 1 called DM Unit Type is created in the middle of the camera view.

QUESTION: Is using variables better than using a bunch of triggers? Does that slow the game down?

For Battle Mode On trigger you use a chat message as an event and the action is to use a "Player Group - Pick every player and do actions loop" to set the player numbers into the integer variable "PN" that stores the number for each player that is "picked" (which I assume means: the slot that each person picks before the game) then you use the condition that "IF the PN number is NOT equal to no unit" to make sure that only people playing enter the Battle Mode. The action taken is to stop all actions of players, then pause all active players, and then make then able to take damage by removing the invulnerability.

For Battle Mode Off trigger the chat message -battle mode off is used as the event. The action is to use a "Player Group - Pick every player and do actions loop" and the condition is the same as Battle Mode On to make sure only people playing exit the Battle Mode. Then the actions are to un-pause every player number stored in the PN integer variable, stop all players actions, and then make all player units invulnerable again.

For Start Turn trigger the chat message -turn as A Substring is used as the event. I assume A = -turn and Substring = some text or a character. The actions are to set the variable PN (for player number) = 0 because it will be storing a new value that will be entered in the Substring. The next action taken is

Set VariableSet PN = (Integer((Substring((Entered chat string), 7, 7))))

I'm not sure but I think this action takes the text/string that comes after the chat command "-turn" and turns it into an integer number and then stores it into the variable PN. The next action is to run a If_Then do_Else do with the condition that the number stored in PN is a number between the numbers from 2 to 8 (which are the only slots available in this map). This number is chosen by the "-turn #" chat command. The condition also requires that "their turn" is equal to false. The actions taken are to store the value true in the Player_TurnIsActive boolean variable to indicate that it is a specific player's number or PN turn. The player's hero unit is unpaused. Wait 3 min or 180 seconds. Then pause the player's units. Then store false in the Player_TurnIsActive boolean variable to indicate its not their turn any more.

For the hero selection and hero repick i see that the PN variable is set for each particular player.

Sorry for writting all this, it helped me to understand what was going on as i went step by step. I think i understand much of the logic going on, I just have trouble finding the correct syntax, triggers, ect. Plus I need to use variables more.

Thank you for this information. Please let me know where I'm wrong in my long description of what you did in about 10 minutes of programming.

Also I'm re-uploading the map you sent me so you don't need to go off looking for it.
 

Attachments

  • IMEK DND Map 2 Uncle 1.w3x
    86.1 KB · Views: 31
Level 3
Joined
Aug 18, 2016
Messages
42
Can you please explain how this function works? Its a bit confusing for me. Set VariableSet PN = (Integer((Substring((Entered chat string), 7, 7))))
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
That sounds about right, nicely done.


And for the PN substring thing:

First i'm converting the String to an Integer, so that we can store it as PN.

Then i'm getting the substring followed by 2 Integers (7, 7 in this case).

What this allows you to do is find a specific portion of your string using a starting point and an end point.

The first Integer represents which character # you want to start at and the second Integer represents which character # you want to end at.

So i'm telling it to find the 7th to 7th character in the entered chat string, in other words, find the 7th character in the entered chat string.

So for example, if you typed: -turn 4

- = 1
t = 2
u = 3
r = 4
n = 5
(Space) = 6
4 = 7

So PN will be set to 4, because that's the 7th character in the entered chat string: -turn 4

Then I make sure that PN is a valid number, because nothing is stopping the player from typing an invalid Integer like 0 or 9, or not typing a number at all for the 7th character.

This is why I set PN to 0 before doing anything else, because if the player types for example: -turn pizza, it's going try to and set PN equal to p, which is impossible since an Integer cannot be equal to a String, and it will basically ignore this attempt at doing so and keep PN at 0. And since PN stays at 0 after typing this invalid command, our conditions won't be met (0 is not >= 2 and < 8) and the command will fail.
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
That sounds about right, nicely done.


And for the PN substring thing:

First i'm converting the String to an Integer, so that we can store it as PN.

Then i'm getting the substring followed by 2 Integers (7, 7 in this case).

What this allows you to do is find a specific portion of your string using a starting point and an end point.

The first Integer represents which character # you want to start at and the second Integer represents which character # you want to end at.

So i'm telling it to find the 7th to 7th character in the entered chat string, in other words, find the 7th character in the entered chat string.

So for example, if you typed: -turn 4

- = 1
t = 2
u = 3
r = 4
n = 5
(Space) = 6
4 = 7

So PN will be set to 4, because that's the 7th character in the entered chat string: -turn 4

Then I make sure that PN is a valid number, because nothing is stopping the player from typing an invalid Integer like 0 or 9, or not typing a number at all for the 7th character.

This is why I set PN to 0 before doing anything else, because if the player types for example: -turn pizza, it's going try to and set PN equal to p, which is impossible since an Integer cannot be equal to a String, and it will basically ignore this attempt at doing so and keep PN at 0. And since PN stays at 0 after typing this invalid command, our conditions won't be met (0 is not >= 2 and < 8) and the command will fail.


Thanks! that makes sense.

I just tested the map with me as DM and someone else as player blue. But when I activated battle mode on the player was booted from the game. I don't see why.
 
Level 3
Joined
Aug 18, 2016
Messages
42
Neither do I, it's a fairly simple trigger. Did you add any new triggers?

No new triggers.

Should redo the summoning system I have? In other words should I remove all the triggers to summon units and use only variables instead?
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Okay, I think the culprit is this: Camera - Target Of Current Camera.

You're using Camera - Target Of Current Camera in ALL of your DM Summon triggers, and I was using it in my example trigger as well.

This apparently causes desyncs. It looks like you might not have a choice but to redo the summoning system now, lol... :p

It'll pay off in the long run anyway, since it makes things a lot easier once it's all setup. For instance, say you wanted to add an ability to your created units, once this is setup you'll only have 1 trigger to edit instead of 100's.

I'll send you a map with a potential fix soon.
 
Level 3
Joined
Aug 18, 2016
Messages
42
Okay, I think the culprit is this: Camera - Target Of Current Camera.

You're using Camera - Target Of Current Camera in ALL of your DM Summon triggers, and I was using it in my example trigger as well.

This apparently causes desyncs. It looks like you might not have a choice but to redo the summoning system now, lol... :p

It'll pay off in the long run anyway, since it makes things a lot easier once it's all setup. For instance, say you wanted to add an ability to your created units, once this is setup you'll only have 1 trigger to edit instead of 100's.

I'll send you a map with a potential fix soon.

I would never have guessed that. Thanks a million. I'll redo the summoning system then. Dang... it took like 3 days. lol but now I know.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Sorry man, maybe test this out first to see if it actually works before deleting everything.

But i'm confident this was the source of your problems based on what I read here: [Solved] - Target of (Current Camera) desync

And here's your map, I organized your folders/triggers slightly (sorry I have ocd about these things) and implemented the fix to Camera Target.

Edit: To clarify, the fix to Camera Target is only being used in my example Summon trigger, your other Summon triggers still desync.
 

Attachments

  • IMEK DND Map 2 Uncle 2.w3x
    86.7 KB · Views: 27
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
Sorry man, maybe test this out first to see if it actually works before deleting everything.

But i'm confident this was the source of your problems based on what I read here: [Solved] - Target of (Current Camera) desync

And here's your map, I organized your folders/triggers slightly (sorry I have ocd about these things) and implemented the fix to Camera Target.

Edit: To clarify, the fix to Camera Target is only being used in my example Summon trigger, your other Summon triggers still desync.

Thanks! I'm going to start working on it now. Also I was wondering is there a way to automatically print the names of the variables for the summoning system? I want to make a list of all units available for the DM to summon. That way he can reference the list and then type the command.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Yeah, you can print the names of units like so.
  • Actions
    • Game - Display to (All players) for 30.00 seconds the text: (Name of (Triggering unit))
    • Game - Display to (All players) for 30.00 seconds the text: (Unit: (Triggering unit)'s String Field: Name ('unam'))
    • Game - Display to (All players) for 30.00 seconds the text: (Unit: (Triggering unit)'s String Field: Proper Names ('upro'))
    • Game - Display to (All players) for 30.00 seconds the text: (String((Unit-type of (Triggering unit))))
Edit: But forget those, you already have a list of -command Strings. Do this:
  • Display Commands
    • Events
      • Player - Player 1 (Red) types a chat message containing -Unit Commands as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to DM_TotalUnitTypes, do (Actions)
        • Loop - Actions
          • Game - Display to Player Group - Player 1 (Red) for 30.00 seconds the text: DM_UnitCommand[(Integer A)]
That'll display:
-peasant
-footman
-knight
etc...
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
Yeah, you can print the names of units like so.
  • Actions
    • Game - Display to (All players) for 30.00 seconds the text: (Name of (Triggering unit))
    • Game - Display to (All players) for 30.00 seconds the text: (Unit: (Triggering unit)'s String Field: Name ('unam'))
    • Game - Display to (All players) for 30.00 seconds the text: (Unit: (Triggering unit)'s String Field: Proper Names ('upro'))
    • Game - Display to (All players) for 30.00 seconds the text: (String((Unit-type of (Triggering unit))))
Edit: But forget those, you already have a list of -command Strings. Do this:
  • Display Commands
    • Events
      • Player - Player 1 (Red) types a chat message containing -Unit Commands as An exact match
    • Conditions
    • Actions
      • For each (Integer A) from 1 to DM_TotalUnitTypes, do (Actions)
        • Loop - Actions
          • Game - Display to Player Group - Player 1 (Red) for 30.00 seconds the text: DM_UnitCommand[(Integer A)]
That'll display:
-peasant
-footman
-knight
etc...


Ooops I already deleted my old summoning system. I'm half way done making the new one that you showed me. One thing I want to do in addition to being able to type the -command Strings, is have a clickable menu with icons for each unit so that the DM can see the different units available to him. I want to make it a drop down menu that sits at the top of the screen.

I'll post my map once I finish the summoning system you showed me.

Thank you sooooo much for helping me. Once I finish this map I'll definitely give you credit for helping and guiding me.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
No problem, and if you want a drop down menu with Icons then you'll have to use the new UI tools (requires Jass or Lua). You'll also need to write down every single unit's Icon Path if you want to display their icon.

Example:
Footman's Icon Path: ReplaceableTextures\CommandButtons\BTNFootman.blp

I could create this for you fairly easily and have it setup so you can customize it and add new Units/Icons to it. Let me know if you want me to do this.
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
No problem, and if you want a drop down menu with Icons then you'll have to use the new UI tools (requires Jass or Lua). You'll also need to write down every single unit's Icon Path if you want to display the icon.

Example:
Footman's Icon Path: ReplaceableTextures\CommandButtons\BTNFootman.blp

I could create this for you fairly easily and have it setup so you can customize it and add new Units/Icons to it. Let me know if you want me to do this.

Sadly I'm not fully capable of programming. And I've never even worked with JASS or Lua. If you are willing to do this for me I would gladly appreciate it. Yes thank you.

I just want to make this map for people to use for fun. I'm not looking to impress anyone with my weak skills. I want the map to be as good as it can be. That's why i'm trying so hard.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Here it is, a fully customizable UI system for creating units.

At the moment it's setup so you can organize your Units into 20 different categories, each category hosting up to 50 Unit-Types.

I added two examples, Human and Orc, that should help make it clear how to use the system yourself.

It'll be quite some work to get all of the unit's Icon Paths but I think it'll be worth it in the long run! Plus I can help you with that if you'd like.

The categorization will also add some extra work as you'll have to break the units apart into groups, but I don't think that'd be too difficult once you have all of the variables setup for each Unit-Type/Unit Command.

Let me know when you're finished with the new Summoning System and I can help you implement this into your map.
 

Attachments

  • IMEK DND Map 2 Uncle 3.w3x
    130.4 KB · Views: 27
Level 3
Joined
Aug 18, 2016
Messages
42
Here it is, a fully customizable UI system for creating units.

At the moment it's setup so you can organize your Units into 20 different categories, each category hosting up to 50 Unit-Types.

I added two examples, Human and Orc, that should help make it clear how to use the system yourself.

It'll be quite some work to get all of the unit's Icon Paths but I think it'll be worth it in the long run! Plus I can help you with that if you'd like.

The categorization will also add some extra work as you'll have to break the units apart into groups, but I don't think that'd be too difficult once you have all of the variables setup for each Unit-Type/Unit Command.

Let me know when you're finished with the new Summoning System and I can help you implement this into your map.


Thank you! I am still currently working on the Summoning System. I'll post my status when i'm done.
 
Level 3
Joined
Aug 18, 2016
Messages
42
Here it is, a fully customizable UI system for creating units.

At the moment it's setup so you can organize your Units into 20 different categories, each category hosting up to 50 Unit-Types.

I added two examples, Human and Orc, that should help make it clear how to use the system yourself.

It'll be quite some work to get all of the unit's Icon Paths but I think it'll be worth it in the long run! Plus I can help you with that if you'd like.

The categorization will also add some extra work as you'll have to break the units apart into groups, but I don't think that'd be too difficult once you have all of the variables setup for each Unit-Type/Unit Command.

Let me know when you're finished with the new Summoning System and I can help you implement this into your map.


So I'm still working on the summoning system, but I found a break-through. Basically I'm using the program WinTask to automate data entry.

For example: the variable below has the wrong number next to it. It shouldn't be "210" it should be "211".
Set VariableSet DM_UnitCommand[210] = -knight

Using WinTask and Excel I was able to automate changing the numbers in the different variables all the way to the number "613"

But now I have a new problem. For the other set of variables in the new summoning system that you showed me I was changing the numbers manually (by clicking and typing) and so I entered the wrong numbers starting from "303" all the way to the end.

For example: It shouldn't be "303" it should be "213"
Set VariableSet DM_UnitType[303] = Treant

But I don't know how to tell WinTask to automate changing the number values for this variable.

Below is an example the code that WinTask created for me.

---------------------------------------------------

Shell(Chr$(34)+"C:\Users\Name\Desktop\IMEK DND Map 1.2.w3x"+Chr$(34),1)

UseWindow("EXPLORER.EXE|SHELLDLL_DefView|Program Manager|1",1)
ChooseItem(ListView, "1", "IMEK DND Map 1.2.w3x", single, right )
ChooseMenu(Context,"Open wit&h|Warcraft III World Editor")

UseWindow("WORLD|OsWindow|Warcraft III World Editor - [C:/Users/name/Desktop/IMEK DND Map 1.2.w3x]",1)
ChooseItem(ToolBar, "|1", "Trigger Editor (F4)", single, left )

UseWindow("WORLD|#32770|Trigger Editor",1)
ChooseItem(TreeView, "1", "DM Unit Commands Setup", single, left )
ChooseItem(TreeView, "2", "Set VariableSet DM_UnitType[302] = Druid of the Claw (Bear Form)", double, left )

UseWindow("WORLD|#32770|Configure Action",1)
Click(Button,"302")

UseWindow("WORLD|#32770|Integer",1)
WriteEdit("1","212")
Click(Button,"&OK")

UseWindow("WORLD|#32770|Configure Action",1)
Click(Button,"&OK")

-------------------------------------------------------------

If you look you will see that the number "302" is referred to as a Click Button with the name "302". How can I tell WinTask to click every 2nd button in the pop up window and not just button "302"?

See the attachment for an example of what I mean by 2nd Button.

Example of Button 2.JPG


Just so you know the buttons number increases starting from "302" all the way to "713" because I skipped 100 numbers and kept on going all the way to "713" rather than stopping at "613" as I should have. This was before I started using WinTask...

I'm not not really a good programmer so I don't know what to type. If I can't do this it will take another 3 days to finish.
 
Level 3
Joined
Aug 18, 2016
Messages
42
Do you think you'll need Pages added to the UI system? Would 50 units per category be enough or are there say more than 50 Night Elf units?

And can you send me your map please? I'll see if I can fix your current issue.


Pages would be nice. I was thinking the same thing. Here is my map. It has NOT been updated by the last map you sent me "IMEK DND Map 2 Uncle 3"

See the attachment.
 

Attachments

  • IMEK DND Map 1.2.w3x
    59.5 KB · Views: 17

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
So I think I found a good solution. I converted the trigger to Custom Text so it was no longer in GUI form and implemented a new Integer called DM_Index. This Integer is used as the Index [] for the variables.

You'll see that it isn't finished though. I have DM_Index increasing by 1 for every new variable, but it's not being used as the Index [].

Basically, you need to Find & Replace all Integers in the script with: udg_DM_Index

Also, you might want to do this AFTER you've finished filling out the correct information for the units in GUI. What I mean is I see that some units don't have the correct -command yet, and maybe you should fix this before converting to Custom Text. Then again, you can always edit it while it's in Text form as well.

To convert a trigger to Custom Text, Select the trigger, go to Edit, and click "Convert to Custom Text".

Note that converting to Custom Text is irreversible.
 

Attachments

  • IMEK DND Map Custom Text.w3x
    56 KB · Views: 20
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
So I think I found a good solution. I converted the trigger to Custom Text so it was no longer in GUI form and implemented a new Integer called DM_Index. This Integer is used as the Index [] for the variables.

You'll see that it isn't finished though. I have DM_Index increasing by 1 for every new variable, but it's not being used as the Index [].

Basically, you need to Find & Replace all Integers in the script with: udg_DM_Index

Also, you might want to do this AFTER you've finished filling out the correct information for the units in GUI. What I mean is I see that some units don't have the correct -command yet, and maybe you should fix this before converting to Custom Text. Then again, you can always edit it while it's in Text form as well.

To convert a trigger to Custom Text, Select the trigger, go to Edit, and click "Convert to Custom Text".

Note that converting to Custom Text is irreversible.

This will work out great! Thank you! I'm going to copy the text into excel and manipulate the numbering to what I need then paste it back. I'll have to do it tomorrow morning as it is late now.

I will also need to learn how to import the triggers and stuff you made for the GUI Unit Choosing System. I don't know how to add that to the map you just sent me.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Just copy and paste em. Make sure you have this enabled first: Automatically create unknown variables while pasting trigger data

It can be found under File/Preferences/General in the Editor.

Also, I think I found a solution to the -Command thing that makes it unneeded. This may be a lot easier than we had initially thought, lol...

Edit: I figured out how to edit it in VSC. I fixed the Indexes (replaced them with udg_DM_Index) and I removed the -Command. I found that since we're storing the unit-types, we also have access to the names of these unit-types (Get name of unit-type) and can use these as the commands.

I'm working on combining everything together so don't worry about that.
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
Just copy and paste em. Make sure you have this enabled first: Automatically create unknown variables while pasting trigger data

It can be found under File/Preferences/General in the Editor.

Also, I think I found a solution to the -Command thing that makes it unneeded. This may be a lot easier than we had initially thought, lol...

Edit: I figured out how to edit it in VSC. I fixed the Indexes (replaced them with udg_DM_Index) and I removed the -Command. I found that since we're storing the unit-types, we also have access to the names of these unit-types (Get name of unit-type) and can use these as the commands.

I'm working on combining everything together so don't worry about that.

wow lol that sounds really good!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Alright, so there are some cases where using Get unit-type name returns a weird value. For example, all of the Cart units (diablo cart, lich cart, etc) use "siegeengine" as their names. I'm going to add back in -Command but make it so it's an optional feature. So if there any units (and it seems to only be a few here and there) that have conflicting -commands (like the carts) you can give them a -Command and the system will use this alternate command instead.

After that's done, we will be left with 2 more things to do:

1) Organize the 613 Units into their respective categories. Luckily I saw that you organized them yourself to an extent.

2) Go through the long process of writing down every single unit's name and associated Icon.
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
Alright, so there are some cases where using Get unit-type name returns a weird value. For example, all of the Cart units (diablo cart, lich cart, etc) use "siegeengine" as their names. I'm going to add back in -Command but make it so it's an optional feature. So if there any units (and it seems to only be a few here and there) that have conflicting -commands (like the carts) you can give them a -Command and the system will use this alternate command instead.

After that's done, we will be left with 2 more things to do:

1) Organize the 613 Units into their respective categories. Luckily I saw that you organized them yourself to an extent.

2) Go through the long process of writing down every single unit's name and associated Icon.


I found this website that lists all the units in their categories already. Warcraft III units

I copied them to a word document. See the attachment.
 

Attachments

  • War3 Units List.docx
    17.9 KB · Views: 22

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
I figured out how to get the Unit Icons without needing to write them down myself, so most of the work is already done!

Was that list of 613 units the completed list? Because it's missing a bunch of Neutral units from your original DM Commands.
 
Level 3
Joined
Aug 18, 2016
Messages
42
I figured out how to get the Unit Icons without needing to write them down myself, so most of the work is already done!

Was that list of 613 units the completed list? Because it's missing a bunch of Neutral units from your original DM Commands.
I figured out how to get the Unit Icons without needing to write them down myself, so most of the work is already done!

Was that list of 613 units the completed list? Because it's missing a bunch of Neutral units from your original DM Commands.


There's just so many units lol I was losing track. I really appreciate you doing this.

Here are a few more things I would like to do with this D&D map.

-I would like to replicate a list of custom spells and abilities from the actual D&D 5th edition game
-I would like to limit the distance units can walk (In D&D its 30ft) of all units in battle mode
-I would like to give the Dungeon Master the option to create multiple battle modes so that when players separate from the group different battle can take place
-I would like to create custom units
-I would like to create custom Item from the D&D 5th edition game
-I would like to give players the option to create their hero based off the choices from the actual D&D 5th edition game
-I would like to give the DM the ability to create any type of unit/hero and then give ownership to a player
-I would like to give the DM the ability to create any type of Item and then give ownership to a player

Basically I'm making a war3 d&d type map.

I don't expect you to do everything for me, but if you could continue to point me in the correct direction I'll do the grunt work.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Sounds like quite the endeavor!

1) Seems easily manageable as long as the abilities aren't too complex
2) I have shown you how to do this with a timer in that one example map, it didn't track distance but it allowed you to be in the "moving" state for up to 5.00 seconds
3) Not entirely sure what this means, as I'm still confused as to what "battle modes" are to begin with
4) The UI system may need tweaking for custom units but it should work for the most part
5) Seems easy enough, custom units are simple to create
6) Could be simple, could be complex, not sure what stats exist in D&D and how they would be implemented into wc3
7) Well, you have the creation part down, changing ownership of a unit is 1 simple Action
8) Time to save every single item into an Array like we did with the Unit-Types

Anyway, I have my own project to work on and I've procrastinated long enough. I hope you enjoy the UI menu and can understand how to add onto it, I can write instructions for you on here if you'd like.

Of course i'll still be here to answer any questions you have. You can PM me as well.
 
Level 3
Joined
Aug 18, 2016
Messages
42
Sounds like quite the endeavor!

1) Seems easily manageable as long as the abilities aren't too complex
2) I have shown you how to do this with a timer in that one example map, it didn't track distance but it allowed you to be in the "moving" state for up to 5.00 seconds
3) Not entirely sure what this means, as I'm still confused as to what "battle modes" are to begin with
4) The UI system may need tweaking for custom units but it should work for the most part
5) Seems easy enough, custom units are very basic
6) Could be simple, could be complex, not sure what stats exist in D&D and how they would be implemented into wc3
7) Well, you have the creation part down, changing ownership of a unit is 1 simple Action
8) Time to save every single item into an Array like the Unit-Types

Anyway, I have my own project to work on and I've procrastinated long enough. I hope you enjoy the UI menu and can understand how to add onto it, I can write instructions for you on here if you'd like.

Of course i'll still be here to answer any questions you have. You can PM me as well.

Thank you for your existence!!!

Also...

3) A battle mode is a term I use to describe an encounter in D&D but in a warcraft 3 custom map. Here is a link to an explanation of a D&D combat encounter Combat | D&D 5th Edition on Roll20 Compendium
8) Actually I think I only want to use custom items for the D&D map
 
Level 3
Joined
Aug 18, 2016
Messages
42
You'd still use an Array for custom items, unless by custom you mean like CUSTOM. As in not using the standard Wc3 Inventory system (so more like a custom UI inventory).

I'm not sure yet. Also, I'm still trying to wrap my mind around all work you did. You are amazing!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
Instructions

How to add a new Category:

Step 1: Copy and paste an existing category Folder, like Human.
Step 2: Re-name both of it's Setup and Add triggers, and then proceed to configure the Setup trigger, followed by the Add trigger.

Here's the Setup trigger for the Village units. Let's say this is a copy and pasted version and you plan on replacing this with a new category of Barren's Units. Simply delete everything from //Village Start to //Village end, but do NOT delete the function stuff. Also, you need to rename this line: function Setup_DM_Village_Units takes nothing returns nothing. Simply replace the word Village with the name of your new Category: function Setup_DM_Barrens_Units takes nothing returns nothing. Then proceed to paste the data for the Barren's units inside, pasting it right below the top line. When it's pasted and all is said and done proceed to the Add trigger.
Code:
function Setup_DM_Village_Units takes nothing returns nothing
//You'll need to run this Function in your Add Category trigger
//Village Start
set udg_DM_Index = udg_DM_Index + 1

set udg_DM_UnitType[udg_DM_Index] = 'nsqt'

set udg_DM_Index = udg_DM_Index + 1

set udg_DM_UnitType[udg_DM_Index] = 'nsqe'

set udg_DM_Index = udg_DM_Index + 1

set udg_DM_UnitType[udg_DM_Index] = 'nsqo'

set udg_DM_Index = udg_DM_Index + 1

set udg_DM_UnitType[udg_DM_Index] = 'nsqa'

//Village End
endfunction
We're now replacing the contents of the Add Village trigger. This one is pretty straightforward, you can set the Category Icon and Category Name to whatever you'd like. The only important thing to do here is to edit this line of code: Custom script: call Setup_DM_Village_Units(). This is calling the Village Setup Function that we were just messing with above. See the problem? It's still referencing the Village function and should instead be referencing the Barrens function. So change this Custom script to say: call Setup_DM_Barrens_Units().
BEFORE:
  • Add Village Copy
    • Events
    • Conditions
    • Actions
      • -------- Add a new Category to the System --------
      • Set VariableSet DM_Category_Icon = ReplaceableTextures\CommandButtons\BTNFarm.blp
      • Set VariableSet DM_Category_Name = Village
      • -------- --------
      • -------- Call the Setup Village Units function (this is found in the Setup Village Units trigger) --------
      • Custom script: call Setup_DM_Village_Units()
      • -------- --------
      • -------- Run this last! --------
      • Trigger - Run DM Add New Category <gen> (ignoring conditions)
AFTER:
  • Add Barrens
    • Events
    • Conditions
    • Actions
      • -------- Add a new Category to the System --------
      • Set VariableSet DM_Category_Icon = ReplaceableTextures\CommandButtons\BTNTent.blp
      • Set VariableSet DM_Category_Name = Barrens
      • -------- --------
      • -------- Call the Setup Barrens Units function (this is found in the Setup Barrens Units trigger) --------
      • Custom script: call Setup_DM_Barrens_Units()
      • -------- --------
      • -------- Run this last! --------
      • Trigger - Run DM Add New Category <gen> (ignoring conditions)
Step 3:
Last and easiest step. Go into the DM Command Setup trigger and Run your newly created Add Barrens trigger. You'll see the other Category Trigger's being Run there, simply copy and paste one of those and adjust it's value to reference your Add Barrens trigger. The order in which you run these triggers will determine the order of the Categories in the UI Menu (1st trigger = category 1, 2nd trigger = category 2, etc...):
  • Trigger - Run Add Barrens <gen> (ignoring conditions)
Some extra info:

So if you look at the Setup Human Units trigger you'll see a bunch of code like this.
Code:
    set udg_DM_Index = udg_DM_Index + 1
 
    set udg_DM_UnitType[udg_DM_Index] = 'hhes'
 
    set udg_DM_Index = udg_DM_Index + 1
 
    set udg_DM_UnitType[udg_DM_Index] = 'hcth'
 
    set udg_DM_Index = udg_DM_Index + 1

    set udg_DM_UnitType[udg_DM_Index] = 'hrrh'
    set udg_DM_AltCommand[udg_DM_Index] = "runner"
 
    set udg_DM_Index = udg_DM_Index + 1
 
    set udg_DM_UnitType[udg_DM_Index] = 'nccd'
    set udg_DM_AltCommand[udg_DM_Index] = "diablocart"
 
    set udg_DM_Index = udg_DM_Index + 1
 
    set udg_DM_UnitType[udg_DM_Index] = 'nccr'
    set udg_DM_AltCommand[udg_DM_Index] = "dwarfcart"
 
    set udg_DM_Index = udg_DM_Index + 1
 
    set udg_DM_UnitType[udg_DM_Index] = 'ncco'
    set udg_DM_AltCommand[udg_DM_Index] = "orccart"
 
    set udg_DM_Index = udg_DM_Index + 1
 
    set udg_DM_UnitType[udg_DM_Index] = 'nccu'
    set udg_DM_AltCommand[udg_DM_Index] = "undeadcart"
 
    set udg_DM_Index = udg_DM_Index + 1
 
    set udg_DM_UnitType[udg_DM_Index] = 'nwar'
    set udg_DM_AltCommand[udg_DM_Index] = "warwagon"
Essentially what this trigger is doing is storing all of the Human units in a list:
DM_UnitType[1] = Peasant
DM_UnitType[2] = Footman
DM_UnitType[3] = Knight
etc...

You'll also see in that snippet of code the use of DM_AltCommand.
What DM_AltCommand allows you to do is change the "-command" that the DM has to type in order to spawn the unit.

The reason most units DON'T have an AltCommand is because they work without the need of one. Unfortunately, the automated system that they all use "Get unit-type name" isn't fullproof, and in some cases like the Diablo Cart (and all of the Carts for that matter) they were all using the same command -siegeengine. So I added this variable so you can create an exception for these units and use the AltCommand instead.
 
Last edited:
Level 3
Joined
Aug 18, 2016
Messages
42
You'd still use an Array for custom items, unless by custom you mean like CUSTOM. As in not using the standard Wc3 Inventory system (so more like a custom UI inventory).

I know you are busy but I ran into some issues.

Ok so I tested the map out with my friend and there is a problem with the UI summoning system. All the players are able to see it when it should only be for the DM.

Also, the battle mode system you made doesn't work for some reason.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,510
I know you are busy but I ran into some issues.

Ok so I tested the map out with my friend and there is a problem with the UI summoning system. All the players are able to see it when it should only be for the DM.

Also, the battle mode system you made doesn't work for some reason.
Ask them how much of it that they can see. There's buttons, icons, text (categories/unit text), and the window that encompasses it all. Do they see all of that stuff? Because I have code in there that should prevent them from seeing it but I may have missed some things.
 
Level 3
Joined
Aug 18, 2016
Messages
42
Ask them how much of it that they can see. There's buttons, icons, text (categories/unit text), and the window that encompasses it all. Do they see all of that stuff? Because I have code in there that should prevent them from seeing it but I may have missed some things.

He's offline right now. But when we played I think he saw everything. He was able to open the category window, but I told him not to use it so I don't know for sure what he could see.
 
Status
Not open for further replies.
Top