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 > Tutorials > JASS/AI scripts tutorials
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 04-23-2004, 07:41 PM   #1
JTG
User
 
Join Date: Apr 2003
Posts: 78

Submissions (1)

JTG has little to show at this moment (0)

Trace Systems

TRACE SYSTEMS
These functions are the trace systems that can be EXTREMELY useful when
trying see how your functions progress within the game. There are three
differing types, each with thier own specific purposes.
1. BASIC:
- designed just to display a message to the user with some values
- starting with ^trace^ it will take the message and pass it on to
^trace1^ with a value of zero and progress through ^trace4^ with
values of zero for the inputs. In ^trace4^ it calls the message
function ^traceM^ which displays all the values in an easy to read
manner (more on how it does that in a sec)
2. CONDITIONAL:
- designed to display a message to the user with some values under the
condition that a requirement has been met (otherwise it ignores it).
This way it can display an error message if something fails but
won't display any message if it was successful.
- It progresses much in the same manner as the BASIC trace type with
one exception. When it reaches ^contrace4^ it calls the message
function ^traceM^ and passes it the requirement to display the
message.
3. ELSE:
- designed to display a message to the user with some values under the
condition that a requirement has been met. If the requirement was
NOT met, then it will display a DIFFERENT message. This way if you
wanted to see how far into a trigger the environment has progress
it can tell you that it went with one direction or another.
- It progresses much in the same manner as the BASIC trace type with
one exception. When it reaches ^traceelse4^ it calls the message
function ^traceM^ and passes it the requirement to display the FIRST
message, if it fails then it displays the SECOND message.

In the globals section IMMEDIATELY after constants
Collapse JASS:
    // trace add-in
    boolean            bj_trace_on                 = false
At the beggining of your custom script section in the map or at the end of Blizzard.j (before your custom script in there)
Collapse JASS:
//============================================================================
function traceM takes string message, string elsemsg, integer v1, integer v2, integer v3, integer v4, boolean req, boolean elsereq returns nothing
    if     bj_trace_on and req and     elsereq then
        call DisplayTextToForce(GetForceOfPlayer(Player(0)),"|n|cff32cd32Trace - |r" + message + ", " + I2S(v1) + ", " + I2S(v2) + ", " + I2S(v3) + ", " + I2S(v4))
    elseif bj_trace_on and req and not elsereq then
        call DisplayTextToForce(GetForceOfPlayer(Player(0)),"|n|cff32cd32Trace - |r" + elsemsg + ", " + I2S(v1) + ", " + I2S(v2) + ", " + I2S(v3) + ", " + I2S(v4))
    endif
endfunction
function trace4 takes string message, integer v1, integer v2, integer v3, integer v4 returns nothing
    call    traceM(message,"",v1,v2,v3,v4,true,true)
endfunction
function trace3 takes string message, integer v1, integer v2, integer v3 returns nothing
    call    trace4(message,   v1,v2,v3, 0     )
endfunction
function trace2 takes string message, integer v1, integer v2 returns nothing
    call    trace3(message,   v1,v2, 0        )
endfunction
function trace1 takes string message, integer v1 returns nothing
    call    trace2(message,   v1, 0           )
endfunction
function trace takes string message returns nothing
    call    trace1(message,    0              )
endfunction
function contrace4 takes string message, integer v1, integer v2, integer v3, integer v4, boolean req returns nothing
    call    traceM(message,"",v1,v2,v3,v4, req,true)
endfunction
function contrace3 takes string message, integer v1, integer v2, integer v3, boolean req returns nothing
    call contrace4(message,   v1,v2,v3, 0, req)
endfunction
function contrace2 takes string message, integer v1, integer v2, boolean req returns nothing
    call contrace3(message,   v1,v2, 0,    req)
endfunction
function contrace1 takes string message, integer v1, boolean req returns nothing
    call contrace2(message,   v1, 0,       req)
endfunction
function contrace takes string message, boolean req returns nothing
    call contrace1(message,    0,          req)
endfunction
function traceelse4 takes string message, string elsemsg, integer v1, integer v2, integer v3, integer v4, boolean elsereq returns nothing
    call     traceM(message,elsemsg,v1,v2,v3,v4,true,elsereq)
endfunction
function traceelse3 takes string message, string elsemsg, integer v1, integer v2, integer v3, boolean elsereq returns nothing
    call traceelse4(message,elsemsg,v1,v2,v3, 0,elsereq)
endfunction
function traceelse2 takes string message, string elsemsg, integer v1, integer v2, boolean elsereq returns nothing
    call traceelse3(message,elsemsg,v1,v2, 0,   elsereq)
endfunction
function traceelse1 takes string message, string elsemsg, integer v1, boolean elsereq returns nothing
    call traceelse2(message,elsemsg,v1, 0,      elsereq)
endfunction
function traceelse  takes string message, string elsemsg, boolean elsereq returns nothing
    call traceelse1(message,elsemsg, 0,         elsereq)
endfunction
//============================================================================
JTG is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-23-2007, 08:44 PM   #2
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

I'm sure this is freakin' outdated... but I'm completely flummoxed. What is all this trace stuff supposed to do?
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm 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 04:14 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