wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 01-21-2010, 01:19 PM   #1
Neversleeping
User
 
Neversleeping's Avatar
 
Join Date: Mar 2008
Posts: 258

Neversleeping has little to show at this moment (9)

Default Picking powerups from air?

A hero has got an owl-form spell and can fly about. The problem is, he can fly around and pick up gold-powerups while being airborne. This is unintentional, so is there a way to restrict this?
Neversleeping is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 01-21-2010, 01:24 PM   #2
Themerion
Brahms-fan
 
Themerion's Avatar
 
Join Date: Jan 2006
Posts: 642

Submissions (2)

Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)

Default

Simple way:

Make sure the owl ain't a hero (for instance you could use Pandaren Brewmaster's ultimate).

Tricky way:

Detect the "smart" order (all right-clicks are "smart"-orders) for the owl unit-type, and interrupt it if it targets a coin.
__________________
Submissions::
(v)JASS Tutorial
Covers how to make fast and safe coding for common tasks in vJASS/JASS.
Creep Respawn System
It has never been easier to respawn creep groups...
Themerion is offline   Reply With Quote
Old 01-21-2010, 01:41 PM   #3
Neversleeping
User
 
Neversleeping's Avatar
 
Join Date: Mar 2008
Posts: 258

Neversleeping has little to show at this moment (9)

Default

Thanks!

The simple solution sounds elegant, but how do I make sure the owl isn't a hero? The owl unit does not have attributes-per-level and such in the field values, so must therefore be a normal unit already as far as I can see.

Must I base the owl form on a particular ability as you said, for example Pandaren ultimate?

Last edited by Neversleeping : 01-21-2010 at 01:41 PM.
Neversleeping is offline   Reply With Quote
Old 01-21-2010, 01:52 PM   #4
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

The owl form must not have an inventory (or at least a hero inventory) if you don't want it to pick up items. Best way to preserve the original hero's invenotry is to use StormEarthAndFire to summon the inventory-less owl.
__________________
Anitarf is offline   Reply With Quote
Old 01-21-2010, 02:07 PM   #5
Neversleeping
User
 
Neversleeping's Avatar
 
Join Date: Mar 2008
Posts: 258

Neversleeping has little to show at this moment (9)

Default

I see. But the Storm, Earth and Fire does not have morphing flags and Altitude Adjustment Duration and things like that that I think is handy when dealing with flying morphs. Besides I went through a lot of hassle making it work properly, so I'm tempted trying Themerion 2nd proposal and trigger it, but I can't seem to find a reference to these smart actions using the GUI...
Neversleeping is offline   Reply With Quote
Old 01-21-2010, 06:05 PM   #6
Fluff
or your money back!
 
Fluff's Avatar
 
Join Date: Aug 2004
Posts: 541

Submissions (1)

Fluff will become famous soon enough (64)Fluff will become famous soon enough (64)Fluff will become famous soon enough (64)

Default

You could, I suppose, just have a trigger that fires when a hero picks up an item, and then if the hero = the flying owl you can just have an Action to drop the picked up item. That way if you right click an item it will go to that spot and just not be able to put it in its inventory.

You might have a problem if another hero drops an item into your inventory.... not sure.
Fluff is offline   Reply With Quote
Old 01-22-2010, 09:50 AM   #7
Neversleeping
User
 
Neversleeping's Avatar
 
Join Date: Mar 2008
Posts: 258

Neversleeping has little to show at this moment (9)

Default

but, the gold-powerup is instant effect, it doesn't actually go into his inventory...
Neversleeping is offline   Reply With Quote
Old 01-22-2010, 10:20 AM   #8
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by Neversleeping
I see. But the Storm, Earth and Fire does not have morphing flags and Altitude Adjustment Duration and things like that that I think is handy when dealing with flying morphs.
Use the same model for the spell projectile as you use for the summoned unit and you should get a similar effect.
__________________
Anitarf is offline   Reply With Quote
Old 01-22-2010, 11:10 AM   #9
Neversleeping
User
 
Neversleeping's Avatar
 
Join Date: Mar 2008
Posts: 258

Neversleeping has little to show at this moment (9)

Default

Thanks a lot, perhaps for a later patch.

I went for this solution for now:

Trigger:
owlformgoldrestrict
Collapse Events
Unit - A unit Acquires an item
Collapse Conditions
(Item-type of (Item being manipulated)) Equal to Gold Coins
((Triggering unit) is A flying unit) Equal to True
Collapse Actions
Player - Add -250 to (Owner of (Triggering unit)) Current gold
Item - Create Gold Coins at (Position of (Triggering unit))

The gold coin will then be placed back, and no net change will occur with the players gold value.
Neversleeping is offline   Reply With Quote
Old 01-22-2010, 11:19 AM   #10
Anachron
User
 
Anachron's Avatar
 
Join Date: Mar 2009
Posts: 1,079

Anachron will become famous soon enough (51)Anachron will become famous soon enough (51)

Default

Thats kinda bad.

I would rather check its order target as to replace the item everytime.

Collapse JASS:
local unit u = GetTriggerUnit()

if GetOrderTargetItem() != null and IsUnitType(u, UNIT_TYPE_FLYING) then
    call IssueImmediateOrder(u, "stop")
endif
__________________
CustomInventory [Discussion - Download] - Got Directors Cut!
CustomMissle [Discussion - [Download (not yet)] - In development!
Other systems [Spawn System] [Move System] [CustomBar] [SpellBar]

Last edited by Anachron : 01-22-2010 at 11:19 AM.
Anachron is offline   Reply With Quote
Old 01-22-2010, 04:24 PM   #11
Neversleeping
User
 
Neversleeping's Avatar
 
Join Date: Mar 2008
Posts: 258

Neversleeping has little to show at this moment (9)

Default

That would be much better. I use the GUI though, so I'll see if I can get a similar thing working!
Neversleeping is offline   Reply With Quote
Old 01-22-2010, 07:08 PM   #12
Themerion
Brahms-fan
 
Themerion's Avatar
 
Join Date: Jan 2006
Posts: 642

Submissions (2)

Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)Themerion has a spectacular aura about (114)

Default

In case you need a middle ground :P

Trigger:
Collapse Events
A unit is issued an order targeting an object
Collapse Actions
Custom Script: local unit u = GetTriggerUnit()
Custom Script: if GetOrderTargetItem() != null and IsUnitType(u, UNIT_TYPE_FLYING) then
Custom Script: call IssueImmediateOrder(u, "stop")
Custom Script: endif
Custom Script: set u = null
__________________
Submissions::
(v)JASS Tutorial
Covers how to make fast and safe coding for common tasks in vJASS/JASS.
Creep Respawn System
It has never been easier to respawn creep groups...
Themerion is offline   Reply With Quote
Old 01-25-2010, 06:47 AM   #13
Neversleeping
User
 
Neversleeping's Avatar
 
Join Date: Mar 2008
Posts: 258

Neversleeping has little to show at this moment (9)

Default

Thanks, that's wonderful.
Neversleeping is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 03:50 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services