/RAGE!!!!
Okay, seriously though. I am trying to call up a weapon with a string. So to put it as to specify what i am doing. I'd be doing @weapon UnitWhoCarrysWeaponName.
But game link wants me to get an actual unit. I don't have a unit, i want to refer to what weapon that unit of type uses. I'm confused, if that made any sense at all please help :P.
If your doing a get catalog feild value it would be
Weapon , weapon name, field value name / array value position if the field is an array of values
Okay, well to make it easier, i'm trying to make a trigger where if a player type @addweapon Marine. It will add the weapon that a marine has, to the selected unit. Couldn't be more specific.
Well it works with all units. But you cannot add most weapons to the unit.
IE: i can add a firebat's weapon to a SCV, but not a Zergling's weapon to an SCV.
:o
Well, a lot of the unit's weapons are called differently than the actual unit. E.g. the Zergling's weapon is called Claws, the Marine has the GaussRifle.
Is it ok for you with these names or do you need a system where you write a unit name and get it's weapon?
Hurray for something GUI doesn't seem to be capable of - sorry, chap.
But behold the might of Galaxy, there is a simple solution:
Add a Weapon Via String Events Game - Player Any Player types a chat message containing "@addweapon", matching Partially Local Variables weaponName = (Word 2 of (Entered chat string)) <String> Conditions (Word 1 of (Entered chat string)) == "@addweapon" Actions Unit - Add lv_weaponName to (your selected unit) using turret Fixed Right
As a weapon you select Custom Script and then enter the name of the string variable that holds the weapon string (add a lv_ in front of it).
S3rius pretty sure you can just use the "convert game link" to string and add the weapon through gui. This should work with out scripting.
Rollback Post to RevisionRollBack
Skype
KageNinpo = SN
My Libraries
DialogLeaderboard & TeamSort
My Projects
SPACEWAR Tribute
Infinite TD
Well, a lot of the unit's weapons are called differently than the actual unit. E.g. the Zergling's weapon is called Claws, the Marine has the GaussRifle.
Is it ok for you with these names or do you need a system where you write a unit name and get it's weapon?
I need a system where you write a unit name and get it's weapon. Like weapon 1.
But you'll still have to write the unit id, and not the unit name. Fortunately they're they same almost always. The only differences are, I think, when the unit name consists of several words.
So instead of "Brood Lord" it needs to be "BroodLord" same for Siege Tank and similar units.
Oh nice, I didn't know you could get the weapon type from a unit and add it to another.
That would, by far, be the best way to do it. Other possible options would be triggers that fires on each specific chat message. That is, one that fire on "@addweapon marine" and adds the C-14 Gauss Rifle to your unit, one that fires on "@addweapon ghost" and adds the C-10 Canister Rifle, etc. Or if you just could rename all the weapons to be called the same as the unit that use them. So the Marine has a weapon called "Marine". :x But now that s3rius posted a good solution, just go with that.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
/RAGE!!!! Okay, seriously though. I am trying to call up a weapon with a string. So to put it as to specify what i am doing. I'd be doing @weapon UnitWhoCarrysWeaponName. But game link wants me to get an actual unit. I don't have a unit, i want to refer to what weapon that unit of type uses. I'm confused, if that made any sense at all please help :P.
@ShakiShingi: Go
Your post makes no sense.
If your doing a get catalog feild value it would be
Weapon , weapon name, field value name / array value position if the field is an array of values
Okay, well to make it easier, i'm trying to make a trigger where if a player type @addweapon Marine. It will add the weapon that a marine has, to the selected unit. Couldn't be more specific.
Bump
Hurray for something GUI doesn't seem to be capable of - sorry, chap.
But behold the might of Galaxy, there is a simple solution:
As a weapon you select Custom Script and then enter the name of the string variable that holds the weapon string (add a lv_ in front of it).
It only works for some units.. But thanks :)
bumpage This works, but not entirely, Can someone explain/fix?
@ShakiShingi: Go
bump :O
What do you mean by "some units"?
Does it only work with some weapons or can't you add weapons to certain units?
@s3rius: Go
Well it works with all units. But you cannot add most weapons to the unit. IE: i can add a firebat's weapon to a SCV, but not a Zergling's weapon to an SCV. :o
Are you trying the right names? E.g. "@addweapon Claws" for the Zergling weapon.
@s3rius: Go
No i'm trying to do it by the name of the unit. And i did try that and it didn't work sometimes :O
@ShakiShingi: Go
Well, a lot of the unit's weapons are called differently than the actual unit. E.g. the Zergling's weapon is called Claws, the Marine has the GaussRifle.
Is it ok for you with these names or do you need a system where you write a unit name and get it's weapon?
S3rius pretty sure you can just use the "convert game link" to string and add the weapon through gui. This should work with out scripting.
@SouLCarveRR: Go
Too bad that you need a Convert String to Game Link for this. And I don't think this exists.
nt
this guys problem is when he does change the catalog value it does it for all units where as he just wants it for one unit.....
This would be possible by making a dummy weapon and just using combat behaviors to set off the different weapon types.
I answered a similiar topic like this a few minutes ago. Ah this topic author posted a new thread thats the one I answered.
@SouLCarveRR: Go
That's why I suggested my way. It doesn't use Catalogs but adds the specific weapon.
I need a system where you write a unit name and get it's weapon. Like weapon 1.
Then I think the only way is to use a small workaround. You can spawn the unit of the right type, then get it's weapon.
But you'll still have to write the unit id, and not the unit name. Fortunately they're they same almost always. The only differences are, I think, when the unit name consists of several words.
So instead of "Brood Lord" it needs to be "BroodLord" same for Siege Tank and similar units.
@s3rius: Go
Oh nice, I didn't know you could get the weapon type from a unit and add it to another.
That would, by far, be the best way to do it. Other possible options would be triggers that fires on each specific chat message. That is, one that fire on "@addweapon marine" and adds the C-14 Gauss Rifle to your unit, one that fires on "@addweapon ghost" and adds the C-10 Canister Rifle, etc. Or if you just could rename all the weapons to be called the same as the unit that use them. So the Marine has a weapon called "Marine". :x But now that s3rius posted a good solution, just go with that.