sc2c.org

Go Back   Sc2C.org > Developer's Corner > Scripting
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 08-28-2010, 02:17 AM   #1
Adovid
Data Editor ZOMG
 
Adovid's Avatar
 
Join Date: Aug 2010
Posts: 41
Default Dropping and Stealing Items

I have yet to find a way to do this in GUI or in the Data Editor so I am hoping someone with some Galaxy experience might know a work around.

Basically this is a nasty little loop hole that blizzard seems to have missed.

Most of the functionality for inventory and items are missing in triggers because this can mostly be handled by issuing orders through effects and validators. But dropping an item requires more than just one command, it requires targeting an item and dragging it to a point with all commands from the same unit-- even effects can only issue one order at a time with one source and one target, even though you can access an ability command index.

I guess what the real question is, is it possible to issue a compound order in galaxy such that a unit targets an item and then targets a point all without breaking the continuity of item selected to the item dropped or moved between heros.

If you try to instant move a unit using GUI the unit will not move from the inventory. Also, trying to kill an item with any persistence after death so you can revive them will prevent the unit from dieing in inventory until the countdown for their persistence ends.

Just a way to get the persistent item out of the persistent inventory seems impossible.
Adovid is offline   Reply With Quote
Old 08-28-2010, 01:39 PM   #2
Zerzax
Zerzy
 
Zerzax's Avatar
 
Join Date: Aug 2010
Location: U.S.
Posts: 11
Send a message via AIM to Zerzax
Default

Have you tried using a small wait time (.01 seconds maybe?) between orders?
Zerzax is offline   Reply With Quote
Old 08-28-2010, 06:11 PM   #3
Adovid
Data Editor ZOMG
 
Adovid's Avatar
 
Join Date: Aug 2010
Posts: 41
Default

What would the second order be? "Smart command"?
Adovid is offline   Reply With Quote
Old 08-30-2010, 06:37 PM   #4
Zerzax
Zerzy
 
Zerzax's Avatar
 
Join Date: Aug 2010
Location: U.S.
Posts: 11
Send a message via AIM to Zerzax
Default

I haven't checked what the order is, but you could get a trigger to print the current order of the unit as a debug message. The trigger would be registered to any time a unit manipulates an item (at least you could do that in wc3, I need to check out what sc2 has to offer).
Zerzax is offline   Reply With Quote
Old 08-30-2010, 08:43 PM   #5
Adovid
Data Editor ZOMG
 
Adovid's Avatar
 
Join Date: Aug 2010
Posts: 41
Default

Yeah, I did that in wc3 too but it seems less intuitive in sc2.
Adovid is offline   Reply With Quote
Old 08-31-2010, 02:39 AM   #6
Zerzax
Zerzy
 
Zerzax's Avatar
 
Join Date: Aug 2010
Location: U.S.
Posts: 11
Send a message via AIM to Zerzax
Default

I found the function.

EventUnitOrder()

Use it as a custom script argument, event unit being the triggering unit. Now that doesn't tell you specifically what the order is. But you can store it on init and use it now perhaps. I'm not sure if it works.
Zerzax is offline   Reply With Quote
Old 08-31-2010, 08:36 PM   #7
Adovid
Data Editor ZOMG
 
Adovid's Avatar
 
Join Date: Aug 2010
Posts: 41
Default

Someone on sc2mapster figured it out.

native void OrderSetTargetItem(order p1, unit p2);
http://github.com/Zoxc/legion/blob/m...Natives.galaxy

Just pass it the order as a variable and it will change the order to use the item >.<.

So you have to create an order as a variable, it's not just a handle to a function like it used to be(if I recall).

This wasn't documented or available through GUI but I suspect that the inventory ability command "target item" in the data editor has something to do with this, just wish there was a way to reference an inventory slot via data.
Adovid is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Forum Jump


All times are GMT. The time now is 10:19 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.