• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

A Few Questions (Triggers)

Status
Not open for further replies.
Level 12
Joined
Jun 10, 2008
Messages
1,043
Ok so I'm making this map sort of like the Total War series, one of the maps from teh project I'm working on. I have a few question regarding triggers (I do not have JASS)

1. Like in Total War games, 1 unit (General) could represent anywhere from 10-500 units in battle mode. How would I make the game remember (Game Caches?) and add/subtract units that die/join the army?

2. In battle mode, you control each squad's captain. The rest are controlled by an NPC, and follow you. I need to make it so they follow you while staying in formation, attacking anything your squad captain attacks, and if they defeat an enemy, continue to follow the general when he moves again.

3. When besiegeing a castle, the game should remember for how many turns and what weapons were constructed to breach the walls meanwhile.

4. How would I make each squad be able to move only for a limited area? My idea was having each squad mvoe for 5 seconds, and adjustin their movement speed... how would I deduct seconds each turn?

5. How would I make it turn-based and show all AI moves?

I realize this is maybe impossible without JASS, but if there is a GUI/MUI solution, please tell me S:
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Hashtables can easily store all kinds of data.

You can use hastables in problmes 1, 2 and 3. Also in 2, calculate an offset point for each squad member based on the generals's position. You can also link units/unit groups to the general by saving handles.

All these are possible without JASS. It just seems you need someone to do the systems for you.
 
Level 12
Joined
Jun 10, 2008
Messages
1,043
I'm not very good when it comes to triggering :S can somebody please show me how to trigger this? I've never really worked with hashtables... I'll +rep and give credits in map
 
Level 12
Joined
Jan 30, 2009
Messages
1,067
You.....don't have Jass...?

That confuses me.

Do you mean you don't have JassNewGenPack? o_O

EDIT: Anyway number 1 doesn't even need anything more than a variable. Depending on how many generals there are depends on how many vars or how large you want the array.

The variable is an Integer type.

You'd need Unit-groups too. Unit group for each General. How you set those, I'll leave up to you. I don't have the info in order to put that together for you.

So you'd end up with something like this.

  • init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- I use 4 here. Array is 4. 4 Generals. 4 Counters, one for each corresponding General. --------
      • -------- You can set this however you wish. --------
      • Set GeneralCounter[1] = 0
      • Set GeneralCounter[2] = 0
      • Set GeneralCounter[3] = 0
      • Set GeneralCounter[4] = 0
  • Unit Count
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set GeneralCounter[(Integer A)] = (Number of units in GeneralGroup[(Integer A)])
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Number of units in GeneralGroup[(Integer A)]) Equal to (==) 0
              • Then - Actions
                • Custom script: call DestroyGroup(udg_GeneralGroup)
                • -------- Your Actions --------
              • Else - Actions
                • -------- Any other actions, or just leave blank. --------
That would be a way you could keep track of how many units are in the unit group. You just have to come up with the way you wish to add units to the unit group specified. :)

I think I did that correctly, >.>

EDIT2: Just realized, this might not work if you have multiple loop triggers with IntegerA. If you need to, you can just make an integer variable, and use "For Each Integer Variable" instead. :)
 
Last edited:
Status
Not open for further replies.
Top