vJass - I: Uncomplicating the Complicated

Romek

Super Moderator
Reaction score
963
Part 2 is WIP. It won't cover structs and methods quite yet though. That's for Part 3.
Thanks for the comment. =)
 

Romek

Super Moderator
Reaction score
963
It's started. Just on hold.
 

Undead Me

New Member
Reaction score
5
Question: Having downloaded from the grimoire site, how do I actually use the JassHelper program?
 

kaboo

New Member
Reaction score
45
-seriously looking for part2
-to part1 it's good, but it covers just the very basics, for example i still dont know how to display a message to certain player, or all players, or how to move unit, set flying high, kill unit, pause unit, make unit cast a spell, create unit, move camera, revive hero, create item, give item, etc.... (is it all just about using the natives?)
 

Romek

Super Moderator
Reaction score
963
> display a message to certain player, or all players, or how to move unit, set flying high, kill unit, pause unit, make unit cast a spell, create unit, move camera, revive hero, create item, give item, etc.... (is it all just about using the natives?)

Yeah, just use the function list to search for an appropriate function.
For example, search "Kill", and you'll find "KillUnit" quite quickly. Take a look a what it takes and returns, and pass the correct type to the function. I'm aware I haven't really covered types such as units in this part though.

I apologize about the delay with Part II. I need to make another tutorial about something slightly different first, then I'll move onto vJass II. :)
 

tooltiperror

Super Moderator
Reaction score
231
Romek, i think this really made me 'get' JASS. I've had a hard time for a long time 'grasping' paramaters and the taking and returning and such, but the factory metaphor made me understand it.

The BJ's part was also good, because I never understood why people said "Remove them they're bad."

I think that struct's wouldn't be to much to delve into.

I think it would help to add in small 'challenges' to see if people are following you. Like create a trigger that would accomplish what you learn in that section.
 

Romek

Super Moderator
Reaction score
963
There aren't really many challenges to do in a tutorial like this.
I'll go into structs in part 2 or 3, and I'll add some tasks too.

Thanks for the feedback! :thup:
 

tooltiperror

Super Moderator
Reaction score
231
No Problem, Happy Thanksgiving.

The only other thing I can think of to add is how to 'make' functions that you can call again.
 

rover2341

Is riding a roller coaster...Wee!
Reaction score
113
I am reading and re-reading. A Sample Map Would be helpful for me. Ill keep trying...
 

Romek

Super Moderator
Reaction score
963
Nope. Not yet. :p

I've got a week off in two weeks, so I'll probably get it done then.
 

nandosman

New Member
Reaction score
4
Dude great tutorial!

I have a few questions:

- So, scopes are like classes in Java, right?

- When you create a scope with an initializer, your are making that function to load in map initialization, but the other functions in the scope wont, right?

- Can you have a scope with multiple initializers?

- are globals always moved to the top of the code?

- can i have multiple globals blocks in different scopes?

- Can i have a globals block outside any scope?

- What about Scopes inside Scopes?
 

Romek

Super Moderator
Reaction score
963
> So, scopes are like classes in Java, right?
I don't know Java, though assuming classes are the same in Java and C#, then no. Structs are more like classes. This tutorial doesn't cover structs; if you want to learn about them, take a look at a specific struct tutorial. :)

> When you create a scope with an initializer, your are making that function to load in map initialization, but the other functions in the scope wont, right?
Right.

> Can you have a scope with multiple initializers?
No, though you can call/execute other functions from within the initializer.

> are globals always moved to the top of the code?
Yes, otherwise Wc3 won't read the map.

> can i have multiple globals blocks in different scopes?
Yes, you can place global blocks within any scope. You can also have more than one global block in each scope.

> Can i have a globals block outside any scope?
Yes, though you won't be able to make the globals private nor public.

> What about Scopes inside Scopes?
If memory serves, nested scopes cannot have initializers. Other than that, it's good for organizing code.
 

Lehona

New Member
Reaction score
12
Scopes are like namespaces (Though I don't know Java so I'm not sure whether namespaces exist there).
 

Lehona

New Member
Reaction score
12
Then think of it like everything gets a <scopename>_ prefix.
JASS:
 scope example initializer init
globals
public trigger t
endglobals
function init takes nothing returns nothing
set t = CreateTrigger()
endfunction
endscope

will become:

JASS:

globals
trigger example_t
endglobals
function example_init takes nothing returns nothing
set example_t = CreateTrigger()
endfunction


// I am ignoring things like free global declaration and the namechange of initializers
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top