• 🏆 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!

[Unsolved] Need some trigger and data editor questions answered.

Status
Not open for further replies.
Level 2
Joined
Jan 21, 2015
Messages
14
---Ok so I am making a map on Agria where the Zerg are doing their Zerg thing and you gotta save people and blah blah, I am making some new units (altered in data editor), and to make these new units and such it requires Osgoddian crystals which are farmed like other mineral fields. I have run in to a few problems, first bunch including the new SCV unit that can be made.

---So you start off with a few combat units, a tiny base and this big new evac truck. This evac truck is one of the new units that can only be made if you have enough minerals, vespene, and osgoddian crystals- so it has special abilities like being able to build this new SCV unit. The SCV unit has the usual abilities of the usual SCV but with better stats and a third button card for making special things.. for example I want it to be able to build special units directly, for example, the Odin from the campaign, except I can't figure out how the ability would work cause I can only find SCV Build which gives me the choices to build the normal structures that other SCV's can build, how can I make it be able to make a unit directly?

---How would I make a timer that when it runs out you win? Very simple but having a mind block today in the triggers section of my brain + the editor.

---How would I make a counter that counts the amount of units in a group and every time one dies it goes down until reaching 25 and if the counter goes below 25 player 1 loses?

---Simple, but still a noob to most of the editor, how would I make it so that player 1's camera goes to certain points on the map at the start and back to where it was originally?

---Kind of building off of the above question, how would I make text simply show up when the map is initialized saying stuff to do and not to do? like objectives in campaign?

---Building off of the above question about the text, how would I make it so that the text disappears when certain events happen? I wanna make the map's intro from text and camera panning cause I'm a noob like that, how would I make it say one thing, then another, then have the objectives appear on the left of the screen like in campaign, then say another thing, like info about the map, whats going on in the area, etc?

---How would I make a trigger that spawns nydus worms and from those nydus worms come zerg periodically that head towards the nearest enemies? and if the nydus worms die they set off a trigger to spawn another nydus worm in another location randomly (at given points of course, but it randomly chooses the points) that also spawn zerg and spawn another worm at a random location when it dies like the one before it? Kinda like an endless amount of randomly spawning worms that give out zerg like candy.

---How would I make it so that when the nydus worms first start spawning the camera pans to them and back to where the camera was originally? Like when you first start the map the camera pans to places and back.

---How would I make it so that the worms only start spawning after let's say.. 8 minutes? And that initiates the camera panning and such from above?

---How would I make the player 2 (computer controlled) spawn units and build stuff and such like another player? Or is that all done by triggers?

---How would I give the new SCV unit a shield like the protoss? (has protoss parts in it)

---How would I make the new SCV unit build instantly? Or very quickly? I saw the option awhile back but can't find it now..

---Is there any webpages that give a lotta info about triggers and the data editor especially (I know a lil bit about triggers but not much about the data editor) that you guys know of that are really in depth?

Thank you for reading all that, you Sir or Madam are superb.
 
Level 2
Joined
Jan 21, 2015
Messages
14
Two new ones I have come across, how would I make it so there are.. maybe 5 nydus worms on the map at the prior spoken of points that I have hand placed in random spots, but so that when one or two of them die, they will not spawn on top of/at the same point as another nydus worm that is already there?

Also as somewhat already asked, how would I make the terrain be altered by a trigger? When the map first starts I want terran drop pods to come down and make a small dent in the terrain while being in the camera view, where the player 1 start point is.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
---So you start off with a few combat units, a tiny base and this big new evac truck. This evac truck is one of the new units that can only be made if you have enough minerals, vespene, and osgoddian crystals- so it has special abilities like being able to build this new SCV unit. The SCV unit has the usual abilities of the usual SCV but with better stats and a third button card for making special things.. for example I want it to be able to build special units directly, for example, the Odin from the campaign, except I can't figure out how the ability would work cause I can only find SCV Build which gives me the choices to build the normal structures that other SCV's can build, how can I make it be able to make a unit directly?
You can either add a train ability with appropriate setting and buttons to the SCV to train the Odin or you can make the Odin buildable and add it to the standard SCV build ability.

