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

Kindof a strange question.

Status
Not open for further replies.
Level 4
Joined
Jul 25, 2007
Messages
71
Thanks so much for your help on my last thread. Hopefully you can help me out with this one too..

A unit has an item called "Empty Flask" which can be actively used. When it is clicked, the user has an AoE selector similar to the Blizzard spell. If the user selects the ocean shoreline, (providing the area is shallow enough for the unit to stand (Since the ability range is 50)), I want the flask to fill with "Ocean water". When the user selects a water well, or trough on land (any doodad displaying fresh water), I want the flask to fill with "Fresh Water". And the last thing I want, is if the user selects the corpse of a recently slain beast, I want the flask to fill with blood of that beast. I understand I'll need to make seperate items for each monster's blood.

The problem I'm having is finding a Condition that checks if the unit selects the ocean. Or selects the corpse of a (unit type) monster. Or selects a specific doodad.

Any ideas??
 
Level 6
Joined
May 27, 2007
Messages
162
It is quite a tricky thing you want to do. But it is possible.

First thing I would suggest you change, is instead of the Empty Flask active ability using an AoE target. Make it a point-target.

This will allow you to use GUI like this: 'target point of ability being cast...'

I am not sure whether an item's active ability counts as an ability, or whether you will have to use the GUI 'a hero uses an item'.

1) Ocean Water (Pseudocode)
I think you are going to require a dummy unit. With Placement Requires - then the thing which say's 'This building must be built on water'... Or something along those lines... Then, make the unit have no collision radius, no model & give it Invulnerability as well as Locust abilities for good measure.


Events
Hero uses an item

Conditions
Item being manipulated is an Empty Flask
Target unit of item being used?? is equal to no unit.

Actions
Set TempUnit = Hero Manipulating Item
Set TempPlayer = (Owner of(TempUnit)
Set TempPos = (Position of (TempUnit)
Create 1 Dummy Unit for TempPlayer at TempPos.
add a 0.2 second generic expiration timer to last created unit
Add Last Created Unit to TempUnitGroup
If boolean is true (TempUnitGroup contains atleast 1 DummyUnit)
Then
replace item being manipulated with Oceanic Flask.


2) Fresh water - pseudocode.
This one is nice and easy. You just have to create units for each doodad you are planning on using. Then give that unit the model for the doodad you want. Because, doodads cannot be targetted...


Events
Hero uses item

Condition
Item is equal to Empty Flask
target of item being used?? is equal to (Well OR Trough OR Icicle OR Fountain OR any other unit you made)

Actions
Replace Item being manipulated with a Fresh Water Flask.


Please keep in mind, I am an amateur GUI trigger maker... at best... So these definitely leak, and there is no guarantee that they will work :)

You might need to create a dummy unit with an ability called 'Flask Filling', and change the 'Empty Flask' so that it's active ability doesnt require a target.

Then, whenever the unit uses his empty flask, this dummy unit with the 'Flask Filling' ability is created, and then the detection goes on. Ie, is the dummy unit ankle-deep in salty water? then replace the Empty Flask with an Ocean Flask... Or, another trigger, unit is attacked, attacking unit = dummy unit, attacked unit = well, or fountain etc... then replace empty flask with fresh water flask...

I have an idea for the Blood of beasts, but it involves using Unit's custom values, and then setting up an array to store Units and their Blood Type. So, a unit dies... create 1 UnitArray[CustomValue of Dying Unit] at position of dying unit... add expiriation timer to last created unit...

Then, if a unit is attacked... attacking unit = dummy unit and attacked unit type = ward (or anyything to distinguish these dummy corpses)...replace flask with ItemArray[CustomValue of Attacked unit]

Here's an example of the Arrays...

UnitArray[1] = GreenSpider (unit)
DummyArray[1] = Green spider Corpse (dummy unit)
BloodArray[1] = Green Spider Blood filled Flask (item)

The Green Spider has a custom Value of 1. The Dummy corpse has a custom value of 1. And the Item has a custom value of 1 (although I don't think that is necessary).;..

So basically, when the unit dies, it's corresponding dummy corpse is created where it died. This dummy corpse unit has no model file and expires after x seconds (same as corpses decaying) or when it is filled into a flask. When it is attacked by the dummy unit that is created when a player uses his empty flask... then, the empty flask is replaced with the item held in the array at the index of the custom value of the dummy corpse:)

Hope this helps and makes sense :) I don't have World Edit available to me right now, but I'll test some of these methods out and see if theyw ork or not :)
 
Last edited:
Level 4
Joined
Jul 25, 2007
Messages
71
Thank you so much Cardinian. I'm about to test your methods right now. You've got quite the imagination. Your ideas are perfectly logical. Thank you very very much.
 
Level 6
Joined
May 27, 2007
Messages
162
Good luck. Let me know how you get on. I'm going to be back home tonight sometime (GMT, so in 8 hours or so), I'll try out some other methods.

I think as a unit dies, if you add it's corpse to a special group and then add all the corpses in that group to the event of another trigger ie. Corpse is harvested... should be easier than creating, storing and assigning a unit, a corpse and an item to each unit which has blood :)...

Good luck once more :)
 
Level 4
Joined
Jul 25, 2007
Messages
71
I haven't tried the corpse one yet, but the ocean water doesn't work fully. The dummy unit is only pathable on "floatable" terrain. It is a building, and cannot be placed on land. In the World Editor, I can't place it anywhere but in the water... But in game, the game still creates it on land if it's not near water. But I still did it another way..

I found a GUI condition "Environment - Selected point (Area of hero manuipulating item) is floatable" = true
 
Level 6
Joined
May 27, 2007
Messages
162
Thought there might be an environment condition... But, now I'm back on my home PC so I can check it out and see if the corpse way will work - or if there is an easier way to go about it! :)
 
Status
Not open for further replies.
Top