Spire's Question Thread!(Generous with rep ^^)

S

Sunny_D

Guest
here is a trigger you can use. should work - MUI and leak-free afaik! ;)

picks only alive units owned by player 12 within range of 600 of target point and each picked enemy has a 1/50 chance to increase the heroes stats by (Level of spell / 2)

Code:
Soul Steal
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to SoulSteal
    Actions
        Set Counter = 0
        Set TempLoc = (Target point of ability being cast)
        Set TempGroup = (Units within 600.00 of TempLoc matching ((Owner of (Matching unit)) Equal to Player 12 (Brown)))
        Unit Group - Pick every unit in TempGroup and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked unit) is alive) Equal to True
                    Then - Actions
                        Set Counter = (Counter + 1)
                    Else - Actions
        For each (Integer A) from 1 to Counter, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 50) equal to 25
                    Then - Actions
                        Hero - Modify Strength of (Triggering unit): Add ((Level of SoulSteal for (Triggering unit)) / 2)
                        Hero - Modify Agility of (Triggering unit): Add ((Level of SoulSteal for (Triggering unit)) / 2)
                        Hero - Modify Intelligence of (Triggering unit): Add ((Level SoulSteal for (Triggering unit)) / 2)
                    Else - Actions
        Custom script: call DestroyGroup (udg_TempGroup)
        Custom script: call RemoveLocation (udg_TempLoc)
 
M

Mythic Fr0st

Guest
hmmm

Variables:

Real, real, array 1
Int, integer, no array
Selection_Group, unit group, array 1


Code:
Event
   - A unit starts the effects of an ability
Conditions ability being cast equal to "null"
Actions
   - set Real[0] = 0
   - set Int = level of ability being cast
   - set Selection_Group[0] = units within range of 600 of casting unit matching condition matching unit is alive AND matching unit is an enemy of casting unit
   - Pick every unit in Selection_Group[0] and do actions
     - loop
         - set Real[0] = Real[0] + 2
   - For each Integer A from 1 to Number of units in Selection_Group[0]
       loop
        if random number between 1.00 and 100.00 greater than or equal to 50 - Real[0]
       - then
         -
         Hero - Modify Strength of (Triggering unit): Add ((Int * 2) / 2)

//50 is your base chance, you could make it 101, so if theres no units, you have no chance

that should work
 
S

spiremk

Guest
It's Strange... Thanks Sunny D... your methods works...

However, I cant seem to get any increase in the stats when the increment has a variable in it. For example:

Code:
Modify Agility of (Triggering unit): Add ((Level of SoulSteal for (Triggering unit)) / 2)

The above won't work... but the one below will...

Code:
Modify Strength of (Triggering unit): Add 10

What is the problem here? Do I have to convert the variable to real b4 I start? I need the first code to work...

Anyway... +rep for Sunny for his working trigger...!!!

^^
 
S

Sunny_D

Guest
well, when i tested it, it works perfectly!

are you sure that you dont use level 1 abilities? because 1 / 2 returns 0 (because in integers only whole numbers are allowed). so you have to either change the mathematics a little or you have to use at least a level 2 spell ;)
 
S

spiremk

Guest
O... I didnt know... I'll probably retry this trigger tonight...

Anyway, I'm making a skill called Retribution that is based off Storm Bolt.

It should be cast on enemies and lasts for x seconds. After the 'x' duration, all the damage dealt by the target within the stated duration will damage the target itself with the multiplier of 2/4/6.

How do I start this skill... Any leads?
 

Nigerianrulz

suga suga how'd you get so fly?
Reaction score
198
since the spell last for x second it would better to use a channeling spell preferrably 'life steal' coz it takes damage every second and for the hero's self damage could be done with a trigger but i cant do it for the moment maybe someone could do that for you
 
S

Sunny_D

Guest
thats a tough spell... hm... duno how you could effectively detect the damage from all things... considering that also heal spells, regeneration and life leaching effects can appear...
 

Slywolf15

Member
Reaction score
5
I have a question, I'm trying to make an ability like this. This move increases attack speed, and makes the user immune to spells for a short ammount of time. (upon activation, this move removes all buffs eg. stun, slow, poison, ect...) Anywho I know I can base the move off of avatar but i'm not sure how to make it increase a percentage of attack speed each time you level it up. I heard you may be able to do it using a dummy unit but I really don't know how dummy units work so an explanation would be very helpful.
 
S

spiremk

Guest
Doesn't anyone know how to do 'Retribution' spell? It is supposed to store all the damage the target does for 15 seconds. After the 15 seconds are up, the target will receive 2/4/6 damage multiplier back to him...

I'll rep anyone who gives a good answer...
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
here try this:
Variables: DamageReal is Real type Variable and DamageInteger is Integer type And CounterTimer is Timer type Variable.
Code:
Counter Attack Skill
Event
    Unit - unit starts the effect of an ability
Condition
    (Ability being cast) equal to Counter Attack
Action
    Set Countering Unit = (Triggering unit)
    Countdown Timer - Start CounterTimer as a One-shot timer that will expire in 15.00 seconds
    Turn On Counter Attack Charge <gen>