---How would I make a timer that when it runs out you win? Very simple but having a mind block today in the triggers section of my brain + the editor.
Make a timer variable. From a trigger run at map initialization start the timer and also display a window for it. In another trigger add the event "timer expires" and set it for the appropriate timer then in the actions add your victory actions (player loop with award each player victory each player).

Remember to stop the timer if the player loses otherwise they could hang around in the defeat screen until the timer ends and still win even if they lost. Pausing it means the timer will never expire so they cannot win which is exactly what you want when they have lost.

---How would I make a counter that counts the amount of units in a group and every time one dies it goes down until reaching 25 and if the counter goes below 25 player 1 loses?
There is a function to count the number of units in a group. It also allows filtering for number of living units only and handles all your counting needs. Periodically count the group (ever 5 seconds or so with a periodic timer event) and if it falls below 25 then defeat player 1.

You might want to defeat his allies at the same time and also disable the victory timer to prevent him sitting out the game defeated until he wins.

---Simple, but still a noob to most of the editor, how would I make it so that player 1's camera goes to certain points on the map at the start and back to where it was originally?
There are player actions that allow you to pan the camera. These might affect a player group so might be under that section. The idea is that you firstly pan the camera to the other area at (or shortly after) map initialization with a wait action as long as the pan time and how long you want the player to view the area. After the wait expires you then pan back to the original area. During this time you might want to lock the camera to stop the player looking else where for a more polished feel.

Both cameras can be set up in the terrain editor as pre-placed camera objects if required or specified as a series of trigger actions. There should be an action to generic pan without adjusting the camera angle. If the start location is dynamic you might want to make the trigger responsible save the location so that you can pan the camera back to it. You could start off by getting the player's current camera position but this might not always be precise as it is synchronized rather roughly.

---Kind of building off of the above question, how would I make text simply show up when the map is initialized saying stuff to do and not to do? like objectives in campaign?
You can generate mission objectives (which appear in the top left by default) using the appropriate actions. You could also send a player group a text message in the appropriate area explaining what to do (remember to leave it long enough to be read!). You could also add the objectives and tips as game hints to the hint section for people to read at this leisure (most maps do this as good explanative narrative is hard to incorporate into a high-speed map).

---Building off of the above question about the text, how would I make it so that the text disappears when certain events happen? I wanna make the map's intro from text and camera panning cause I'm a noob like that, how would I make it say one thing, then another, then have the objectives appear on the left of the screen like in campaign, then say another thing, like info about the map, whats going on in the area, etc?
Use waits between the actions. Make sure the wait is as long as the duration you specify for the appropriate actions. This can take a lot of testing to get right and might need fine tuning. It is very hard to get it right first time.

You might want to use "real time" for this instead of "game time" since game time usually runs faster than real time so could result in the sequence occurring too fast.

---How would I make a trigger that spawns nydus worms and from those nydus worms come zerg periodically that head towards the nearest enemies? and if the nydus worms die they set off a trigger to spawn another nydus worm in another location randomly (at given points of course, but it randomly chooses the points) that also spawn zerg and spawn another worm at a random location when it dies like the one before it? Kinda like an endless amount of randomly spawning worms that give out zerg like candy.
I am not entirely sure how the network would behave but the basic sequence is to create a nydus worm exit sending appropriate actor messages if required (so it spawns correctly) and then in a periodic trigger you add units to the nydus network and order it to unload all.

You might need to have a dummy nydus worm entrance for this to work. In that case modify it to have a 0 mineral cost and cooldown on making exits and then instead of creating an exit directly you order it to make one. You then fill units into the system using the same add units to cargo actions and also unload as described above.

Spawning would be done by checking if the exit is alive in the periodic wave spawn trigger and if not then finding a random position and spawn one using the methods described above. Add all your spawn positions to a point array with size equal to the number of points you want to spawn at. You select a random point then by choosing a random index between 0 (first element) and size-1 (last element) or 1 and size (Galaxy supports offsets).

To prevent it instantly respawning where it was just killed you can keep track of the last spawn point and if the randomly chosen point index is the same as the last one then you advance 1 index and wrap around the size of the array (modulus operation allows this). This will theoretically bias the following point in the array after the last selected point to occur twice as likely as each other element in the array. This bias can be ignored as long as the array is sizable (>>3 elements) since the chances of it following in order for elongated periods becomes insignificant.

