• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Hero Abilties - Levels

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
I want to create a grenade spell with 4 levels. I noticed you can adjust the cooldowns, energy requirements, etc
using the "Cost: cost+" field. If I edit the effects field, it changes the damage for all levels right? However, I want
to have a different amount of damage for each level. Do I really need to make 4 seperate effects for the one ability?



And another off topic question. Does starcraft 2 have memory leaks like warcraft? (referencing points, picking players without destroying the force, etc)

  • Unit - Create 1 Jim Raynor (Commando) for player (Triggering player) at (Center of Hero Spawn) using default facing (No Options)
  • Player Group - Pick each player in (Active Players) and do (Actions)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I want to create a grenade spell with 4 levels. I noticed you can adjust the cooldowns, energy requirements, etc
using the "Cost: cost+" field. If I edit the effects field, it changes the damage for all levels right? However, I want
to have a different amount of damage for each level. Do I really need to make 4 seperate effects for the one ability?

You trigger enhance the effect. Read the ability level and deal damage based on a formula. What is important is that you use an event that only fires for that effect small scope event) as large scale events (any effect) have limited sockets and result is extra unnecessary threads.

And another off topic question. Does starcraft 2 have memory leaks like warcraft? (referencing points, picking players without destroying the force, etc)
Common types are garbage collected in StarCraft II. Obviously you can still leak stuff if you tried but that is more the result of stupid scripting or very small game bugs which get resolved with each patch.

StarCraft II uses a lot of bounded structures so even structures that are not garbage collected have a finite quantity so leak impact is capped.

Galaxy is faster than JASS as well as does not suffer from bugs such as local handle leaks and string leaks.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Im sorry for a really late reply, I've had school exams. I am very familiar with the GUI warcraft 3 editor. I understand if there
is no ability to do a certain effect (for example a basic aoe spell) you have to trigger it and use dummy abiltites, etc.

However, there is an ability in the starcraft 2 editor called "Raynor - Toss Grenade". I don't fully understand the SC2 editor,
but you click the abilities' effect, you can then you can modify the damage field. So I can get level 1 working fine.
I want to increase the damage for each level though. How to modify the damage for each level?

Example
Level 1 - 100 damage
Level 2 - 150 damage
Level 3 - 200 damage
Level 4 - 250 damage.

In warcraft 3, you had a seperate field for each level. In starcraft 2 I can see a damage field, but I don't see how
to modify the damage for each individual level.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You have to run a separate effect chain for each level which result in different damage effects running (a lot of effect entries).

The only other way is to deal no damage directly with the effect and instead use trigger script to compute the damage based on ability level. All levels would be set to use the same effect chain then.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
In that case, triggering seems like less work. One minor problem, is like warcraft 3, the damage trigger will function before
the projectile has actually hit the unit (so the unit receives damage before the missle actual hit him)?

And could you either link me to a tutorial or help me with the triggering. I managed to get this far. I'm having trouble
getting the right "pick each unit in" command.

  • Grenade
    • Events
      • Unit - Any Unit uses Raynor - Grenade at Generic1 - Any stage (Ignore shared abilities)
    • Local Variables
    • Conditions
    • Actions
      • Unit Group - Pick each unit in (Any units in (Region((Point(0.0, 0.0)), 1.0)) owned by player 13 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
        • Actions
          • Environment - Deal damage using Raynor - Toss Grenade (Damage) on (Picked unit) from (Triggering unit) with (50.0 + (50.0 * (Charge Max Count for ability Raynor - Grenade on unit No Unit))) extra damage
Thanks for the help so far.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You are after enhancing the damage effect, not the ability.

There is an event which runs a trigger when a certain effect occurs. You can get the units involved with the effect using the references used by effects (there is a native to get them in response to the event). There seems to be only a small problem of some of the references returning different units from what they do for effects, this is probably a bug where some reference types are swapped.

Here is an example...
  • Untitled Trigger 001
    • Events
      • Environment - Player Any Player uses Effect Probe - Particle Beam (Damage)
    • Local Variables
    • Conditions
    • Actions
      • Environment - Deal damage using Purifier - Planet Cracker Damage on (Triggering Effect Unit(Target)) from (Triggering Effect Unit(Source)) with ((Real((Current level for ability Ghost Academy - Arm Magazine (Nuke) on (Triggering Effect Unit(Source))))) * 10.0) extra damage
Use appropiate references (I just chose any random reference).
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
Hopefully one last question (lol). I think it would be easier referencing a unit with a target spell, but the
spell im using is an AOE spell, meaning i dont select any particular unit. How do I reference the targeted
units in this case?

  • Grenade
    • Events
      • Environment - Player Any Player uses Effect Raynor - Toss Grenade (Damage)
    • Local Variables
    • Conditions
    • Actions
      • Environment - Deal damage using Raynor - Toss Grenade (Damage) on (Triggering Effect Unit(Target)) from (Triggering unit) with 100.0 extra damage
In game I recieve the following error message upon using my ability:

has no matching event
Trigger error in 'gt_Grenade_func'
could not get 'attacker' from
parameter in 'UnitDamage' (Value: 0#0)


Thanks very much for your help, I'm just finding it difficult to use the SC2 Editor.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Hopefully one last question (lol). I think it would be easier referencing a unit with a target spell, but the
spell im using is an AOE spell, meaning i dont select any particular unit. How do I reference the targeted
units in this case?
The same way you do in effects. Events that run in response to effects are piped the same target information as the effect was given.

In game I recieve the following error message upon using my ability:
There is no triggering unit... You will need to get the effect source or caster.
 
Level 16
Joined
Mar 27, 2011
Messages
1,349
This is too painful. I've tried every combination of "Environment - TriggeringEffectUnit" and it still does not work...
I'll upload the map if anyone can be bothered taking a look.

If you test, pick Jim Raynor and learn his grenade ability

Excuse the map, my first Starcraft map, everything is mainly experimental.
 

Attachments

  • Terran Base Defence.SC2Map
    2 MB · Views: 439
Status
Not open for further replies.
Top