then:
Code:
Counter Attack Charge
Event
    Unit - Countering Unit takes damage
Condition
Action
    Set DamagReal = (Damage taken)
    Set DamageInteger = (DamageInteger + (Integer(DamagReal)))
    Turn On Counter Attack Time <gen>
then:
Code:
Counter Attack Time
Event
   Time - CounterTimer expires
Condition
Action
   Turn Off Counter Attack Charge <gen>
   Turn On Counter Attack Release <gen>
then:
Code:
Counter Attack Release
Event
   Unit - Countering Unit Is issued an order targeting an object
Condition
   (Triggering unit) equal to your unit
Action
   Set DamagReal = (Real(DamageInteger))
   Unit - Set life of (Attacked unit) to ((Life of (Triggering unit)) - DamagReal*(2 or 4 or 6))
   Turn Off Counter Attack Release <gen>
make sure that Counter Attack Release <gen> and Counter Attack Charge <gen> will be Initially off
i think thats what u are looking for if u got questions about it u can ask me :p
besides if u want to make it MUI all u need to do is use arrays and if im right mabye even just put (Player Number of (Triggering Player)) to save triggers for urself
hope i helped :D
 
S

Sunny_D

Guest
just a sidenote: unit takes damage doesnt exist for generic unit events. and i wonder why you convert to integer and then back to real?

set damageReal = 0
set damageReal = damageReal + (DamageTaken)

making that one MUI would be a little harder... but thats already roughly how it should be done i think... mb ill give it a try later but for now im pretty busy :)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
just a sidenote: unit takes damage doesnt exist for generic unit events.
look good and u will see it does exist (4th in the list from top).
and i wonder why you convert to integer and then back to real?
it takes the damage which was taken and add it to the total damage (integer), and to lower attacked unit's life i need a real variable so i convert the integer back to real.
 
S

Sunny_D

Guest
look good and u will see it does exist (4th in the list from top)

you must have edited your post. because you first had written something like that:

Code:
Unit takes damage
Unit-Type equal to MyUnit
....

and from this it definately follows that you meant a generic unit event first! im sure about that because otherwise i would not have posted it :p
 
S

spiremk

Guest
It exists as the 4th from the top?

No, it doesnt lol. For generic units there's no event such as 'take damage'. It only exists in Specific Unit events, but I can't choose the triggering unit or insert any unit variables...

Can you make yourself clearer?
 

Tom Jones

N/A
Reaction score
437
You'll need to add the event to the trigger trough another trigger.
Code:
Events
A unit starts the effect of an ability
Actions
Trigger - Add the event Trigger Unit takes damage to *some trigger*
 
S

spiremk

Guest
You can't put any variable into unit specific... thats the point...

Thats why your second trigger won't work...
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
k i got a solution for u just switch "takes damage" with "Is Attacked"
it think it will work fine
 
S

spiremk

Guest
First of all, +rep to Doom-Angel for giving a base idea of wad such a skill could be done using triggers... However, I don't think he got my idea of the way I actually wanted it to be... Here's a clearer scenario:

Caster casts Retribution on Enemy A. After 15 seconds, all the damage DONE to other units BY Enemy A will be inflicted back to him in 3/6/9 multiplier.

Hope this was clearer...

Anyway, I have modified Doom's triggers to make one of my own.

Code:
Retribution Initialization
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Retribution (Spirit)
    Actions
        Set RetributionCaster = (Triggering unit)
        Set RetributionTarget = (Target unit of ability being cast)
        Countdown Timer - Start RetributionTimer as a One-shot timer that will expire in 15.00 seconds
        Trigger - Turn on Retribution Charge <gen>

Code:
Retribution Charge
    Events
        Unit - A unit Is attacked
    Conditions
        (Attacking unit) Equal to RetributionTarget
    Actions
        Set IndividualDamage = (Integer((Damage taken)))
        Set DamageInteger = (DamageInteger + IndividualDamage)
        Trigger - Turn on Retribution Damage <gen>

Code:
Retribution Damage
    Events
        Time - RetributionTimer expires
    Conditions
    Actions
        Trigger - Turn off Retribution Charge <gen>
        Unit - Set life of RetributionTarget to ((Life of RetributionTarget) - ((Real(DamageInteger)) x 10.00))
        Floating Text - Create floating text that reads ((String((Real(DamageInteger)))) + !) above RetributionTarget with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Show (Last created floating text) for (All players)
        Wait 3.00 game-time seconds
        Floating Text - Destroy (Last created floating text)
        Trigger - Turn off (This trigger)

But, there's all problem, I see the floating text appear after 15 seconds over the target, but all I see is '0.000!'. Thus, I believe that all the variables are working but the damage accumulation somehow doesn't work...

Can someone please study this trigger and give me a solution....?
 

Tom Jones

N/A
Reaction score
437
You can't use Damage Taken if you aint using a Unit Takes damage event.
Use Unit Damage Target instead of setting the targeted units hp when you damage it.
What you need to do is add this to the second trigger Trigger - Add Trigger Unit takes damage to *sometrigger* and then in *sometrigger* you do the actions from your second trigger.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top