---How would I make it so that when the nydus worms first start spawning the camera pans to them and back to where the camera was originally? Like when you first start the map the camera pans to places and back.
Bad idea from a UI perspective as this removes control for the player which will affect their APM, micro and potentially lower their performance. Instead you should rather ping it on the minimap and play the screaming sound of a nydus exit as that would be enough for the player to be alerted to it.

If you really want to pan, use the approaches mentioned above (pan camera actions with appropriate waits).

---How would I make it so that the worms only start spawning after let's say.. 8 minutes? And that initiates the camera panning and such from above?
Use an activation trigger. Start the spawning trigger initially off (no spawns will occur) by right clicking it and selecting that it is of (not disabled, it must be enabled but off). Make another trigger which runs only once after 8 minutes (480 seconds) which then turns the trigger on. Spawning will then start after 8 minutes when the spawn trigger is turned on and periodically starts to run.

I would still advise against forced camera panning. Removing control from the user should only occur for in-game cinematics during which time you need to make sure nothing will happen to the player.

---How would I make the player 2 (computer controlled) spawn units and build stuff and such like another player? Or is that all done by triggers?
Make sure it is set to a computer player (as only computer player declared slots can run AI). You then start a campaign AI for it to turn the AI system on. You then write your own periodic triggers or other events which run the AI logic of your choice. Advanced AI features can only be accessed using pure Galaxy script as they lack GUI wrappers for some reason (unless you make some yourself using pure Galaxy script).

For custom units you might need to write tactical AI functions so that they are used correctly. It should in theory be possible in GUI but due to a lack of action wrappers for some of the tactical AI functions and strange naming you might find this hard to do.

AI is a complex area which I recommend you learn either reading the pure Galaxy AI scripts used for standard Melee or you experiment around with the AI actions and natives.

---How would I give the new SCV unit a shield like the protoss? (has protoss parts in it)
Simply give it a quantity of shield property, initial shield property, shield regeneration and appropriate shield regeneration delay. This is done from the unit tab in the data editor. You can also give it the above using triggers however that should only be done if you want complex variable control logic for the amount of shield. You can also use an ability to give it the shield similar to how the Battle Cruiser works in the campaign.

So that the shield impact effects function appropriately you might need to add some shield attachment methods to the SCV model. Without them an actor error will be thrown as there are no attachment locations for the shield impact models. I believe most protoss units have one of those so look up their model.

---How would I make the new SCV unit build instantly? Or very quickly? I saw the option awhile back but can't find it now..
Build ability should have a field allowing you to specify build time. You could also use a trigger to instantly build the unit by setting its progress to 100% or nearby however a data editor solution is preferred in this case.

---Is there any webpages that give a lotta info about triggers and the data editor especially (I know a lil bit about triggers but not much about the data editor) that you guys know of that are really in depth?
Not here. SC2Mapster has a lot of examples, tutorials and some wiki pages explaining some data however these are incomplete, out-dated or some times even just wrong. Triggers especially are lacking much detail. As such a lot of your knowledge will sadly have to be self-found or from looking at examples.

Two new ones I have come across, how would I make it so there are.. maybe 5 nydus worms on the map at the prior spoken of points that I have hand placed in random spots, but so that when one or two of them die, they will not spawn on top of/at the same point as another nydus worm that is already there?
Use a point list instead of an array. Move in-use points to another list for storage. When a worm dies put them back in the old list to be recycled. List ordering does not mater and searching the list can be a linear search (standard algorithm so consult Google). You might want to store the worm attached to each point so that when it dies you can determine which point to remove from the list.

In this case a list is simply an array where the number of elements in it can vary between 0 and the size. Add to list is add to the end and increment by 1 the end. Remove from the list is decrement by 1 the end and replace the removed element with the end element. Remember to choose appropriate array sizes as you cannot resize arrays in real time and they are not dynamic arrays like in WC3 which automatically choose the appropriate size.

Also as somewhat already asked, how would I make the terrain be altered by a trigger? When the map first starts I want terran drop pods to come down and make a small dent in the terrain while being in the camera view, where the player 1 start point is.
I believe some actors can do this. They are used generally to flatten terrain such as for buildings etc. I am not sure if you can control them enough to get your desired effect. Generally the terrain is static and does not get modified much.
 
Last edited:
Status
Not open for further replies.
Top