Textmacro issues

NoobImbaPro

You can change this now in User CP.
Reaction score
60
is there any way to pass a variable of a textmacro function into another textmacro??

JASS:

//! textmacro id takes name1
$name$ type variable1
//! endtextmacro

//! textmacro id2 takes name2
$name2$ type variable2 extends $name1$
//! endtextmacro
<div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">JASS:</div><div class="bbCodeBlock-content"><pre class="bbCodeCode"><code class="jass">

<span>so</span> <span>is</span> <span>there</span> <span>any</span> <span>way</span> <span>to</span> <span>put</span> <span>the</span> <span>name1</span> <span>into</span> <span>a</span> <span>global</span> <span>variable</span> <span>like</span> <span class="preprocessor">//! n = &amp;#039;$name1$&amp;#039;</span>
<span class="keyword">and</span> <span class="keyword">then</span> <span>use</span> <span>it</span> <span>in</span> <span>the</span> <span>second</span> <span>textmacro</span>?</code></pre></div></div>
 

Dirac

22710180
Reaction score
147
I havent tested this yet but it compiles
JASS:
//! textmacro TEST takes NAME
globals
    integer $NAME$ = 0
endglobals
    //! textmacroextend TEST2 takes $OTHER_NAME$
        function check takes integer i returns nothing
            set $NAME$=$NAME$+i
        endfunction
    //! endextendedtextmacro
    //! runtextmacroextend TEST2 (&quot;INTVAR&quot;)
//! endtextmacro
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
JASS:
//i want to make something like anonymous struct in jass so i need text macro extend outside of function  <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin    :D" loading="lazy" data-shortname=":D" />
//something like this
//! textmacro this takes name
//! runtextmacro that(&quot;$name$&quot;)
//! endtextmacro
 

Dirac

22710180
Reaction score
147
It's like you didn't bother to read what i posted.
Let me put it clearer
JASS:
scope TESTER

//! textmacro SETUP takes NAME,TYPE

    globals
        private $TYPE$ $NAME$Global1
        private $TYPE$ $NAME$Global2
    endglobals
    
//! textmacroextend EXTENSION
    function $NAME$Swap takes nothing returns nothing
        local $TYPE$ a = $NAME$Global1
        set $NAME$Global1 = $NAME$Global2
        set $NAME$Global2 = a
    endfunction
//! endextendedtextmacro

    //! runtextmacroextend EXTENSION()

//! endtextmacro

//! runtextmacro SETUP(&quot;Int&quot;,&quot;integer&quot;)
//! runtextmacro SETUP(&quot;Real&quot;,&quot;real&quot;)
//! runtextmacro SETUP(&quot;Unit&quot;,&quot;unit&quot;)

endscope
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
its like you don't understand....

see that and tell me how can you do that.

JASS:

//! runtextmacro struct (&quot;Data&quot;)
real a
real b
method g takes nothing returns nothing
endmethod
//! runtextmacro endstruct()


Where the first macro has the variable "Data" and the second has also some things called "Data" without putting anything inside the endstruct. And this can be done multiple times when calling endstruct to take different parameters depending on textmacto struct called before.

I think I have to analyze with deep detail what I mean, because there will be no easy answers for what I request once a while :D
 

Bribe

vJass errors are legion
Reaction score
67
Dirac,

textmacroextend and endextendedtextmacro

Come on... if you are going to make something up at least make it consistent?
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
JASS:
//! textmacro SETUP takes NAME,TYPE

    globals
        private $TYPE$ $NAME$Global1
        private $TYPE$ $NAME$Global2
    endglobals
    
//! textmacroextend EXTENSION
    function $NAME$Swap takes nothing returns nothing
        local $TYPE$ a = $NAME$Global1
        set $NAME$Global1 = $NAME$Global2
        set $NAME$Global2 = a
    endfunction
//! endextendedtextmacro

    //! runtextmacroextend EXTENSION()

//! endtextmacro


is the same thing with that....
JASS:
//! textmacro SETUP takes NAME,TYPE

    globals
        private $TYPE$ $NAME$Global1
        private $TYPE$ $NAME$Global2
    endglobals
    
    function $NAME$Swap takes nothing returns nothing
        local $TYPE$ a = $NAME$Global1
        set $NAME$Global1 = $NAME$Global2
        set $NAME$Global2 = a
    endfunction

//! endtextmacro


All I want is to play with the compiler but I can't :(
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
:nuts: Huh... Since when textmacros can be nested? And since when the jasshelper "understands" bogus keywords? (textmacroextend, endextendedtextmacro)

Some pseudo (C preprocessor like) inheritance could be done with textmacros:

JASS:
//! textmacro point2d_data
    real x
    real y
//! endtextmacro

struct point2d
    //! runtextmacro point2d_data()
endstruct

struct point3d // &quot;extends/specializes&quot; point2d
    //! runtextmacro point2d_data()
    real z
endstruct


