• 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.

Upgrading range?

Status
Not open for further replies.
Level 2
Joined
Jan 22, 2008
Messages
28
I have tried to make a trigger that adds a research level to an upgrade every time you pick up a special item. And another upgrade that decrease the attack range when dropping the item.

Upgrade that increases range:
  • Events - Unit- A unit Acquires an item
  • Conditions - (item-type of(item being manipulated)) Equal to WoodenBow
  • Actions - Player- Set the current research level of RangeIncrease upgrade to (0+1) for owner of ( Triggering unit))
Upgrade that decrease range:

  • Events - Unit- A unit Loses an item
  • Conditions - (item-type of(item being manipulated)) Equal to WoodenBow
  • Actions - Player- Set the current research level of RangeDecrease upgrade to (0+1) for owner of ( Triggering unit))
The thing is that when I first pick it up I get a range increase, and when I drop it I get a decrease, but when I try to pick it up again I don't get any increase, and when I drop It I don't get any decrease. Can someone help??:bored:
 
Level 2
Joined
Jan 22, 2008
Messages
28
Can't get It working :slp: I'm not that good with variables, but I maid one named X, typ: integer, but what size should I use?? 0 or 1 ??
 
Level 2
Joined
Jan 22, 2008
Messages
28
No, can't get it working, why can't you try making one?? I have based both upgrades on the Long Rifles upgrade. I put 600 Increase in the IncreaseRange, and -600 in the decreaser, plz tell me if you need more info or a pic or something.
 
Level 18
Joined
Sep 27, 2005
Messages
2,069
Trigger 1:
time elapsed in game = 1
set a ( variable of integer type ) = 0

Trigger 2:

Events - Unit- A unit Acquires an item
Conditions - (item-type of(item being manipulated)) Equal to WoodenBow
Actions - Player- Set the current research level of RangeIncrease upgrade to (a+1) for owner of ( Triggering unit))

Trigger 2
Events - Unit- A unit Loses an item
Conditions - (item-type of(item being manipulated)) Equal to WoodenBow
Condition x>0
Actions - Player- Set the current research level of RangeIncrease upgrade to (x-1) for owner of ( Triggering unit))

Try it the same as here.
 
Level 2
Joined
Jan 22, 2008
Messages
28
But you can't decrease a upgrade level! I have maid one upgrade that gives -600 range. Does it work or what?? I have tried the thing you wrote but no progress, now when I did as you wrote It increases one time, then when I drop the item it doesen't decrease the range, it is still the same.
 
Level 18
Joined
Sep 27, 2005
Messages
2,069
I don't know does the negative upgrade work. If it does than do like you said on the first place just add two variables:

Trigger 1:
time elapsed in game = 1
set a ( variable of integer type ) = 0
set b ( variable of integer type ) = 0

Trigger 2:

Events - Unit- A unit Acquires an item
Conditions - (item-type of(item being manipulated)) Equal to WoodenBow
Actions - Player- Set the current research level of RangeIncrease upgrade to (a+1) for owner of ( Triggering unit))

Trigger 2
Events - Unit- A unit Loses an item
Conditions - (item-type of(item being manipulated)) Equal to WoodenBow
Actions - Player- Set the current research level of RangeDecrease upgrade to (b+1) for owner of ( Triggering unit))
 
Level 2
Joined
Nov 17, 2008
Messages
35
i have found the posiblility of 4 problems.

1. the unit (hero) doesnt have the upgrade for him.
yea common mistake.

2. the acquisition range could be holding u back

because after looking at the rifleman unit his acquistion range is 600 range is 400 the upgrade gives 200 range.

3. range cant be deducted

also i do believe if u remove a upgrade u lose the bonus so u pro only need 1 variable.

4. try hero manipulating item instead of triggering unit.

if u still have a problem put in some detail what is the problem and ill try to help u.
 
Last edited:
Level 11
Joined
May 31, 2008
Messages
698
this might work

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to <your item>
    • Actions
      • Unit - Order (Last created unit) to research Range (+)
  • Untitled Trigger 001
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to <your item>
    • Actions
      • Unit - Order (Last created unit) to research Range (-)
