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 > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 11-08-2009, 02:37 AM   #61
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Updated the script to fix a null struct destruction bug. Thanks to Sinnergy for both the report and the testmap to help me correct it.
__________________
Rising_Dusk is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 11-08-2009, 08:58 AM   #62
Iron_Doors
User
 
Join Date: Aug 2007
Posts: 50

Submissions (1)

Iron_Doors will become famous soon enough (31)Iron_Doors will become famous soon enough (31)

Default

Quote:
Originally Posted by Rising_Dusk
Collapse JASS:
...
    private constant integer MAX_ORDERS           = 8192 //The max number of orders
                                                         //the system can maintain.
                                                         //Going over 8192 uses big
                                                         //arrays, which are slower
                                                         //than normal arrays.
...
Correction to that: going over 8191 uses big arrays. Your 'u' field for example is currently processed into:
Collapse JASS:
function sg__order_get_u takes integer i returns unit
    if(i<8191) then
        return s__order_u[i]
    else
        return s__order_2u[i-8191]
    endif
endfunction



Quote:
Originally Posted by Rising_Dusk
I am fairly certain that all of the systems in the database that interact with orders will break the queued orders. It is an implied flaw because Blizzard made it impossible to fix. I don't think all of them having some scary warning for something that can't be fixed will help anyone.
In certain types of maps I'd rate flawless queued orders a more important feature than the enhancements to the user interface you can do with LastOrder. I'm just saying this because I really feel this issue should be mentioned in the first post, and can't see any reason not to.
Iron_Doors is offline   Reply With Quote
Old 11-08-2009, 10:30 AM   #63
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by Iron_Doors
Correction to that: going over 8191 uses big arrays. Your 'u' field for example is currently processed into:
Lame, you're right.
Quote:
Originally Posted by Iron_Doors
In certain types of maps I'd rate flawless queued orders a more important feature than the enhancements to the user interface you can do with LastOrder. I'm just saying this because I really feel this issue should be mentioned in the first post, and can't see any reason not to.
It is like mentioning in a buff system that the buffs don't flash. It is an unfortunate, but impossible to adjust for, issue with the nature of triggering it. It is obvious that the conflict is there.

Really, I just don't want to plaster a big, ugly "WARNING" all over the front post that'll scare more people away from the library than it'll inform. Face it, most potential users of this script already know about order queue issues.
__________________
Rising_Dusk is offline   Reply With Quote
Old 11-10-2009, 06:38 PM   #64
Cetacean
User
 
Cetacean's Avatar
 
Join Date: Nov 2009
Posts: 4

Cetacean has little to show at this moment (0)

Default

Hi, I've been working with this library for the past couple of days and have a few questions and observations.

1. Is there a way to look at the finished state of orders beyond the most recent one? I tried the following function, but unlike IsLastOrderFinished, which usually works with few exceptions, this returns false almost every time. I've tried other methods as well, and as far as I can tell, .fin handles don't give accurate returns for orders deeper than one.

Collapse JASS:
function IsPastOrderFinished takes unit u, integer whichOrder returns boolean
    return order(LoadInteger(ht, GetHandleId(u), whichOrder)).fin
endfunction

2. Defend, Undefend, and Unimmolation orders don't register as finished under any circumstances. This is because these particular spells aren't really seen by the game as spells, but rather as orders; hence, they are detected by event_player_unit_issued_order and not event_player_unit_spell_effect as would be more intuitive. Currently, your Actions function isn't set up to flag these pseudo-spells, instead waiting for GetUnitCurrentOrder(u) to evaluate as zero before they show up complete. Bearing in mind I've only been looking at JASS code for the lesser part of a week, I think this is a pretty fine jury rig

Collapse JASS:
//Flags Pseudo-Spell Orders
private function OrderActions takes unit u returns nothing
    local order o = GetPastOrder(u, 1)
    set o.fin = true    
endfunction

//Part of private function "Actions"
elseif GetTriggerEventId() == EVENT_PLAYER_UNIT_ISSUED_ORDER then
    call order.create(u, oid, ORDER_TYPE_IMMEDIATE, null, GetUnitX(u), GetUnitY(u))
    //Catches Defend, Undefend, and Unimmolation
    //user can add in any other order ids which behave similarly
    if oid == 852055 or oid == 852056 or oid == 852178 then
        call OrderActions(u)
    endif

