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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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