HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help with vJass -> Jass

04-28-2009, 06:29 PM#1
Cheezeman
So I'm trying to convert a vJass script into Jass so I can add it into a "normal" map.
It works fine just by purposly adding an extra "endfunction" in the end of my code/script (my vocabulary in programing is limited).
This line will cause an error when I press Save and I can access the code.

Now, I've only encountered one problem so far, and that is with the decleration of globals.
I know that vJass enables me to declare globals wherever I want, but Jass can't do that!
And that's where it all goes wrong, see, I have global decleration inside this script and since it's all moved to the top of the "entire code" (is 'header' the right word?), I can't access it.

So... is there any way for me to edit the Global Decleration in normal WE (no add-ons) to get it working?
04-28-2009, 06:32 PM#2
Captain Griffen
Not without editing the .j file directly / with another program each time.
04-28-2009, 06:52 PM#3
Cheezeman
Quote:
Originally Posted by Captain Griffen
Not without editing the .j file directly / with another program each time.
I was afraid of that
Well, I could try to convert all the globals into local variables, but that will destroy the JESP and efficiency.
Ok not really destroy JESP, but disabling it for the moment. I can always make it JESP again.

Thanks anyway
04-28-2009, 09:07 PM#4
Alevice
Arent posts missing here? Anyway, try replacing the globals with constant functions, much like we all old farts used to.
04-28-2009, 11:33 PM#5
Fledermaus
You could just rename them to udg_GLOBALNAME and create them in the variable editor.
04-29-2009, 02:22 AM#6
Vexorian
Quote:
Well, I could try to convert all the globals into local variables,
No...
04-29-2009, 08:01 AM#7
Pyrogasm
Out of curiosity, why do you need to do this?
04-30-2009, 06:23 AM#8
kingkingyyk3
vJass is good, Juz feel weird why u wan to make it...
05-04-2009, 03:58 PM#9
Cheezeman
Ouch I havn't checked this in a long time... Sorry
Ok 1 quote at a time:

Quote:
Originally Posted by Fledermaus
You could just rename them to udg_GLOBALNAME and create them in the variable editor.
Might just work, I'll try it

Quote:
Originally Posted by Pyrogasm
Out of curiosity, why do you need to do this?
Well I made a spell in vJass, and a friend of mine *might* wanna implent it to his map (notice the *might*, he's not decided).
However, he only uses Jass in it (dunno why ) so instead of spending time re-creating the script I could just convert it using Ctrl + C in Syntax Check (the spell is that simple, yes).
The only problem I found was declaring global variables, so I thought I'd ask here.

There is another solution aswell, and that is to get his map to support vJass (which I don't know how, it just desplays a message saying that it's an older version)
05-04-2009, 05:13 PM#10
Alevice
is his we up to date? hje needs at least patch 1.21 so jngp works.

edit: thanks whoever killed the multiple posts. I dont know why that happened and couldnt fix it either.
05-05-2009, 04:15 PM#11
Cheezeman
Quote:
Originally Posted by Alevice
is his we up to date? hje needs at least patch 1.21 so jngp works.
Why does that matter?
I mean, I can't open any pre-existing maps with JNPG and implent vJass scripts to them, so I figured that he wouldn't be able to either.
Am I the only one experiencing that problem?
05-05-2009, 07:26 PM#12
Bobo_The_Kodo
Quote:
Am I the only one experiencing that problem?
Yes
05-06-2009, 09:44 AM#13
Cheezeman
Quote:
Originally Posted by Bobo_The_Kodo
Yes
Wow that sucks...
Perhaps I should create a new thread here about it.
05-06-2009, 11:52 AM#14
DioD
He is not your friend, abaddon him (and tell to install newgenpack)
05-06-2009, 12:05 PM#15
TotallyAwesome
Quote:
Originally Posted by DioD
He is not your friend, abaddon him (and tell to install newgenpack)
That. If he forces you to pwn your code you've been working on, for him, he's not a real friend, a real friend would just get newgen.