NoobImbaPro:
1. All I want is to play with the compiler but I can't

1. If you want to rapid "test/play" with the jasshelper compiler, then just use: path/to/[cli]jasshelper --scriptonly path/to/common.j path/to/Blizzard.j input.j output.j from the command line, I think that's the easiest way to see the output of the tool.
 

Bribe

vJass errors are legion
Reaction score
67
@Bribe
I'm not making anything up

Dirac, JassHelper docs say nothing about any "textmacroextend". In fact they say you can't make nested textmacros, so what's going on here? If you didn't make it up then how would you have come by this "secret knowledge"?

Are you using cJass? I know cJass supports nested macros.
 

Bribe

vJass errors are legion
Reaction score
67
Well it probably compiles because it is treated like a comment then.

However I recommend checking out the war3map.j output to see if that is the same.
 

dudeim

New Member
Reaction score
22
Bribe please open the editor and test it yourself.
I don't know what is going on.
The user dudeim came up with this secret knowledge on this thread:
http://www.thehelper.net/forums/showthread.php/166234-Jass-globals-in-textmacro-s-(lua)
I said I didn't know the correct names of it so I typed something that looked like it (as far as my memory at that moment served), but as far as I know it doesn't exists and isn't supported:p
What I was meaning to type in that thread was this:
JASS:
//! externalblock extension=lua ObjectMerger $FILENAME$
//! endexternalblock
//instead of
//! textmacroextend
//! endextendedtextmacro
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
can I do something like this at least??

JASS:

//! i name

//! textmacro set takes value
    //! i name = &quot;$value$&quot; .. &quot; int1 = 5&quot;
//! endtextmacro

//! textmacro get
    //! writejass(name)
//! endtextmacro


so if I do this:
JASS:
//! runtextmacro set(&quot;integer&quot;)

function myfunc takes nothing returns integer
    //! runtextmacro get()
    return int1 == 6
endfunction


it will become this:
JASS:

function myfunc takes nothing returns integer
    integer int1 = 5

    return int1 == 6
endfunction
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
can cjass compile with w.e and can you do it with newgen or do you need a whole nother application
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
GFreak45:
1. can cjass compile with w.e and can you do it with newgen or do you need a whole nother application

1. http://cjass.xgm.ru/manual-en#htoc1

The cjass preprocessor is an awesome and powerful tool, yet most (at least the ones I know) [c|v]Jass[2] resource hosting sites don't allow cjass resources. Why? Good question, probably because vJass is the "standard" (at least it was in 2009, or so I've read), but if you're going to release a playable map then you most likely would want to use it. It's the only tool (I know) that allows you to compile for both 1.24+ and 1.23- version of Warcraft 3, this is of course only "the tip of the iceberg".
 

Bribe

vJass errors are legion
Reaction score
67
cJass is not 100% compatible with vJass scripts. It explodes when trying to compile my Table library, for example.

If everyone re-wrote their stuff to use cJass, it could be a standard then, but that's not realistic, because cJass requires JassHelper and even downloading Jass NewGen Pack does not contain the full JassHelper...

So you need to:

1. Have a windows computer
2. Disable your antivirus
3. Download JNGP
4. Download JassHelper 0.A.2.B
5. Download AdicParser
6. Update AdicParser

All this just to parse a programming langauge that parses into JASS. It's no wonder that GUI is still so popular. If vJass was built-in to the World Editor, or if cJass was, then glorious days.
 

Sgqvur

FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
Reaction score
62
Bribe:
1. So you need to:
1. Have a windows computer
2. Disable your antivirus
3. Download JNGP
4. Download JassHelper 0.A.2.B
5. Download AdicParser
6. Update AdicParser

2. It explodes when trying to compile my Table library, for example.

3. All this just to parse a programming langauge that parses into JASS. It's no wonder that GUI is still so popular.

1. This takes what? 5 min?

2. Well you could try to download the latest adichelper and then if it "explodes" again report it to the developer?

3. GUI is popular? How the !@#$ do you write arithmetic expressions with that thing? You don't? And plain jass is pain in the a$$...
Try writing a useful script with that thing.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
thats the language galaxy for sc2 is written in
and cjass is built into it with coloring, not with all the nice autofills and all that, but a basic version of it
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Varine Varine:
    I ordered like five blocks for 15 dollars. They're just little aluminum blocks with holes drilled into them
  • Varine Varine:
    They are pretty much disposable. I have shitty nozzles though, and I don't think these were designed for how hot I've run them
  • Varine Varine:
    I tried to extract it but the thing is pretty stuck. Idk what else I can use this for
  • Varine Varine:
    I'll throw it into my scrap stuff box, I'm sure can be used for something
  • Varine Varine:
    I have spare parts for like, everything BUT that block lol. Oh well, I'll print this shit next week I guess. Hopefully it fits
  • Varine Varine:
    I see that, despite your insistence to the contrary, we are becoming a recipe website
  • Varine Varine:
    Which is unique I guess.
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top