Hello all, I asked this about a year ago but with the changes to the editor since then I think it's worth asking again.
I'm making an RPG where the enemies can drop items. I was looking to use a system similar to Diablo, where there is a base item, and a random prefix and suffix.
If I was to do this in SC2 would I be able to have a base item (eg. Knife), and have a pool of prefixes and a poll of suffixes that have a chance to spawn on the item and modify what it does (eg. Rusty Knife, less damage), or would I have to manually make every combination of prefixes and suffixes in the editor?
If I was to do this in SC2 would I be able to have a base item (eg. Knife), and have a pool of prefixes and a poll of suffixes that have a chance to spawn on the item and modify what it does (eg. Rusty Knife, less damage), or would I have to manually make every combination of prefixes and suffixes in the editor?
I would recommend a trigger system for this. The data editor is not that good with "random" things. It should be quite easy to make such a system. The attribute modification can be done with stacking buffs which are applied by the trigger and are placed on the items themselves (to keep track of quality). Save/load would obviously need to store the quality of the affix rolls for each item (remember to validate with affix to prevent people loading impossible items). On pickup add the affix buff stack count to the unit, on drop remove the same amount. Tooltips are more tricky, you might need a trigger based dialog system to display the affixes and affix quality of each item. Otherwise standard data inventory system should be enough to hold and manage the items.
I would recommend a trigger system for this. The data editor is not that good with "random" things. It should be quite easy to make such a system. The attribute modification can be done with stacking buffs which are applied by the trigger and are placed on the items themselves (to keep track of quality). Save/load would obviously need to store the quality of the affix rolls for each item (remember to validate with affix to prevent people loading impossible items). On pickup add the affix buff stack count to the unit, on drop remove the same amount. Tooltips are more tricky, you might need a trigger based dialog system to display the affixes and affix quality of each item. Otherwise standard data inventory system should be enough to hold and manage the items.
Not sure I quite understand how to do this, but think I understand what you mean. If a zergling dropped the example knife, how would a trigger system do the following things:
1) Check that an item dropped
2) Rename the item to include the randomly added affixies (if any)
3) Change the buffs the item applies to the hero when equipped
4) Keep these changes when the item is put in and out of an inventory (this might be automatic?)
Even if you can't answer these, thanks for getting the ball rolling :)
1. When an item is dropped a unit is created so that is pretty easy to find with triggers. Especially if your item affix has a large range of values using triggers would be easier than data where a Create Persistent effect uses random effects that use several Apply Behavior effects with a chance of success (this approach would create a stat distribution profile). The data approach would also become clunky if there is a large number of different possible affixes (if more than 64 use triggers).
2. Buff behaviours have a Unit: Modification - Unit Name Override field. Alternatively you just need the name of the item to have two local variables on either side of it that triggers convert to a space if there is no affix applied.
3. When items are in an inventory they gain the Hidden flag. This means a 0 radius search area effect can be used to interact with items in the inventory. You can then make a simple counter system that adds/removes buff stacks to the holding unit. If you get funky with the requirements used by the counter system items can even give +/-% stats (so yes you can make an axe that halves your defence and doubles your strength). My Choosable Attribute System and Items Test demo maps (available upon request) tested similar systems out.
4. If the item interacts with the unit there will be no need to transfer stuff off the item so dropping it again would be no issue.
1. When an item is dropped a unit is created so that is pretty easy to find with triggers. Especially if your item affix has a large range of values using triggers would be easier than data where a Create Persistent effect uses random effects that use several Apply Behavior effects with a chance of success (this approach would create a stat distribution profile). The data approach would also become clunky if there is a large number of different possible affixes (if more than 64 use triggers).
2. Buff behaviours have a Unit: Modification - Unit Name Override field. Alternatively you just need the name of the item to have two local variables on either side of it that triggers convert to a space if there is no affix applied.
3. When items are in an inventory they gain the Hidden flag. This means a 0 radius search area effect can be used to interact with items in the inventory. You can then make a simple counter system that adds/removes buff stacks to the holding unit. If you get funky with the requirements used by the counter system items can even give +/-% stats (so yes you can make an axe that halves your defence and doubles your strength). My Choosable Attribute System and Items Test demo maps (available upon request) tested similar systems out.
4. If the item interacts with the unit there will be no need to transfer stuff off the item so dropping it again would be no issue.
Thanks for this, might mess up putting this in but it seems pretty solved.
I would note that SC2 does include a loot system, but it is poorly documented. The Loot data type is specifically for this and you can setup units to drop things on death via their Loot field. The Loot can be randomized and you can have it drop other units, items and effects (so you could use it to give buffs on death).
Validators can be then used to control what gets dropped or not.
I would note that SC2 does include a loot system, but it is poorly documented. The Loot data type is specifically for this and you can setup units to drop things on death via their Loot field. The Loot can be randomized and you can have it drop other units, items and effects (so you could use it to give buffs on death).
Validators can be then used to control what gets dropped or not.
But can it randomize the properties of the items dropped? That is where triggers are probably the only viable solution. Data could be used to drop the items, but the item properties need to be randomized with a trigger system of sorts.
3. When items are in an inventory they gain the Hidden flag. This means a 0 radius search area effect can be used to interact with items in the inventory. You can then make a simple counter system that adds/removes buff stacks to the holding unit.
1) Can you be more specific on how this counter system would work? The items test demo map might also help explain this. 2) How would this be used to modify a weapon's damage, attack speed, etc. directly?
Tooltips are more tricky, you might need a trigger based dialog system to display the affixes and affix quality of each item. Otherwise standard data inventory system should be enough to hold and manage the items.
3) How would this counter system be able to effect the item's tooltip? Preferably not using dialog.
1. Having thought about it more, the counter system would be problematic if a unit can hold multiple of the same item type. This would also be problematic if the unit can carry items that are not equipped.
The first step is to have a Buff behaviour on the unit given by the item that uses a periodic Search Area effect which has 0 radius and requires the Hidden and Item attributes. The search applies a Set effect to the items in the inventory that uses Apply and Remove Behavior effects which are validated by Unit Compare Behavior Count validators that use the target of the Set effect as the Other Unit. This is used to copy item attribute buff stacks to the holding unit. The Set effect is validated by a Unit Type validator so as to keep attribute points from different item classes orthogonal. A second Buff on the holding unit uses a Set effect with more Apply and Remove Behavior effects which are validated by Player Requirement validators that use requirements to sum up all the buff stacks on the holding unit from all the items and factor in any multipliers. This counter system then applies a final different Buff stack which gives the Attribute behaviour points seen in the UI.
A Transfer Behavior effect with the Preserve flag could also be used but that effect type is bugged in that it generates an extra stack when copying behaviour stacks. Also purging stacks when an item is removed from the inventory would be difficult.
2. Read the fields Attribute type behaviours have. They can increase vitals, damage, attack speed, movement speed and a whole lot more.
3. Depends how many attributes each item can have and how you want the names to change when there are certain combinations of attributes.
Pm me your email and I will send you the demo maps.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Hello all, I asked this about a year ago but with the changes to the editor since then I think it's worth asking again.
I'm making an RPG where the enemies can drop items. I was looking to use a system similar to Diablo, where there is a base item, and a random prefix and suffix.
If I was to do this in SC2 would I be able to have a base item (eg. Knife), and have a pool of prefixes and a poll of suffixes that have a chance to spawn on the item and modify what it does (eg. Rusty Knife, less damage), or would I have to manually make every combination of prefixes and suffixes in the editor?
I would recommend a trigger system for this. The data editor is not that good with "random" things. It should be quite easy to make such a system. The attribute modification can be done with stacking buffs which are applied by the trigger and are placed on the items themselves (to keep track of quality). Save/load would obviously need to store the quality of the affix rolls for each item (remember to validate with affix to prevent people loading impossible items). On pickup add the affix buff stack count to the unit, on drop remove the same amount. Tooltips are more tricky, you might need a trigger based dialog system to display the affixes and affix quality of each item. Otherwise standard data inventory system should be enough to hold and manage the items.
1. When an item is dropped a unit is created so that is pretty easy to find with triggers. Especially if your item affix has a large range of values using triggers would be easier than data where a Create Persistent effect uses random effects that use several Apply Behavior effects with a chance of success (this approach would create a stat distribution profile). The data approach would also become clunky if there is a large number of different possible affixes (if more than 64 use triggers).
2. Buff behaviours have a Unit: Modification - Unit Name Override field. Alternatively you just need the name of the item to have two local variables on either side of it that triggers convert to a space if there is no affix applied.
3. When items are in an inventory they gain the Hidden flag. This means a 0 radius search area effect can be used to interact with items in the inventory. You can then make a simple counter system that adds/removes buff stacks to the holding unit. If you get funky with the requirements used by the counter system items can even give +/-% stats (so yes you can make an axe that halves your defence and doubles your strength). My Choosable Attribute System and Items Test demo maps (available upon request) tested similar systems out.
4. If the item interacts with the unit there will be no need to transfer stuff off the item so dropping it again would be no issue.
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 would note that SC2 does include a loot system, but it is poorly documented. The Loot data type is specifically for this and you can setup units to drop things on death via their Loot field. The Loot can be randomized and you can have it drop other units, items and effects (so you could use it to give buffs on death).
Validators can be then used to control what gets dropped or not.
Going to re-open this as I have a few more related questions.
2) How would this be used to modify a weapon's damage, attack speed, etc. directly?
1. Having thought about it more, the counter system would be problematic if a unit can hold multiple of the same item type. This would also be problematic if the unit can carry items that are not equipped.
The first step is to have a Buff behaviour on the unit given by the item that uses a periodic Search Area effect which has 0 radius and requires the Hidden and Item attributes. The search applies a Set effect to the items in the inventory that uses Apply and Remove Behavior effects which are validated by Unit Compare Behavior Count validators that use the target of the Set effect as the Other Unit. This is used to copy item attribute buff stacks to the holding unit. The Set effect is validated by a Unit Type validator so as to keep attribute points from different item classes orthogonal. A second Buff on the holding unit uses a Set effect with more Apply and Remove Behavior effects which are validated by Player Requirement validators that use requirements to sum up all the buff stacks on the holding unit from all the items and factor in any multipliers. This counter system then applies a final different Buff stack which gives the Attribute behaviour points seen in the UI.
A Transfer Behavior effect with the Preserve flag could also be used but that effect type is bugged in that it generates an extra stack when copying behaviour stacks. Also purging stacks when an item is removed from the inventory would be difficult.
2. Read the fields Attribute type behaviours have. They can increase vitals, damage, attack speed, movement speed and a whole lot more.
3. Depends how many attributes each item can have and how you want the names to change when there are certain combinations of attributes.
Pm me your email and I will send you the demo maps.
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