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

[Trigger] Copy regions?

Status
Not open for further replies.
Level 5
Joined
Feb 1, 2009
Messages
107
I need to make a trigger that copies regions in my map, like this:

When the player chooses the race he's going to play with, he'll start the game at a random place, with and environment specific to that race. So I have to "Spawn" all the race's buildings in specific locations with specific distances from each other. That is easy if I have preset regions, then I just spawn each thing in the regions. But as the starting location for each player is going to be random, I was thinking of having pre-designed environments somewhere (not accessible for players) in the map, with the specific regions. Then, when the player chooses his race, I'd have to copy this regions exactly how they are positioned in the pre-designed place, to the place the player is, and then spawn what I want.

So, to make it short, I just need to know how do I copy a preset group of regions to another place.
 
Level 5
Joined
Feb 1, 2009
Messages
107
You can copy a region to another place, sure. But you can't copy everything in a region without some semi-advanced JASS code, with which you could copy everything except doodads, which can't be referenced by triggers. So, in short, no. It is possible, but very difficult, and you can't copy doodads.

I only need to copy the GROUP of regions, with the predetermined placement/distance they are from each other. I can then create everything I need in the new place.
 
Level 5
Joined
Oct 17, 2006
Messages
151
in order to pull this off (in gui I have done it as an idea) you make a point, find the offset (x and y) between the center of the region and then create everything using offset. You would have to find the coordinates of all of the objects in the region editor. (try not to think of moving regions to much, more like creating at a point which is x and y away from x and y)

Note that it took me days to do this one... so good luck! :thumbs_up:
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
  • RegionSet
  • Events
  • Conditions
  • Actions
    • Set TownhallLoc = Center of (CurrentRaceRegion)
    • Set BarracksLoc = TownhallLoc offset by (YourDistance) towards (YourAngle)
    • Set BurrowLoc = TownhallLoc offset by (YourOtherDistance) towards (YourOtherAngle)
  • Create
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Player Group - Pick every player in (All Players)
      • loop
        • Set CurrentRaceRegion = Some Preset Region
        • Trigger - Run RegionSet
        • Create 1 Townhall for Picked Player at TownhallLoc
        • Create 1 Barracks for Picked Player at BarracksLoc
        • Create 1 Burrow for Picked Player at BurrowLoc
Add some if/then/elses to make the race different,,
But that should be something,,
At least, if i understood you right =P
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
He said nothing about doodads,,
And he might want to do this to make the race in the right region,,
  • Set OrcReg[1] = OrcReg1 <gen>
  • Set OrcReg[2] = OrcReg2 <gen>
  • Set OrcReg[3] = OrcReg3 <gen>
  • Set OrcReg[4] = OrcReg4 <gen>
And so for every race and every region for every race
  • Player Group - Pick every player in (all Players)
    • loop
      • If (All conditions true) then blah blah
        • If Conditions
          • Race of (Picked Player) equal to Orc
        • Actions - Then actions
          • Set Current RaceRegion = OrcReg[RegionInteger]
          • Set RegionInteger = RegionInteger + 1
          • Trigger - Run RegionSet
          • Do the create Actions
        • Else
And so on for every race
The region integer makes sure no regions is used for 2 players at the same time!
 
Level 5
Joined
Feb 1, 2009
Messages
107
Did I understand him wrong? I thought he meant he'd made a load of terrain and doodads and stuff in an area and he wanted them to appear a player's start location, which would be random.

Partially... I said I need the "environment". Actually, that means structures, too. Not sure if I was clear enough =p.

In fact, structures are the main part. I'd also like to add some terrain, but not doodads.

Yixx way covers most of my problem :). But I still need something for the terrain. Not for the ground, though. To be more specific, I need to spawn cliffs.
 
Level 5
Joined
Oct 17, 2006
Messages
151
You sure you do not want doodads? The way I made my doodads is"

pick all destructibles in region
create new (destructible type of picked destructible) at (find the x and y then move it all depending on where your stuff are)
 
Level 11
Joined
Nov 15, 2007
Messages
781
Is there any reason to use doodads..? Less memory or something? Because I normally just make custom destructibles/dummy units for doodads so they can be moved around or removed completely.
 
Level 5
Joined
Oct 17, 2006
Messages
151
if he wants to do it then it will have to be the way to go...

I have done it countless times and its not all that difficult. usually you only (average maps) use around 20 doodas (not destructible) and you would just copy and paste a bunch of objects in the OE while changing there model and name.
 
Status
Not open for further replies.
Top