Last edited by Cetacean : 11-10-2009 at 06:44 PM.
Cetacean is offline   Reply With Quote
Old 11-10-2009, 07:12 PM   #65
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by Cetacean
1. Is there a way to look at the finished state of orders beyond the most recent one? I tried the following function, but unlike IsLastOrderFinished, which usually works with few exceptions, this returns false almost every time. I've tried other methods as well, and as far as I can tell, .fin handles don't give accurate returns for orders deeper than one.
I didn't include IsPastOrderFinished because I can find no use for it. When would you care if the 3rd last order was finished or not except when reissuing it? (Which it does internally) If you have a good reason or case where it's useful, I will add it.
Quote:
Originally Posted by Cetacean
2. Defend, Undefend, and Unimmolation orders don't register as finished under any circumstances. This is because these particular spells aren't really seen by the game as spells, but rather as orders; hence, they are detected by event_player_unit_issued_order and not event_player_unit_spell_effect as would be more intuitive. Currently, your Actions function isn't set up to flag these pseudo-spells, instead waiting for GetUnitCurrentOrder(u) to evaluate as zero before they show up complete.
Your interpretation of "finished" is not the same as mine. You see, an order completing means that the given order was 'completed' in the sense of the spell being successfully cast. I don't think the defend/magicdefend/immolation abilities really count as ever finishing because they just turn something on or off. The system can catch any of the orders, their turn ons and turn offs, so why would you want to know that they are finished? Just check the past order id versus the defend/undefend/etc order ids.
Collapse JASS:
if GetPastOrderId(MyUnit) == 852055 then 
    //Defend order is "finished"
endif

A defend order being given doesn't imply the order finished, because an order being issued is not what defines it completing. This is why I only do SPELL_EFFECT for finishing orders, because it's really only useful for target point/unit spellcasts and reissuing those previous orders (all of which fire SPELL_EFFECT).

I'm not sure that made sense, but it's a tough concept to explain.
__________________

Last edited by Rising_Dusk : 11-10-2009 at 07:14 PM.
Rising_Dusk is offline   Reply With Quote
Old 02-22-2010, 03:40 PM   #66
Deaod
User
 
Join Date: Jan 2007
Posts: 542

Submissions (11)

Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)Deaod is a jewel in the rough (192)

Default

Can you let LastOrder handle issuing a non-existing earlier order gracefully? Or provide a way to test if that order was issued?
__________________

Last edited by Deaod : 02-22-2010 at 03:41 PM.
Deaod is offline   Reply With Quote
Old 04-30-2010, 09:46 AM   #67
BlackRose
User
 
Join Date: Apr 2009
Posts: 38

BlackRose is on a distinguished road (13)

Default

Uhm. This has annoyed me so much trying to figure out what was wrong with what I was trying to do, getting a unit's last order. But it turns out it's maybe the system's error. If not, oops :)

But this function:

Collapse JASS:
function GetPastOrderString takes unit u, integer whichOrder returns string
    //! runtextmacro LastOrderDebug("whichOrder", "\"\"")
    return OrderId2String(order(LoadInteger(ht, GetHandleId(u), 1)).id)
endfunction

Shouldn't it be order( LoadInteger( ht, GetHandleId( u ), whichorder ) (The 1 shouldn't be there)

Since all it is returning the last order, not whatever you specified :O

Last edited by BlackRose : 04-30-2010 at 09:47 AM.
BlackRose is offline   Reply With Quote
Old 05-06-2010, 10:24 PM   #68
Weep
User
 
Join Date: Aug 2009
Posts: 8

Weep has little to show at this moment (9)

Default

I think BlackRose is right.
Weep is offline   Reply With Quote
Old 05-29-2010, 11:44 PM   #69
Here-b-Trollz
Corkscrew Chainsaw!!!
 
Join Date: Jun 2006
Posts: 711

Here-b-Trollz has a spectacular aura about (149)

Hero Contest #2 - 2nd Place

Default

Expand Suggested Addition; Yes, I had need of this:



EDIT: Also (random thought), when you are storing the orders, you shift the entire list every time a new order is given; have you considered simply changing the index from which to begin your search?

Code:
- Current Method -
 O1: A      O1: B
 O2: B  ->  O2: C
 O3: C      O3: D

Order of iteration [ 1->2->3; 1->2->3 ]


-    Consider    -
 O1: A      O1: D
 O2: B  ->  O2: B
 O3: C      O3: C

