I have created a unit called a Builder. I want him to be able to use his minerals to craft an item that will automatically go into his inventory bag. Any ideas on how to achieve this?
Ok, I figured it out! Now, has anyone any idea how to link this item to an ability so that when I use the ability the item is destroyed? To be more specific, the unit builds a 'kit' with which you can build little 'bots'. When I use the ability I want the item to be destroyed so as to simulate assembling the kit.
I used the train ability to create the item unit. I set him up with an inventory and a bag that allows the holding of the item. I think I then set the unit to spawn at source and it turns out the editor takes that to mean 'put it in his bag' considering it is a carry-able item. Not entirely sure about that... I did click a load of buttons in the process of trying to get it to work.
I have been looking for a tutorial on charges but I can't find one. As it stands the item that he is creating is an 'scv kit'. he will then have to use the scv kit in order to 'assemble' it and create an scv. I have set up another train ability for the training of the scv and set the charges which is tested and works fine.
So I want the item to carry one charge for the ability and to be destroyed when depleted. How can I get the item to carry a charge for the ability?
In your ability under cost i believe you set the max stacks and stacks used sections.
I guess it all depends on how you are making the item to create units or buildings in my map i use a create unit effect.
which is attached to an Ability Target Item
I can do either way... I just prefer to use the train ability. With either method I still cannot figure out how to make the item carry a charge. I can set up charges for the ability. I can set it's max charges. I can set it to use one charge per use. I can do all of that fine. but...
I need the ITEM to have a carrying behavior(?) which increases the charge of the ABILITY by one. When the ABILITY is used then the ITEM is destroyed.
I have tried doing this by 'info - link - charge' but it seems that behaviors can't affect the charges of an ability and vice versa.
Ok so lets see if i got this:
You want an item that is only carried.
The Item doesn't cast the ability and you want an ability on your Unit that then updates the Charges of the item
Or
Is it that you want your unit to have an ability that gets charges based on the charges of the item?
Upon further testing i dont believe using a train ability is possible on an item all ways i tried resulted in the ability not showing up. i think its because it cant reference the Train abilities Info -> Train 01 -> Charge
Also i do not beleive Upgrades will work quite how you wish with the Ability Charges It might though.
Im just not sure what one you would add charges to the Charge Max, Charge Use or Charge Start
Ah, that's interesting Zaysite. I think something like your grenade system would work just fine! However, in your tutorial using a charge of the item triggers an effect (launch grenade), Is there any way of making the use of an item trigger a train ability? That way I could set the item charge, max, and use all to 1 so that when I use it the ability will be used and the item will be destroyed.
I would like to keep the train ability because it behaves exactly as I would like it to.
The trouble I'm having is that charge links cannot be linked between effects, behaviours and abilities. If I could somehow have the item and the ability charge linked then this whole process would be incredibly easy.
Hmmm, just had a thought. I could get rid of the whole item problem all together. I could make the 'build kit' ability a research ability with an upgrade that adds one charge to the 'assemble kit' ability. I think that would simulate having to build the kit before you can assemble it. I would have to give the upgrade infinite levels so that you could build as many kits as you want though. Is this a plausible solution or am I going in completely the wrong direction?
P.S. I greatly appreciate all of your help and I am learning a lot, thank you
well another idea. would be give the item the ability and "assemble" is an order to the item to use the ability and after that the unit is destroyed. I believe it will be messy but could work.
cann you tell me why it has to be an item?? to you want to be able to trade these "kits" with other units??
Oh that's a great idea Shieldnutzz. I assume that that is done in the trigger editor? I only posted in data because I am pretty clueless when it comes to triggers.
Yes, the bot kits should be items that can be traded between players. In my map there is one unit (the 'builder') who creates all the kits. He can then trade the kits with the other two units (the 'miner' and the 'commander'). The builder will make kits for bots that only certain other units can assemble.
e.g. the builder will make a 'scavenger bot kit' which he will then give to the 'miner' to assemble. The miner will assemble the 'scavenger bot kit' and the resulting bot (the 'scavenger') will then be under the control of the player who is controlling the 'miner'. It should be possible to give the 'scavenger bot kit' to the commander but he should NOT be able to assemble it (he can only assemble 'assault bot kits').
there should be an effect called issue order. basicly I would try something like this (i cant test it right now) ....
build ability -> search effect for item with small radius like 0.1 (0 might work but im not sure) -> issue order "item ability"
Item ability -> create unit -> destroy item (damage with kill flag and target caster should do it)
that would would automaticly prevent commander to build scavenger, since they would search only for assault-bot-kit units
Ah, ok... i think we're getting there. So i've set up the item to have the issue order effect when used. The trouble I'm having now is getting the effect to target the unit. So we have the casting unit (the 'bot kit' in the inventory) and i need to make it's effect target the builder (the unit that is holding the 'bot kit')... any ideas?
Right, so I've changed the item type to 'target'. now when i click the item in the inventory i can then target the unit which I want to issue the command to. I click the builder but an error comes up saying 'no unit able to handle that command'
Rharhino, why would you click on the item. I thought the item should be automaticly used if the builder clicks on his "build bot" ability?? can you make a test- map with your stuff and attach it here? the way I thought of it, the builder has an ability "build bot" the item-UNIT has an ability which actually creates the bot. the item (in item tab) itself only has a dummy ability (I think its needed or else it doesnt show up). that way left-clicking the item doesnt do a damn thing. the builders ability has the issue order, which targets the item-UNIT and its ability.
SUCCESS!!! I have a solution! The following is a full description for anyone else who sees this thread in the future with a similar puzzle.
I created a BEHAVIOR called 'carrying bot kit' which doesn't have any notable properties. I created a generic-type ITEM called 'bot kit'. The 'bot kit' ITEM carries the BEHAVIOR 'carrying bot kit'. I created a REQUIREMENT that requires BEHAVIOR 'carrying bot kit' to be completed at unit. I attached this REQUIREMENT to the ABILITY 'assemble bot kit'.
So now the unit is required to have the behavior 'carrying bot kit' to be able to use the ability. The only way to have that behavior is by having a bot kit in it's inventory. Next I needed the item to be destroyed after using the ability so as to simulate the kit being assembled into the bot.
I used a TRIGGER. Events -> unit uses assemble bot ability at generic6 - complete stage. Actions -> remove inventory item (item carried by (triggering unit) in <whichever slot the item is in>.
Now when the bot kit is in the unit's inventory the ability is made available. When it is used, the item is destroyed.
Thanks everyone for your help... I couldn't have solved this without your help and I greatly appreciate you guys taking the time to help me :)
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have created a unit called a Builder. I want him to be able to use his minerals to craft an item that will automatically go into his inventory bag. Any ideas on how to achieve this?
Ok, I figured it out! Now, has anyone any idea how to link this item to an ability so that when I use the ability the item is destroyed? To be more specific, the unit builds a 'kit' with which you can build little 'bots'. When I use the ability I want the item to be destroyed so as to simulate assembling the kit.
For a start say how you did the first part.
Use charges and the destroy when depleted flag.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
I used the train ability to create the item unit. I set him up with an inventory and a bag that allows the holding of the item. I think I then set the unit to spawn at source and it turns out the editor takes that to mean 'put it in his bag' considering it is a carry-able item. Not entirely sure about that... I did click a load of buttons in the process of trying to get it to work.
I have been looking for a tutorial on charges but I can't find one. As it stands the item that he is creating is an 'scv kit'. he will then have to use the scv kit in order to 'assemble' it and create an scv. I have set up another train ability for the training of the scv and set the charges which is tested and works fine.
So I want the item to carry one charge for the ability and to be destroyed when depleted. How can I get the item to carry a charge for the ability?
@Rahrhino: Go
It's also worth noting that I don't have Heart of the Swarm and I think that means that I don't have the vulture - replenish effect
In your ability under cost i believe you set the max stacks and stacks used sections.
I guess it all depends on how you are making the item to create units or buildings in my map i use a create unit effect.
which is attached to an Ability Target Item
@zaysite: Go
I can do either way... I just prefer to use the train ability. With either method I still cannot figure out how to make the item carry a charge. I can set up charges for the ability. I can set it's max charges. I can set it to use one charge per use. I can do all of that fine. but...
I need the ITEM to have a carrying behavior(?) which increases the charge of the ABILITY by one. When the ABILITY is used then the ITEM is destroyed.
I have tried doing this by 'info - link - charge' but it seems that behaviors can't affect the charges of an ability and vice versa.
Ok so lets see if i got this:
You want an item that is only carried.
The Item doesn't cast the ability and you want an ability on your Unit that then updates the Charges of the item
Or Is it that you want your unit to have an ability that gets charges based on the charges of the item?
I believe in order to add charges from another ability you will need to use triggers
im unaware of how to change the items charges in using Behaviors or Data
I believe its a Catalog Function to access or you can use the Item Utility Library
http://www.sc2mapster.com/forums/resources/trigger-libraries/5636-library-item-utility-library/
EDIT:
Upon further testing i dont believe using a train ability is possible on an item all ways i tried resulted in the ability not showing up. i think its because it cant reference the Train abilities Info -> Train 01 -> Charge
Also i do not beleive Upgrades will work quite how you wish with the Ability Charges It might though.
Im just not sure what one you would add charges to the Charge Max, Charge Use or Charge Start
@zaysite: Go
Ah, that's interesting Zaysite. I think something like your grenade system would work just fine! However, in your tutorial using a charge of the item triggers an effect (launch grenade), Is there any way of making the use of an item trigger a train ability? That way I could set the item charge, max, and use all to 1 so that when I use it the ability will be used and the item will be destroyed.
I would like to keep the train ability because it behaves exactly as I would like it to.
The trouble I'm having is that charge links cannot be linked between effects, behaviours and abilities. If I could somehow have the item and the ability charge linked then this whole process would be incredibly easy.
@Rahrhino: Go
Hmmm, just had a thought. I could get rid of the whole item problem all together. I could make the 'build kit' ability a research ability with an upgrade that adds one charge to the 'assemble kit' ability. I think that would simulate having to build the kit before you can assemble it. I would have to give the upgrade infinite levels so that you could build as many kits as you want though. Is this a plausible solution or am I going in completely the wrong direction?
P.S. I greatly appreciate all of your help and I am learning a lot, thank you
@Rahrhino: Go
well another idea. would be give the item the ability and "assemble" is an order to the item to use the ability and after that the unit is destroyed. I believe it will be messy but could work.
cann you tell me why it has to be an item?? to you want to be able to trade these "kits" with other units??
@Shieldnutzz: Go
Oh that's a great idea Shieldnutzz. I assume that that is done in the trigger editor? I only posted in data because I am pretty clueless when it comes to triggers.
Yes, the bot kits should be items that can be traded between players. In my map there is one unit (the 'builder') who creates all the kits. He can then trade the kits with the other two units (the 'miner' and the 'commander'). The builder will make kits for bots that only certain other units can assemble.
e.g. the builder will make a 'scavenger bot kit' which he will then give to the 'miner' to assemble. The miner will assemble the 'scavenger bot kit' and the resulting bot (the 'scavenger') will then be under the control of the player who is controlling the 'miner'. It should be possible to give the 'scavenger bot kit' to the commander but he should NOT be able to assemble it (he can only assemble 'assault bot kits').
@Rahrhino: Go
there should be an effect called issue order. basicly I would try something like this (i cant test it right now) ....
build ability -> search effect for item with small radius like 0.1 (0 might work but im not sure) -> issue order "item ability"
Item ability -> create unit -> destroy item (damage with kill flag and target caster should do it)
that would would automaticly prevent commander to build scavenger, since they would search only for assault-bot-kit units
Ah, ok... i think we're getting there. So i've set up the item to have the issue order effect when used. The trouble I'm having now is getting the effect to target the unit. So we have the casting unit (the 'bot kit' in the inventory) and i need to make it's effect target the builder (the unit that is holding the 'bot kit')... any ideas?
@Rahrhino: Go
Right, so I've changed the item type to 'target'. now when i click the item in the inventory i can then target the unit which I want to issue the command to. I click the builder but an error comes up saying 'no unit able to handle that command'
@Shieldnutzz: Go
how would I set up a search effect to find the item?
Just set it to near 0 radius from the holding unit and hidden required. Check out my symbiote demo map for an example.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Rharhino, why would you click on the item. I thought the item should be automaticly used if the builder clicks on his "build bot" ability?? can you make a test- map with your stuff and attach it here? the way I thought of it, the builder has an ability "build bot" the item-UNIT has an ability which actually creates the bot. the item (in item tab) itself only has a dummy ability (I think its needed or else it doesnt show up). that way left-clicking the item doesnt do a damn thing. the builders ability has the issue order, which targets the item-UNIT and its ability.
@Shieldnutzz: Go
SUCCESS!!! I have a solution! The following is a full description for anyone else who sees this thread in the future with a similar puzzle.
I created a BEHAVIOR called 'carrying bot kit' which doesn't have any notable properties. I created a generic-type ITEM called 'bot kit'. The 'bot kit' ITEM carries the BEHAVIOR 'carrying bot kit'. I created a REQUIREMENT that requires BEHAVIOR 'carrying bot kit' to be completed at unit. I attached this REQUIREMENT to the ABILITY 'assemble bot kit'.
So now the unit is required to have the behavior 'carrying bot kit' to be able to use the ability. The only way to have that behavior is by having a bot kit in it's inventory. Next I needed the item to be destroyed after using the ability so as to simulate the kit being assembled into the bot.
I used a TRIGGER. Events -> unit uses assemble bot ability at generic6 - complete stage. Actions -> remove inventory item (item carried by (triggering unit) in <whichever slot the item is in>.
Now when the bot kit is in the unit's inventory the ability is made available. When it is used, the item is destroyed.
Thanks everyone for your help... I couldn't have solved this without your help and I greatly appreciate you guys taking the time to help me :)