Dynamically Set the Range of a Hero

  • Thread starter Thread starter Chindril
  • Start date Start date
C

Chindril

Guest
Hello, I am currently building an item that will modify the hero's attribute. Usualy it doesn't cause much problems, like adding damage or something. But now I want to SET the range of the hero to 800 (for exemple). I searched a lot to see how I could change it for Combat Attack 1 (it would be very easy to use), but I haven't seen a prebuild item, ability or effect that allow it. Plus, the trigger doesn't allow to change the range (acquisition range yes but not the range... weird). Anyway, right now I've come up with this :

I set Combat Attack 2 range for my hero to 800, and the same damage and stuff like the Attack 1. I give the hero the Upgrades Attack 1 and Attack 2 (which I made). Those 2 upgrades have the effect : "Enabled Attack" and "Attack 1 Only" or " Attack 2 Only".

I then use a trigger so when he takes the item it put the research level of attack 2 to the level 1 and vice versa. I hope that I'm clear. Well, it works very well, everything is good... BUT it works only 3 times. I mean... I can take the item, drop it and take it again, it works well. But if I drop it a second time my attack 1 doesn't come back and I am stuck with the attack 2.

Sorry for the long description, I wanted to put as much details as possible. Also, I am very well aware my method is a pretty complicated one but I haven't seen anything better yet. If anyone knows how to set the range for Attack Type 1 dynamically, then I'ld be glad to learn it.

Also I read about the Barrage Ability... Doesn't work. If I understood well it would target like the closest unit from me or something. I also tried it without success.

Thanks everyone for your help.

- Chindril
 
Are you sure you did what you said? I did exactly what you described, and used a Headhunter as the unit, and it worked multiple times of picking up the item.
 
can you tell me what YOU did exactly ?

I have 2 upgrades , Attack 1, Attack 2... the effects mentionned in my first post.

Here are my 2 triggers

Event
Unit Acquires an Item

Action (No condition because I have lots of items to trigger)
If
Item-Type of item being manipulated Equals to Bow
Then Actions
Player - Set the current research level of Attack 2 to 1 (Owner of(Hero Manipulating Item))
Player - Set the current research level of Attack 1 to 0 (Owner of(Hero Manipulating Item))
Else
Do Nothing


The second Trigger, which drops an item is the opposite, Attack 2 becomes 0 and Attack 1 becomes 1.

I also gave my hero both Upgrades in "Techtree - Upgrades Used".

- Chindril
 
I see why it's not working for you now. EVERY time they pick up the item, no matter what the research level of the upgrades is, they'll set them to a certain level. Add another trigger that will revert the upgrades back to their beginning research levels.

Code:
Set tech level
    Events
        Unit - A unit Loses an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Item-type of (Item being manipulated)) Equal to Bows
            Then - Actions
                Player - Set the current research level of Attack 1 to 0 for (Owner of (Hero manipulating item))
                Player - Set the current research level of Attack 2 to 1 for (Owner of (Hero manipulating item))
            Else - Actions
 
hum, you did not understood... I do have 2 triggers that revert back the researches.

Chindril said:
The second Trigger, which drops an item is the opposite, Attack 2 becomes 0 and Attack 1 becomes 1.

In other word :

Event
Unit Loses an Item

Action
If
Item-Type of item being manipulated Equals to Bows
Then Actions
Player - Set the current research level of Attack 1 to 1 (Owner of(Hero Manipulating Item))
Player - Set the current research level of Attack 2 to 0 (Owner of(Hero Manipulating Item))
Else
Do Nothing



Attack 1 = Melee
Attack 2 = Ranged


So when he takes the item, Attack 1 = 0 level and Attack 2 = 1 level
when he drops it (comes back melee) Attack 1 = 1 level and Attack 2 = 0 level
 
That's your problem. THey both need to be ranged. Make both attack types th same exact thing except for a range increase. Besides that, I don't see any other problems.
 
-=EDIT=-

It's okay I found another way to do my thing. It doesn't really increase the range but it still works for what I wanted to do. I give an ability to the item and I say, when the hero target an enemy, he uses the ability of the item (the bow). Not exactly the same but it works for what I want to do now.

Thanks Connan

-=END EDIT=-


Why would they need to be both ranged ? The upgrades CHANGES from Attack 1 to Attack 2 so they could be very different...

Also can I have the map with your troll so I can see what you did exactly ? I feel the mistake is somewhere else cause I tried the same thing with the troll and it still works only once, like with the hero... (plus the range wasn't even good... :confused: )

What did you base your 2 upgrades on ? (Dunno if it does a difference like abilities or something)

- Chindril
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.
  • Ghan Ghan:
    That sounds like an adventure.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top