• 0

    posted a message on Is it possible to use a region like a variable

    Hi everyone, sorry if this has already been asked before - if so please feel free to link me to a thread that has the answer.

    What I need to know is, is it possible to use a region like a variable? I currently have a trigger that does the following:

     

    if { Comparison(PlayerRace(1)=Protoss) } then {

          CreateUnitsAtPoint(1, "Zealot",No Options,1,(RegionGetCenter(Region01))

    }

    if { Comparison(PlayerRace(1)=Terran) } then {

          CreateUnitsAtPoint(2, "Marine",No Options,1,(RegionGetCenter(Region01))

    }

    if { Comparison(PlayerRace(1)=Zerg) } then {

          CreateUnitsAtPoint(4, "Zergling",No Options,1,(RegionGetCenter(Region01))

    }

     

     

    _____________________________________________


    Ideally I would like to do the exact same thing in Region02 and Region03....potentially all the way up to Region10.


    To make things nice and tidy it would be ideal to just keep those three if/then statements together as one method and just call it as often as I like passing through a region. In other words, instead of having the 3 if/then conditions 5 separate times, only have it once and have it trigger as such:

    TriggerExecute: spawnUnits(Region01)
    TriggerExecute: spawnUnits(Region02)
    TriggerExecute: spawnUnits(Region03)
    TriggerExecute: spawnUnits(Region04)
    TriggerExecute: spawnUnits(Region05)

    spawnUnits(variable) {

          if { Comparison(PlayerRace(1)=Protoss) } then {

                CreateUnitsAtPoint(1, "Zealot",No Options,1,(RegionGetCenter(variable))

          }

          if { Comparison(PlayerRace(1)=Terran) } then {

                CreateUnitsAtPoint(2, "Marine",No Options,1,(RegionGetCenter(variable))

          }

          if { Comparison(PlayerRace(1)=Zerg) } then {

                CreateUnitsAtPoint(4, "Zergling",No Options,1,(RegionGetCenter(variable))

          }

    }

     

    Is this at all possible? How can I do this?


    I haven't used variables before so please forgive my ignorance if I need follow up explanation.

    Posted in: Triggers
  • 0

    posted a message on Making the AI do nothing

    Thanks, it works. I'm using:

    AISetGroupScriptControlled((UnitGroup(null,4,(RegionEntireMap()),Excluded: Worker, Missile, Dead, Hidden,0)),false)

    and it appears to work for all the units, although interestingly not warp prisms in phasing mode... are they not considered units in the editor or something?

    Posted in: AI Development
  • 0

    posted a message on Making the AI do nothing

    Okay, so it worked...kind of. If I spawn 5 Zealots then use AISetUnitScriptControlled on UnitLastCreated the AI will use 4 of the Zealots and ignore 1. So, I could spawn each zealot one at a time and use this method, but it does seem inefficient. Any ideas?

     

    Attached is my attempt in case I'm doing it wrong

    Posted in: AI Development
  • 0

    posted a message on Making the AI do nothing

    Ah, that's the problem - I don't want to delete the AI initializing triggers... I could I guess, by having a seperate AI and initialize the AI's individually, but I ideally want the AI to play a normal game of Starcraft but Also the game will spawn some units into an area of which I want the AI to ignore these units so they can defend that area.

    I'll try MaskedImposter's method of disabling script control for the last created units tonight and let you know how successful I am.

    Posted in: AI Development
  • 0

    posted a message on Making the AI do nothing

    I still can't seem to do it. Trying to copy what someone else has done here: https://www.sc2mapster.com/forums/development/triggers/152771-pick-all-units-in-region if I spawn some units in a region, I can't seem to figure out how to make this apply only to them. I'm new to triggers but have spent about a week googling with no luck.

    Posted in: AI Development
  • 0

    posted a message on Making the AI do nothing

    Hi there,

     

    I don't know why but I can't seem to find any information on what should be one of the most simplest things to do in the editor. I have placed units on the map and they belong to an AI. I want the AI to not use these units like they normally would, (ie bunch them up together/defend/attack) I want the units to just stand in that area and wait for the player to come and engage them - just like you would have in the campaign or in co-op. Yet I can't seem to get the AI to decide against grabbing everything on the map and immediately attacking the player with it rendering my map unplayable.

    I have gone to Object properties and unchecked "Available for attack waves" and I thought this would do the trick, but to no avail.

    If anyone can help or link a tutorial I'd much appreciate it.

    Posted in: AI Development
  • 0

    posted a message on Roach/Ravager model size

    @SoulFilcher: Go

    Thank you good sir! It worked.

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    hmmm so I tried again: Selected Extension Mod → Legacy of the Void → select Roach/Hydralisk and it's still missing... what should I be doing instead?

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    Okay, so ultimately I've ended up fixing it. I discovered that if I go under models there is a "Roach Upgrade" model. I managed to remove the Requirement/Validator so that the Roach uses the normal model. Trying to recreate the model switching on a different upgrade...

    It looks like have managed to successfully give the Ravager an ability to morph into a Roach.. However the "Roach" still uses the Ravagers model after morphing and it doesn't morph into an egg during the morph sequence. Also it doesn't have the Roaches ability to morph into a Ravager. I find it odd that if I look at the Command Card buttons, the evolve to lurker/evolve to Roach is not there like the game adds it dynamically. Does anyone know why it is done this way? It seems the zergling/baneling evolution is not done this way..

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    No worries, here's the mod. Named Obamacare cause it was the only thing that came to mind at the time hahah. I really appreciate the help man. I'm surprised I've managed to get as far as I have without help.

    Just for context sake, what I'm trying to achieve here is:

    • The Roach and Hydralisk position in the tech tree is switched
    • Roaches and Ravagers can morph back and forth in a similar way to Hellions/Hellbats (ie for free)
    • Roaches get burrow move for free.

    I've made little changes here or there, the idea isn't to be balanced, more for fun and so I can get used to the editor

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    It's so strange that it's not working for me... would you like me to share my project? I've screenshotted below what I did.

    edit: I dont know why I just clicked to this, but is it because of the glowing spikes on the Roach...ie is this a different model? I removed the requirement to research burrow move for Roaches.

    editor ingame

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    Is it possible that it's because it's an extension mod and so I am building the Roach through a conventional means rather than placing it on the map through the editor?

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    Thanks for the help Laiev, but I just tried this and it didn't work. I put both the scale minimum and maximum to 2 but the model size is the same as a regular roach. :(

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    Thanks. Do you have a tutorial or something you can link me to on how to do this? I actually haven't the faintest idea.

    Posted in: Melee Development
  • 0

    posted a message on Roach/Ravager model size

    Hi SoulFilcher, I changed the Art Scale as shown here

    Posted in: Melee Development
  • To post a comment, please or register a new account.