for the -range upgrade you can set the range to negative (i tried it and you can make the range negative) and make both of these 100 levels with gold/time/range/lumber/etc increments as 0
 
Level 2
Joined
Jan 22, 2008
Messages
28
this might work

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to <your item>
    • Actions
      • Unit - Order (Last created unit) to research Range (+)
  • Untitled Trigger 001
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to <your item>
    • Actions
      • Unit - Order (Last created unit) to research Range (-)
for the -range upgrade you can set the range to negative (i tried it and you can make the range negative) and make both of these 100 levels with gold/time/range/lumber/etc increments as 0


No, don't work try yourself.
 
Level 11
Joined
May 31, 2008
Messages
698
wait did you actually put Unit - Order (Last created unit) to research Range (-)? Because this wont work... I thought it would be obvious enough to change last created unit to the dummy unit where you have these range researches available. You realize that you have to create a dummy unit wit the + and - range researches right? And dont forget to add those researches to upgrades used for all of your heroes.
The only thing about using my method as far as the researches goes is that i am not really sure if it will stack, but i think that might be better because it will be more balanced but idk what your map is.

And guys you cant undo researches!!!! The only way to "undo" them is to create another research of the same type, but with a negative value.
 
Level 2
Joined
Jan 22, 2008
Messages
28
graystuff111, I have tried doing that, but I don't get the result I'm looking for, you see I used your range system, but you could only use one item as a rangebooster, and I want at least 3 items to have range bonus. If you know how to get more items to a system like that it would be great and I could use it IF this thing with upgrade doesn't work, but only IF.
 
Level 11
Joined
May 31, 2008
Messages
698
graystuff111 dont make it too complicated, if you replace units you have to worry about abilities that were already learned, items currently in inventory, and other stuff. I think that researching is the easiest way to go. Correct me if im wrong, but i got the impression that we are dealing with heroes, so replacing heroes can get a little complicated because of exp and such
 
Level 2
Joined
Jan 22, 2008
Messages
28
But I don't want to unresearch, I want to research to a higher level every time a unit picks up a item and when he drops it, and one research gives + in range and the other -. But my problem is that it only researchs one level of + range, when I pick up and only one level - range when I drop an item. I want it to go on researching every time you pick up or drop an item. And I have set the upgrades to have 100 levels each. And I think this thing sounds simple to do but in some way it doesn't work as I want.:con: Can all please try a alike thing, and please post here or PM me if you have found something of a solution to my problem. I will give rep+.:thumbs_up:
 
Level 2
Joined
Nov 17, 2008
Messages
35
sigh u didnt try my idea's they 9/10 would be the problem.

Events - Unit- A unit Loses an item
Conditions - (item-type of(item being manipulated)) Equal to WoodenBow
Actions - Player- Set the current research level of RangeDecrease upgrade to (0+1) for owner of ( Triggering unit))

not owner of triggering unit its hero manipulation item


the unit (hero) doesnt have the upgrade for him. so edit him have a look at upgrades used.
 
Level 12
Joined
Mar 16, 2006
Messages
992
You can't take away upgrades.

Hero range: Highest range amount you want hero to have.
Acquisition range: Actual range you want hero to have.

Use triggers to change the acquisition range upon getting items. The hero's max range will change along with it. Simple as that.
 
Level 2
Joined
Jan 22, 2008
Messages
28
You can't take away upgrades.

Hero range: Highest range amount you want hero to have.
Acquisition range: Actual range you want hero to have.

Use triggers to change the acquisition range upon getting items. The hero's max range will change along with it. Simple as that.

Have you tried it yourself??:con: Cause it don't work, because you can't set attack range only via triggers. :xxd:
 
Level 12
Joined
Mar 16, 2006
Messages
992
Have you tried it yourself??:con: Cause it don't work, because you can't set attack range only via triggers. :xxd:

You can't set attack range through triggers, but you can adjust acquisition range to grant the illusion of a changeable range.

It works quite well.

'if you read my latest post before this you might understand.'
 
Level 12
Joined
Mar 16, 2006
Messages
992
Here's how it works:

