Making a map with RPG elements, including the equipping of items. I've got an item that, when equipped, adds a Buff Behavior to the unit, and that's working just fine. I'd like the item to also be able to add a passive Ability to the unit that equips it. The Ability works if I add it to the unit directly, but I'd like it to be tied to having the item equipped and I can't figure it out.
The Behavior -> Modification field has the section "Abilities Enabled" that I can add the abilities to, but that doesn't seem to do anything. I'm assuming that's because the unit doesn't have the abilities already, and I'm not sure how to give an ability to a unit and have it disabled by default. Any suggestions?
Making a map with RPG elements, including the equipping of items. I've got an item that, when equipped, adds a Buff Behavior to the unit, and that's working just fine. I'd like the item to also be able to add a passive Ability to the unit that equips it. The Ability works if I add it to the unit directly, but I'd like it to be tied to having the item equipped and I can't figure it out.
The Behavior -> Modification field has the section "Abilities Enabled" that I can add the abilities to, but that doesn't seem to do anything. I'm assuming that's because the unit doesn't have the abilities already, and I'm not sure how to give an ability to a unit and have it disabled by default. Any suggestions?
To disable an Ability, look for field "Shared Flags" and check the flag "Deactivated".
Indeed, you must give the unit that Ability to make the Behavior modification work.
When your Unit equips the item, the Behavior enables the Ability.
The last thing to do is to show/hide the ability on the command card of the equipping unit.
To do that, you need a Prerequisite :
- Use the section "Show +".
- Count the stack of Behavior as completed only at unit greater than 0.
Let's change your Ability field "Commands +" :
- Set the Prerequisite to the Ability command, usually "Execute".
- Don't forget to set the state to "Restricted".
And everything should work fine.
Side note : I don't remember any way in Data Editor to give / remove an ability to a unit with Effects or something Data only.
Even "Learn" Ability infers a direct adding to the unit.
Small note : Years ago, I saw some people encountering a non issue, they tried to order a unit from triggers.
Without altering the unit state :
- Disabled state (may be Prerequisite "Use+") : User can't use it, triggers neither.
- Hidden state (may be Prerequisite "Show+") : User can't use it, triggers can.
Thanks! That all worked exactly as I hoped it would. I do want to have a lot of abilities that function this way (like, a couple dozen maybe) so I guess I just have to have my heroes have ALL the abilities then.
32 abilities is definitely good to know, and I can definitely work within that. The morph trick is good to keep in mind though. Talking about morphing however, I have another issue with my custom zerg units and burrowing. I duplicated the zergling, the burrowed zergling, the burrow and unburrow abilities, and got all that to work just fine. The zergling burrows and unburrows and keeps all his abilities and everything between the two states. The problem that has shown up that I don't get at all is that the normal standard unmodified zergling's name is linked to my burrowed zergling's name. I change my new burrowed zergling's name and it changes the names of the normal zergling and it's burrowed form. I use Reset Unit on the normal zergling and it resets the name on my new burrowed zergling. My unburrowed zergling is completely unaffected by any of this. I've got a separate actor for my new zergling and unburrowed zergling, and I've got through it's Events list to make sure that all the burrow/unburrow stuff in there only references my new zergling. My zergling Actor only lists my units, and the standard zergling Actor only lists standard units. I'm completely baffled.
Problem is that it changes the name of the unit in game, so all normal zerglings are not called Zergling, they have the same name as my new unit. I just don't get why changing the name of one unit is forcing the name to change for other units.
Blizzard's fucking retarded and added a line in the xml of a lot of units, effects, etc. that sets their name to equal the name of a specific id reference, like zerglings reference the name of the original zergling, go into the xml and remove this line and it will fix it.
I did duplicate the unit to create it, but I've been very careful about how I've been naming things and setting my own IDs. The editor doesn't let you use the same ID as another object anyway, it throws an error. I've been working very hard to have my custom units not use any base game stuff almost at all. I've made custom Terran and Protoss units this same way and haven't had any issue. It's only the (Burrowed) version of my custom Zergling that has the problem.
Blizzard's fucking retarded and added a line in the xml of a lot of units, effects, etc. that sets their name to equal the name of a specific id reference, like zerglings reference the name of the original zergling, go into the xml and remove this line and it will fix it.
Definitely right about Blizzard there. And I found the XML line you were talking about.
<CUnit id=NewZerglingBurrowed">
<Name Value="Unit/Name/Zergling">
No idea why/how that line is there, but deleting it seems to have fixed the issue. Had to reset my custom unit name afterwards, but it has disconnected the name from the base Zerglings. Thanks a bunch!
Any idea of how to keep this from happening in the future? Or am I just stuck having to edit the XML every time I want to make a zerg unit that burrows?
The link is not duplicated, it doesn't create a new one for your new unit (native function error or something, should not happen, sooooo it's a bug on dev's side).
Any idea of how to keep this from happening in the future? Or am I just stuck having to edit the XML every time I want to make a zerg unit that burrows?
The XML fix is necessary but don't delete the line. The duplication process must need this line to rename properly. It went wrong for a specific case but it works fine usually.
Can you try to set the name value to "Unit/Name/NewZerglingBurrowed" ?
Then, in your Text Editor, look for the ID "Unit/Name/NewZerglingBurrowed" and set the text you want for the actual name.
That would be even better.
I looked in my Prime Hunter map and found similar links. You should find yours.
Everybody has been great with their help, and I've been learning a lot. Especially the XML stuff. My current problem, that I feel like should be really easy to do, is a shop to increase attributes. My heroes have attributes (Strength, Agility, etc) and a system to be able to choose which one to increase when you level up. I'd like a shop where you can buy increases to those, and I'm just hitting a block. I have other shops where you can buy items (weapons, armor), but I'm not sure how to switch it around.
Making a map with RPG elements, including the equipping of items. I've got an item that, when equipped, adds a Buff Behavior to the unit, and that's working just fine. I'd like the item to also be able to add a passive Ability to the unit that equips it. The Ability works if I add it to the unit directly, but I'd like it to be tied to having the item equipped and I can't figure it out.
The Behavior -> Modification field has the section "Abilities Enabled" that I can add the abilities to, but that doesn't seem to do anything. I'm assuming that's because the unit doesn't have the abilities already, and I'm not sure how to give an ability to a unit and have it disabled by default. Any suggestions?
Hello,
Good. Thumbs up !
To disable an Ability, look for field "Shared Flags" and check the flag "Deactivated".
Indeed, you must give the unit that Ability to make the Behavior modification work.
When your Unit equips the item, the Behavior enables the Ability.
The last thing to do is to show/hide the ability on the command card of the equipping unit.
To do that, you need a Prerequisite :
- Use the section "Show +".
- Count the stack of Behavior as completed only at unit greater than 0.
Let's change your Ability field "Commands +" :
- Set the Prerequisite to the Ability command, usually "Execute".
- Don't forget to set the state to "Restricted".
And everything should work fine.
Side note : I don't remember any way in Data Editor to give / remove an ability to a unit with Effects or something Data only.
Even "Learn" Ability infers a direct adding to the unit.
Small note : Years ago, I saw some people encountering a non issue, they tried to order a unit from triggers.
Without altering the unit state :
- Disabled state (may be Prerequisite "Use+") : User can't use it, triggers neither.
- Hidden state (may be Prerequisite "Show+") : User can't use it, triggers can.
Have a nice day !
Thanks! That all worked exactly as I hoped it would. I do want to have a lot of abilities that function this way (like, a couple dozen maybe) so I guess I just have to have my heroes have ALL the abilities then.
You're welcome !
:D
However :
Pay close attention, a unit can hold up to 32 abilities !
If you really need more, you need to create a trick which is to MORPH the unit to something else.
The morph lasts 0.0625 s (= 1 / 16 s) and the model is the same.
For example : Switch to Attacker, Defender, Supporter role with 32 abilities each.
This trick supposes to watch / control inheritances before / after morphing.
That's for another day. ;)
32 abilities is definitely good to know, and I can definitely work within that. The morph trick is good to keep in mind though. Talking about morphing however, I have another issue with my custom zerg units and burrowing. I duplicated the zergling, the burrowed zergling, the burrow and unburrow abilities, and got all that to work just fine. The zergling burrows and unburrows and keeps all his abilities and everything between the two states. The problem that has shown up that I don't get at all is that the normal standard unmodified zergling's name is linked to my burrowed zergling's name. I change my new burrowed zergling's name and it changes the names of the normal zergling and it's burrowed form. I use Reset Unit on the normal zergling and it resets the name on my new burrowed zergling. My unburrowed zergling is completely unaffected by any of this. I've got a separate actor for my new zergling and unburrowed zergling, and I've got through it's Events list to make sure that all the burrow/unburrow stuff in there only references my new zergling. My zergling Actor only lists my units, and the standard zergling Actor only lists standard units. I'm completely baffled.
I read multiple times to understand the issue you described.
And it seems to work fine in-game, so it should be an editor problem and I read again and conclude on :
Because the standard borrowed and unborrowed Zergling "Unit" Actor are the same.
Seems like a non issue. Your verdict ?
Problem is that it changes the name of the unit in game, so all normal zerglings are not called Zergling, they have the same name as my new unit. I just don't get why changing the name of one unit is forcing the name to change for other units.
Blizzard's fucking retarded and added a line in the xml of a lot of units, effects, etc. that sets their name to equal the name of a specific id reference, like zerglings reference the name of the original zergling, go into the xml and remove this line and it will fix it.
In reply to Zerix807:
Did you duplicate the unit ?
The name is a value like any field.
What makes your units different is the unique ID (double left click on your item).
Never ever change directly anything from the base game, whatever the dependence is.
Except you create a module specifically to change the base game. Maybe. Sort of.
In reply to Phosphatidylinositol_:
I did duplicate the unit to create it, but I've been very careful about how I've been naming things and setting my own IDs. The editor doesn't let you use the same ID as another object anyway, it throws an error. I've been working very hard to have my custom units not use any base game stuff almost at all. I've made custom Terran and Protoss units this same way and haven't had any issue. It's only the (Burrowed) version of my custom Zergling that has the problem.
Definitely right about Blizzard there. And I found the XML line you were talking about.
<CUnit id=NewZerglingBurrowed">
<Name Value="Unit/Name/Zergling">
No idea why/how that line is there, but deleting it seems to have fixed the issue. Had to reset my custom unit name afterwards, but it has disconnected the name from the base Zerglings. Thanks a bunch!
Any idea of how to keep this from happening in the future? Or am I just stuck having to edit the XML every time I want to make a zerg unit that burrows?
Oooh I see !
The link is not duplicated, it doesn't create a new one for your new unit (native function error or something, should not happen, sooooo it's a bug on dev's side).
The XML fix is necessary but don't delete the line. The duplication process must need this line to rename properly. It went wrong for a specific case but it works fine usually.
Can you try to set the name value to "Unit/Name/NewZerglingBurrowed" ?
Then, in your Text Editor, look for the ID "Unit/Name/NewZerglingBurrowed" and set the text you want for the actual name.
That would be even better.
I looked in my Prime Hunter map and found similar links. You should find yours.
Everybody has been great with their help, and I've been learning a lot. Especially the XML stuff. My current problem, that I feel like should be really easy to do, is a shop to increase attributes. My heroes have attributes (Strength, Agility, etc) and a system to be able to choose which one to increase when you level up. I'd like a shop where you can buy increases to those, and I'm just hitting a block. I have other shops where you can buy items (weapons, armor), but I'm not sure how to switch it around.
Please create a new thread since the object is unrelated.
And detail your issue there.