HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Issue order via variables

02-26-2004, 04:41 AM#1
DoctorDoom
I'm using WEU(newest). I need a method for saving an order to a variable and then issue that order(ability) with the variable. For some reason it doesn't seem to work for me. I tried most of the combinations using the Order(ordercode) variable, and then tried saving the order as a string and none work. Can someone create the trigger that has any event, then sets a variable to any ability then order a unit to (variable recal) on another unit. Example, firebolt an enemy peon.

Really appreciate it.
02-26-2004, 09:59 AM#2
sgtteflon
I dont use WEU, so Im not sure if theres anything special there, but it seems to me saving the orderstring as a string would work fine. I will try to set that up in the editor and paste it for you.

EDIT: nm it doesnt even give you the option to use a variable for issueing orders. guess you do need a modified editor.
02-26-2004, 04:30 PM#3
DoctorDoom
yeah thats why I used WEU, I had UMSWE but everyone kept telling me not to use the program instead of trying to be helpful. So I switched. Anyone else want to take a stab at this?
02-26-2004, 05:09 PM#4
Cubasis
Hmm

Triggering Ability's come in AbilityID form I think (I haven't tested it for sure, but it's more likely). So you need to make a Order using AbilityID

Not sure if WeU has it, but UMSWE has it for sure.

So, get the Triggering AbilityID and store it in a integer variable, then cast it by using OrderID. That should hopefully work.

Cubasis
02-26-2004, 05:33 PM#5
DoctorDoom
Did you mean store it as a String variable? I also have the variable Ability(abilcode). I'll see what I can do and write back momentarily.
02-26-2004, 05:52 PM#6
Cubasis
No... Integer variable

AbilityID = Integer
Order = String

these AbilityID's are in the format 'A###' or sumtin. And while they look like strings, they are in fact decoded 32-bit Integer values and are stored like that.

Cubasis
02-26-2004, 06:15 PM#7
DoctorDoom
There is no way of retrieving AbilityID that I could see in either WUE or UMSWE. The closest I can get is ability name, which is a string. Now I swear I made a simple command once and ordered a unit to cast web using:

Unit - Order Unit_Hero to (Name of Web (Neutral Hostile)) Peon 0013 <gen>
And yes I know that my Unit_Hero variable is working. But now that exact trigger won't work. This is just getting me upset.

Can someone create an actual trigger(preferable in a map) that issues a unit(saved as a variable) to use an ability(given to that unit via trigger, with this ability somehow called from a variable) against an enemy unit(saved as a variable). I ask for it in a map because that way you know it works and then I'll see what the heck is going on on my end. Thanks a whole lot for any kind soul willing to do this for me.
02-26-2004, 07:13 PM#8
volatile
JASS JASS JASS.
02-26-2004, 07:35 PM#9
Cubasis
Ah

GUI has a special Type called Ability, which is the AbilityID i spoke of earlyer (so it's just another name for Integer), but the "Ability being Cast" is there.

Just put it in a Ability variable instead.

Cubasis
02-26-2004, 08:04 PM#10
DoctorDoom
Quote:
Originally posted by volatile
JASS JASS JASS.


Yeah apreciate the help volatile.

Anyway, I used the ability variable, but there is no way to access it directly. Please I appreciate the help but I've tried everything stated. Can someone please try and fufill my request of the previous post and create a small map that actually works. I would never ask this of anyone accept that I can't figure out whats wrong. Everything I tried should have worked. Thanks alot to whoever at least tries the map.
02-26-2004, 08:40 PM#11
Newhydra
Doesn't work...
Code:
Untitled Trigger 001
    Events
        Unit - Knight 0000 <gen> Is issued an order targeting a point
    Conditions
    Actions
        Game - Display to (All players) the text: n    
        Custom script:   set udg_someString = OrderId2String( GetIssuedOrderId() )
        Custom script:   call IssuePointOrderLocBJ( gg_unit_hspt_0001, udg_someString, GetRectCenter(GetPlayableMapRect()) )
Looks like you can't do what you want.
(it displays 'n' but it never issues the order)
02-27-2004, 12:04 AM#12
Cubasis
Eh, guys.

Newhydra:

The OrderID2String takes a integer value like this: 'A006', and converts it to this string: "A006" ....

This is obviously only to be able to store them in string variables and completely useless otherwise.

There are 2 types of order functions.

Order with OrderStrings, and order with OrderID (OrderID == AbilityID).

OrderStrings orders take Strings (logically), but they take the orderstring specified in the object editor (like "firebolt" and stuff). So that's why it ofcourse doesn't work to give it a string like "A006", as that's a converted AbilityID

OrderID orders take integers. And note that GUI Ability variables is the same thing as Integers. These are the things you get from "GetIssuedOrderId()".

However, IssueOrderUsingOrderID is not available in normal GUI and is only available if you use JASS or UMSWE/WEU.

Hope you finally understand this now.

Cubasis
02-27-2004, 12:43 AM#13
Newhydra
Cubasis...
Code:
Untitled Trigger 001
    Events
        Unit - Knight 0000 <gen> Is issued an order targeting a point
    Conditions
    Actions
        Game - Display to (All players) the text: n    
        Custom script:   set udg_someInt = GetIssuedOrderId()
        Custom script:   call IssuePointOrderByIdLoc( gg_unit_hspt_0001, udg_someInt, GetRectCenter(GetPlayableMapRect()) )

does not work either.


And you don't know what you're talking about.

OrderID2String takes an integer and returns the string name of the order. Don't believe me? Try this trigger:

Code:
Untitled Trigger 001
    Events
        Unit - Knight 0000 <gen> Is issued an order targeting a point
    Conditions
    Actions
        Game - Display to (All players) the text: gggg
        Custom script:   call DisplayTextToForce( GetPlayersAll(), OrderId2String( GetIssuedOrderId() ) )

When you order the knight to move using a right-click it will print smart. (actually gggg then smart but...)
02-27-2004, 11:44 AM#14
Cubasis
Ahm,

I'm sorry, i guess i confused it with that other function :/. However, about this function then... I've heard that it is buggy, as it can not give you orderstrings for many OrderID's.

However, If this still does not work, i have no idea what the problem is, and am interested in testing this myself.

Again, i'm sorry about my confusion, and thanks for correcting me.

Cubasis
02-27-2004, 02:01 PM#15
Vexorian
OrderId2String, doesn't work for some spells cause, they Don't have orderstrings, and there are way a lot of spells that don't have orderstrings.

You should use I2S() instead of OrderId2String