You start world editor. THEN, you edit the max range of the heroes to the highest range you want in your map. THEN, you edit the acquisition range of the heroes to the actual range you want. THEN, you create a trigger and variables to store their acquisition range and adjust it accordingly. After that, you test it out and enjoy.

  • You are a lazy mooch.
Because you are.
 
Level 2
Joined
Jan 22, 2008
Messages
28
I'm not lazy i just want answer to my question, if you can't give me a FULL trigger that helps me, then I wont rep you sorry.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Vegavak, that method does not work. Maybe you should try it before telling it to people. Changing the aquisition range via triggers only changes the aquisition range and not the maximum range, even if you set the maximum range to an insane number in the object editor. This is probably to allow it to be used for behaviour of creeps while not affecting their attack range, but unfortunatly it would have been better for it to affect the range.

The actual answer is, there is no real way. Upgrades will always bug as they have a limated number of research levels and can not be unresearched (luckilly starcraft 2 promisis support for that feature but it is not even in beta yet).

There is however a unit object intensive way, where by you create multiple copys of the same unit, each with different attack ranges for your variaous items. Then by triggers, when the unit aquires the item you exchange it for the correct unit type and copy across all the unit statistics. This however may be buggy if not done well and could also result in annoying bugs that would need a lot of triggering to prevent if used on heroes. This is not even counting the fact that it could elevate map loading times drastically if there are many different range incriments and units which can use the item.

WC3 just does not support adjusting unit attack range with triggers so I would recommend dropping that idea.
 
Level 11
Joined
May 31, 2008
Messages
698
This trigger should work, it should continue to do the researches and increase them. Make another trigger but for when hero loses item it researches the negative range research.

  • Range
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Range Item
    • Actions
      • Player - Set the current research level of Range to ((Current research level of Range for (Owner of (Triggering unit))) + 1) for (Owner of (Triggering unit))
Dr Super Good is right, but that really shouldnt be a problem because i dont think that they will pick up or drop the item 100 times. Also you can set the levels of research to more by holding shift while selecting the number of upgrades, but i will warn you not to set it too high because this will pretty much freeze your world editor, so i dont really reccomend doing this for researches unless if you set it to maybe 150 levels.
 
Level 11
Joined
May 31, 2008
Messages
698
well i tried 10000 and it was takin so long to process it i had to close WE :p
But you should be able to go up to 1000 levels without problem, just use auto fill levels function to fill em in. BUT before you do this make sure you save map first just in case if ur comp sucks so much that it cant handle so many levels >.<
By load time do you mean like time to DL the map?
 
Level 11
Joined
May 31, 2008
Messages
698
no. do the way i said. to replace heroes you need lotsa triggers and you gotta make em not leak. its just too complicated. the trigger i have should work fine as long as the hero doesnt pick up/drop the item 100 times, which is VERY unlikely.
 
Level 2
Joined
Jan 22, 2008
Messages
28
This trigger should work, it should continue to do the researches and increase them. Make another trigger but for when hero loses item it researches the negative range research.

  • Range
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Range Item
    • Actions
      • Player - Set the current research level of Range to ((Current research level of Range for (Owner of (Triggering unit))) + 1) for (Owner of (Triggering unit))
Dr Super Good is right, but that really shouldnt be a problem because i dont think that they will pick up or drop the item 100 times. Also you can set the levels of research to more by holding shift while selecting the number of upgrades, but i will warn you not to set it too high because this will pretty much freeze your world editor, so i dont really reccomend doing this for researches unless if you set it to maybe 150 levels.

Wolfman, how to add that +1 in your trigger, can't find where :/
 
Level 12
Joined
Mar 16, 2006
Messages
992
When you lower the acquisition range, the range reflected by hovering over the unit is equal to the acquisition range. I did not see any problems when I used my method in my map, but I'll test it again later to be sure.

You can find the ____ + ____ by using 'arithmetic'.
 
Level 2
Joined
Jan 22, 2008
Messages
28
WORKS GREAT!! Thank you all who have helped me!! :grin: REP to: Wolfman, Vegavak and Dr super Good!!! If you want rep for something you wrote in this tread, then PM me!, if I see that your post lead me to the anwer, then I will also rep you! :thumbs_up: HAVE A NICE DAY ALL :grin:
 
Status
Not open for further replies.
Top