Hi everyone, I have another complex and challenging concept to try to create with data. If I get an answer, I post it as a test map for the reference of the community though so cheers to that.
Anyway, the project I am working on has hero classes that use custom resources to craft ammo items. These items are ammunition for other player abilities and ability items.
Now the tricky part: I am trying to design a Mechanical Engineer hero that uses the previously mentioned custom resource to build a turret ability item that, when used, has the ME enter a setup phase to arm/build the turret (would like to use Terran build models and actors for setup if possible but not sure how they work) at target location. This turret unit has an ability that launches an artillery shell at a target location. The ability will require the previously mentioned ammo items to be created and loaded into the turret in order for it to shoot. The turret unit its self, once created, can be disarmed/taken down and transformed back into an item for relocation.
The problem: I'm guessing that when the turret is disarmed, it will lose any and all ammo that has been loaded into it, and once it is set up again it will start at 0 (charges/energy whatever the best way to keep track of ammo count is). Is there a way to create a concept like the one I have described here WITHOUT the turret losing its vital stats/ability charges/ammo count at the time it is disarmed and turned back into an item?
I would also like to ask that unless you have a fairly concrete understanding of what is going on or have a solution that you do not post so as to keep this thread from becoming insanely long. Thank you.
I've completed a framework test map with (surprise, surprise!) several issues. I will list these issues in order of importance:
(I will try to be as descriptive as possible to help you understand my setup, what is going on, save you time, and help you understand my objectives in case you decide to look at the test map I will attach below. I've also tried to fill in as many of the (Basic) Editor: Editor Description and (Basic) Editor: Editor Comment fields as possible in the data objects in my map. Also, the objects marked (unnamed) have been imported from another completed test map and do not require any attention.)
1. The building ability that the turret item uses does not work.
I'm trying to create an item. The item is an ability item. At the moment, It has an Effect - Target type ability in the (Basic) Basic: Ability field of the item. The Effect - Target ability has a Create Unit effect that is responsible for creating the turret unit at the target location. This setup works for placing the turret but it doesn't allow my hero unit to enter a setup phase when placing the turret. When my hero unit uses this item I want him to start setting up (building) the turret at the target location.
I am thinking that if I give the hero unit the ability to build the turret unit in his (Basic) Ability: Abilities field but don't add the ability to build to his command card, maybe I can use an issue order command on the ability item to have him start building the turret. The hero is going to be able to use several kinds of turrets as well as many other abilities though. If possible, a method that doesn't require the ability to be on the command card to save space would be ideal. I am still researching how to make a unit build a structure with an item on the forums and having no luck.
2. The items I have created to add charges to the turret's attack ability do not work.
The turret unit has an ability that launches an artillery shell at the target location and I would like to create items that can be loaded into the turret's inventory to replenish the charges of the ability. I have attempted two different methods:
An Ability type item attempt with a Specialize type ability based on the Vulture - Make Spider Mines ability.
A Generic type item attempt with a carry behavior. I have no idea how to set up the behavior to accomplish adding charges to an ability.
When the ability item is picked up, it doesn't appear in the inventory. I have a feeling this has something to do with how the Specialize ability is set up. When I link a Build type ability into the (Basic) Basic: Ability field of the ability item for the turret, the same thing happens. Maybe I need to use a Target type item for the turret to get it working but Build and Specialize abilities both use info fields rather than effect fields. It kinda seems like this causes the item to malfunction.
I still have a lot to learn about the editor so, if you post a solution, please try to be as specific as possible.
Also, again, please no half-baked/half-assed replies. Lets try to keep the forums concise and coherent so we don't waste everybody's time. Posting guess work wastes my time and it wastes yours.
Still looking at the problems here and trying out different solutions. However for your question about structure state persistence (unit state of building kept when returning to item and built again) one could use triggers. When you "pack" (return to item) a building you store it in a data list of unit and item pairs. When this happens you make the item for it and hide the building. When you place the item you then recall it from the list, move it to its new position and then unhide it.
For the building problem you could simulate "building". When the unit is placed (item removed) you place the working unit type, reduce its health and then give it a disable buff with the appropriate build time. Your unit can then be ordered to build the building with some kind of dummy target ability that channels. The disable buff has a timeout of build time seconds, does not tick when disabled and has a enable validator of another "being built" buff. The being built buff is provided by the dummy build ability. All construction phases can probably be animated with a lot of actor tinkering based on health or something.
Your charges problem is likely because your charge "location" on the "105mm Anti-Armor Shell (Functional)" is wrong. It has to be "Unit" since then the charge information is stored on the unit. The location "Ability" means it is stored on the ability and so cannot be easily modified by other abilities. If you want charges to be shared or manipulated across abilities per unit then the charge location must be "Unit". Not sure if this solves it (still trying to understand how the mine ability works) but it makes sense from personal experience with other abilities (eg the UA3 SFAAT Jav LN sharing rocket charges between AT and HE).
I changed the charge cost location on the Carry Behavior attempt to Unit and the item now adds charges to the ability on the turret when it is loaded into the turret's inventory. The item doesn't get consumed in the process though and I can't figure out how to make that happen.
I tried setting the charge cost (Max), (Start), and (Use) to 1 in the behavior Cost field but that didn't do anything. Right now, the unit can keep putting down and picking up the item to gain charges which is not what i want.
With an ability item, I think the item measures how many charges it has by the charge cost (Start) and (Use) of the ability linked to it to determine when the item is used up. I'm not sure how to do this for an item that has a carry behavior or if its even possible. I have the Destroy When Depleted flag check for both items.
I tried to do the same fix for the ability item but it is not working at all. I continues to disappear as soon as it is picked up by a unit with an inventory.
Edit: I also apologize for the late reply. I had gotten totally burnt out on trying to figure this and another test map out and said 'fuck it' for a while.
Just answering based off of the title, I don't know what you've solved so far, but you could either move the unit off the playable map, so that it still exists, and you can swap it back in the game later without having to recreate the unit. Or, you could save the stats you want to variables and modify it via triggers.
Ok. So when I say move the unit off the map. I mean like create a small Island using the terrain tools (hotkey is T), Then under pathing (hotkey H), add no fly zones around the island so players cant accidentally stumble upon it. Then under points (hotkey P), Add a point or two.
Now you're ready for triggers. Click on any trigger, then press ctrl + w to make a new one. Name it whatever, but it will be moving your units so you could name accordingly if you like that naming style. Additionally, right click the side panel and create a global variable of type "unit", with the array slot checked and with the amount of however many players you have. Now go to the "Event" in that new trigger, click it and again press ctrl + W. Search for the event "Unit uses Ability", and there should be a colored link option that says "Ability", click it to change it and change it to the item ability you were talking about. Now, click the "Actions" part of the trigger and press ctrl + W again. Click ok to make the default action which is "set variable". Click the first colored word, then go to the variables tab and find the unit variable you made. A number should appear next to it, click that and go to the "function" tab. Find "Owner of unit", and click ok. Now click the other colored word that hasn't been changed yet, and go to the function tab again and find "triggering unit". Now make an action called "create unit", and pick the item you want to be placed under the clickable colored word Set the player to create units for to be "owner of unit" like before. Now make a new action. Find the "Move Unit Instantly" action. Then click on the colored word "Point", and there should be a list of your points, find the one you want on the island you made and click ok.
Now you need to make it work in reverse. So, make a new trigger using the same steps as above, only this time make the event ability into the ability that the item uses to turn into a unit. Now continue with the same steps as before only Do not set the variable this time. Using the same move unit action as before (you can even copy paste the whole trigger and delete the variable part/change the values needed if that's easier.) click the colored option for the point and click the function tab and find "position of unit", click ok and find the part of that new action that says "triggering unit"(there will be 2, click the first one). click that and go to the variable tab and find the unit variable you made earlier. Again change the 0 that appears to "owner of unit" as described before. Now make a new action called "remove unit" and leave it at the default.
Hi everyone, I have another complex and challenging concept to try to create with data. If I get an answer, I post it as a test map for the reference of the community though so cheers to that.
Anyway, the project I am working on has hero classes that use custom resources to craft ammo items. These items are ammunition for other player abilities and ability items.
Now the tricky part: I am trying to design a Mechanical Engineer hero that uses the previously mentioned custom resource to build a turret ability item that, when used, has the ME enter a setup phase to arm/build the turret (would like to use Terran build models and actors for setup if possible but not sure how they work) at target location. This turret unit has an ability that launches an artillery shell at a target location. The ability will require the previously mentioned ammo items to be created and loaded into the turret in order for it to shoot. The turret unit its self, once created, can be disarmed/taken down and transformed back into an item for relocation.
The problem: I'm guessing that when the turret is disarmed, it will lose any and all ammo that has been loaded into it, and once it is set up again it will start at 0 (charges/energy whatever the best way to keep track of ammo count is). Is there a way to create a concept like the one I have described here WITHOUT the turret losing its vital stats/ability charges/ammo count at the time it is disarmed and turned back into an item?
Edit: I forgot to mention I have already completed the turret and its ability. They can be found here: http:www.sc2mapster.com/forums/development/data/78699-solved-artillery-turret-making-a-turret-face-ability/#p7.
I would also like to ask that unless you have a fairly concrete understanding of what is going on or have a solution that you do not post so as to keep this thread from becoming insanely long. Thank you.
I've completed a framework test map with (surprise, surprise!) several issues. I will list these issues in order of importance:
(I will try to be as descriptive as possible to help you understand my setup, what is going on, save you time, and help you understand my objectives in case you decide to look at the test map I will attach below. I've also tried to fill in as many of the (Basic) Editor: Editor Description and (Basic) Editor: Editor Comment fields as possible in the data objects in my map. Also, the objects marked (unnamed) have been imported from another completed test map and do not require any attention.)
1. The building ability that the turret item uses does not work.
I'm trying to create an item. The item is an ability item. At the moment, It has an Effect - Target type ability in the (Basic) Basic: Ability field of the item. The Effect - Target ability has a Create Unit effect that is responsible for creating the turret unit at the target location. This setup works for placing the turret but it doesn't allow my hero unit to enter a setup phase when placing the turret. When my hero unit uses this item I want him to start setting up (building) the turret at the target location.
I am thinking that if I give the hero unit the ability to build the turret unit in his (Basic) Ability: Abilities field but don't add the ability to build to his command card, maybe I can use an issue order command on the ability item to have him start building the turret. The hero is going to be able to use several kinds of turrets as well as many other abilities though. If possible, a method that doesn't require the ability to be on the command card to save space would be ideal. I am still researching how to make a unit build a structure with an item on the forums and having no luck.
I'd also like to have the Terran Build model to play while the turret is being built. I've tried to set up the correct actors but haven't had a chance to test them because the item is not functioning properly yet. I've taken info from this page: www.sc2mapster.com/forums/development/data/19043-what-causes-scv-build-frame-animations/#p3
2. The items I have created to add charges to the turret's attack ability do not work.
The turret unit has an ability that launches an artillery shell at the target location and I would like to create items that can be loaded into the turret's inventory to replenish the charges of the ability. I have attempted two different methods:
When the ability item is picked up, it doesn't appear in the inventory. I have a feeling this has something to do with how the Specialize ability is set up. When I link a Build type ability into the (Basic) Basic: Ability field of the ability item for the turret, the same thing happens. Maybe I need to use a Target type item for the turret to get it working but Build and Specialize abilities both use info fields rather than effect fields. It kinda seems like this causes the item to malfunction.
I still have a lot to learn about the editor so, if you post a solution, please try to be as specific as possible.
Also, again, please no half-baked/half-assed replies. Lets try to keep the forums concise and coherent so we don't waste everybody's time. Posting guess work wastes my time and it wastes yours.
Sorry for delayed reply.
Still looking at the problems here and trying out different solutions. However for your question about structure state persistence (unit state of building kept when returning to item and built again) one could use triggers. When you "pack" (return to item) a building you store it in a data list of unit and item pairs. When this happens you make the item for it and hide the building. When you place the item you then recall it from the list, move it to its new position and then unhide it.
For the building problem you could simulate "building". When the unit is placed (item removed) you place the working unit type, reduce its health and then give it a disable buff with the appropriate build time. Your unit can then be ordered to build the building with some kind of dummy target ability that channels. The disable buff has a timeout of build time seconds, does not tick when disabled and has a enable validator of another "being built" buff. The being built buff is provided by the dummy build ability. All construction phases can probably be animated with a lot of actor tinkering based on health or something.
Your charges problem is likely because your charge "location" on the "105mm Anti-Armor Shell (Functional)" is wrong. It has to be "Unit" since then the charge information is stored on the unit. The location "Ability" means it is stored on the ability and so cannot be easily modified by other abilities. If you want charges to be shared or manipulated across abilities per unit then the charge location must be "Unit". Not sure if this solves it (still trying to understand how the mine ability works) but it makes sense from personal experience with other abilities (eg the UA3 SFAAT Jav LN sharing rocket charges between AT and HE).
I changed the charge cost location on the Carry Behavior attempt to Unit and the item now adds charges to the ability on the turret when it is loaded into the turret's inventory. The item doesn't get consumed in the process though and I can't figure out how to make that happen.
I tried setting the charge cost (Max), (Start), and (Use) to 1 in the behavior Cost field but that didn't do anything. Right now, the unit can keep putting down and picking up the item to gain charges which is not what i want.
With an ability item, I think the item measures how many charges it has by the charge cost (Start) and (Use) of the ability linked to it to determine when the item is used up. I'm not sure how to do this for an item that has a carry behavior or if its even possible. I have the Destroy When Depleted flag check for both items.
I tried to do the same fix for the ability item but it is not working at all. I continues to disappear as soon as it is picked up by a unit with an inventory.
Edit: I also apologize for the late reply. I had gotten totally burnt out on trying to figure this and another test map out and said 'fuck it' for a while.
@EntityEnigma: Go
Just answering based off of the title, I don't know what you've solved so far, but you could either move the unit off the playable map, so that it still exists, and you can swap it back in the game later without having to recreate the unit. Or, you could save the stats you want to variables and modify it via triggers.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here
Ok. So when I say move the unit off the map. I mean like create a small Island using the terrain tools (hotkey is T), Then under pathing (hotkey H), add no fly zones around the island so players cant accidentally stumble upon it. Then under points (hotkey P), Add a point or two.
Now you're ready for triggers. Click on any trigger, then press ctrl + w to make a new one. Name it whatever, but it will be moving your units so you could name accordingly if you like that naming style. Additionally, right click the side panel and create a global variable of type "unit", with the array slot checked and with the amount of however many players you have. Now go to the "Event" in that new trigger, click it and again press ctrl + W. Search for the event "Unit uses Ability", and there should be a colored link option that says "Ability", click it to change it and change it to the item ability you were talking about. Now, click the "Actions" part of the trigger and press ctrl + W again. Click ok to make the default action which is "set variable". Click the first colored word, then go to the variables tab and find the unit variable you made. A number should appear next to it, click that and go to the "function" tab. Find "Owner of unit", and click ok. Now click the other colored word that hasn't been changed yet, and go to the function tab again and find "triggering unit". Now make an action called "create unit", and pick the item you want to be placed under the clickable colored word Set the player to create units for to be "owner of unit" like before. Now make a new action. Find the "Move Unit Instantly" action. Then click on the colored word "Point", and there should be a list of your points, find the one you want on the island you made and click ok.
Now you need to make it work in reverse. So, make a new trigger using the same steps as above, only this time make the event ability into the ability that the item uses to turn into a unit. Now continue with the same steps as before only Do not set the variable this time. Using the same move unit action as before (you can even copy paste the whole trigger and delete the variable part/change the values needed if that's easier.) click the colored option for the point and click the function tab and find "position of unit", click ok and find the part of that new action that says "triggering unit"(there will be 2, click the first one). click that and go to the variable tab and find the unit variable you made earlier. Again change the 0 that appears to "owner of unit" as described before. Now make a new action called "remove unit" and leave it at the default.
So Heres what it would look like:
Hope this helps.
New to the Editor? Need a tutorial? Click Here
Want data assets? Click Here