Order of iteration [ 1->2->3; 2->3->1 ]

Just a thought I had while looking over this thing.
__________________
By reading this signature, you agree that I cannot be held accountable for anything that I might say or do.

Last edited by Here-b-Trollz : 05-30-2010 at 01:56 AM. Reason: JASS -> HIDDENJASS
Here-b-Trollz is offline   Reply With Quote
Old 05-30-2010, 09:13 PM   #70
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by Black Rose
Since all it is returning the last order, not whatever you specified :O
Yes, you are absolutely correct. Thank you for that report, I will update this.
Quote:
Originally Posted by Here-b-Trollz
Just a thought I had while looking over this thing.
Yeah, you could do that, and it's something I'd considered when making it. I think that the way I did it makes the most sense for me, though, and really simplifies the way the user handles things, since their interpretation of the numerical "past order" is indeed how the system handles it.
Quote:
Originally Posted by Here-b-Trollz
Suggested Addition; Yes, I had need of this:
Well, I already basically have that function. Since the only way you can get an 'order' struct is to use GetPastOrder or GetLastOrder, you already know the # of that order. Therefore, just call IssuePastOrder(MyUnit, WhichOrderNumber) with your # as the second argument. Works fine.
__________________

Last edited by Rising_Dusk : 05-30-2010 at 09:20 PM.
Rising_Dusk is offline   Reply With Quote
Old 05-30-2010, 09:31 PM   #71
Here-b-Trollz
Corkscrew Chainsaw!!!
 
Join Date: Jun 2006
Posts: 711

Here-b-Trollz has a spectacular aura about (149)

Hero Contest #2 - 2nd Place

Default

Quote:
Originally Posted by Rising_Dusk
Well, I already basically have that function. Since the only way you can get an 'order' struct is to use GetPastOrder or GetLastOrder, you already know the # of that order. Therefore, just call IssuePastOrder(MyUnit, WhichOrderNumber) with your # as the second argument. Works fine.

You are assuming that I want to issue Unit A's order to Unit A.
__________________
By reading this signature, you agree that I cannot be held accountable for anything that I might say or do.

Last edited by Here-b-Trollz : 05-30-2010 at 09:32 PM.
Here-b-Trollz is offline   Reply With Quote
Old 05-30-2010, 09:45 PM   #72
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by Here-b-Trollz
You are assuming that I want to issue Unit A's order to Unit A.
Yes, because I suppose that makes sense to me for what the script is trying to do. I guess I could add it, then, but it would need to look a lot more like what my IssuePastOrder function does, since there are a lot of oddities in orders that it has to check for.

EDIT:
There, it has been updated with your function and the previously mentioned bug fix.
__________________

Last edited by Rising_Dusk : 05-30-2010 at 10:14 PM.
Rising_Dusk is offline   Reply With Quote
Old 05-30-2010, 10:15 PM   #73
Here-b-Trollz
Corkscrew Chainsaw!!!
 
Join Date: Jun 2006
Posts: 711

Here-b-Trollz has a spectacular aura about (149)

Hero Contest #2 - 2nd Place

Default

Quote:
Originally Posted by Rising_Dusk
Yes, because I suppose that makes sense to me for what the script is trying to do. I guess I could add it, then, but it would need to look a lot more like what my IssuePastOrder function does, since there are a lot of oddities in orders that it has to check for.

EDIT:
There, it has been updated with your function and the previously mentioned bug fix.
I am merely saying that I had use for such a function, and that others might as well. Obviously it is your decision; I've already hacked together what I needed.
__________________
By reading this signature, you agree that I cannot be held accountable for anything that I might say or do.
Here-b-Trollz is offline   Reply With Quote
Old 06-03-2010, 08:46 AM   #74
BlackRose
User
 
Join Date: Apr 2009
Posts: 38

BlackRose is on a distinguished road (13)

Default

Not really much of a problem but:

Collapse JASS:
debug     call BJDebugMsg(SCOPE_PREFIX+"Error: The "+I2S($ORDER$)+"th order doesn't exist")

1th.
2th.
3th.

:)
BlackRose is offline   Reply With Quote
Old 06-10-2010, 01:14 PM   #75
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Yeah, I know, I figured it didn't matter enough to actually do the if/then sequence since it's just for debug purposes anyway and it still tells you what you want. If/when I update this again for other bugs, remind me about that and I'll reword it, though.
__________________
Rising_Dusk 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 05:49 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