Some questions pertaining to JASS and vJASS

CaptainJack

New Member
Reaction score
2
I have recently continued work on a few of the maps that I was making but hadn't quite finished. And this time I around I wish to use JASS or vJASS.

1. Is it correct in saying that anything other than the base native types will produce some form of leak and need to be destroyed after being used?

2. Is JASS/vJASS consitent with other programming languages in the fact that a local will only exist in the scope of the function?

3. Taking what I have read anything that hasn't been destroyed other than the base types will leave the object in memory. In the case of a trigger would this allow a local trigger to exist after nulling the reference to it. Is it correct to assume that you can create local trigger that will be able to fire?
(Note: I have tried reproducing a local trigger and have had no luck getting the local trigger to fire.)

4. Is there a more up to date way to integrate vJASS and other addons into the world editor other than the JASS NewGen Pack 1.5d because that is horribly out of date.
(I have attempted at updating individual components without much luck, and I don't feel using the compilers via command line is a time efficient way to get things done.)
 

tooltiperror

Super Moderator
Reaction score
231
1. Is it correct in saying that anything other than the base native types will produce some form of leak and need to be destroyed after being used?
What do you mean by native types? You mean other than integers, reals, and strings?

2. Is JASS/vJASS consitent with other programming languages in the fact that a local will only exist in the scope of the function?
Indeed.

3. Taking what I have read anything that hasn't been destroyed other than the base types will leave the object in memory.
Usually, if I was right at #1.

In the case of a trigger would this allow a local trigger to exist after nulling the reference to it. Is it correct to assume that you can create local trigger that will be able to fire?
(Note: I have tried reproducing a local trigger and have had no luck getting the local trigger to fire.)
You can null a trigger and its events will still fire, so you can also reuse one trigger for an entire map, as long as you are not destroying events.

4. Is there a more up to date way to integrate vJASS and other addons into the world editor other than the JASS NewGen Pack 1.5d because that is horribly out of date.
(I have attempted at updating individual components without much luck, and I don't feel using the compilers via command line is a time efficient way to get things done.)
You can just update your JassHelper folder.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
1. Huh ?!
Base native types ?

2. Yepp, local variables only work in the function it's declared in :D
They also need to be declared at the very top of the function, before anything else (Except comments :p)

3. A trigger will exist, and work as long as you have done [ljass]CreateTrigger()[/ljass] on it, and haven't disabled/destroyed it :D

4. Of course there is a way, just don't know if it's easy XD
Anyways, Newgen isn't that much out of date as there isn't that much of the components that have been updated, and you only have to update JassHelper, really...
 

CaptainJack

New Member
Reaction score
2
1. Base native types are as follows boolean, code, handle, integer, real, string. So anything other than these.

4. I don't want to use something that is 4 years old, and doesn't match up with the most recent version of World Editor. I'm well aware of the updating the Jass Helper folder. That isn't the issue I had.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
1. Well, you still have to null some of these, like many handles needs to be nulled (And maybe strings :S XD)

4. It works with the latest patch !
It works perfectly for me...
 

CaptainJack

New Member
Reaction score
2
4. I'm not a fan of the fact that my map has been saved by a more recent version of the editor message, which is caused by the fact that the UMSWE is 4 years old. Being based off of 1.21b patch.
 

Jedi

New Member
Reaction score
63
You don't need to null integers, strings, booleans, strings - these 4 called "primative types"- (Actually you can't null strings, don't use local string variables if you can)You should null all other types.
 

CaptainJack

New Member
Reaction score
2
I am going to be using the .wts file because a string table is much easier to edit and translate than using stings inside the code. So that won't be an issue.
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
I am going to be using the .wts file because a string table is much easier to edit and translate than using stings inside the code. So that won't be an issue.

Way to make life harder than it should be.
If you're really that concerned about having to edit them, put them in a constant string global variable.

And I don't get this message:
I'm not a fan of the fact that my map has been saved by a more recent version of the editor message, which is caused by the fact that the UMSWE is 4 years old. Being based off of 1.21b patch.

I've never gotten this message before.
Ever.
 

CaptainJack

New Member
Reaction score
2
You probably have never gotten the error because all of your maps are created within the newgen. Meaning they all have a 1.21b version basis.
 

tooltiperror

Super Moderator
Reaction score
231
Jack, I personally code in vJASS and don't use NewGen.
 

tooltiperror

Super Moderator
Reaction score
231
(/KathyGriffinVoice)

But seriously, according to Vexorian, all maps should [LJASS]//! import[/LJASS] code.

Edit: Nope, no integration, I code in TextEdit (Mac Notepad) and then do all my syntax checking with [LJASS]wine ~/Desktop/JassHelper/clijasshelper common.j blizzard.j testmap.w3x[/LJASS].
 

SineCosine

I'm still looking for my Tangent
Reaction score
77
You need to:
01) [lJASS]call DisableTrigger(trigger)[/lJASS]
02) [lJASS]call DestroyTrigger(trigger)[/lJASS]
03) [lJASS]set trigger = null[/lJASS]
 

CaptainJack

New Member
Reaction score
2
Anyways regardless of the vJASS integration, as I'm not too preoccupied with that. Regular JASS is good enough for my purposes as of now. I still have yet to get the local trigger to fire even once. For testing purposes I've removed conditions and it still hasn't executed. Anyone able to tell me what is wrong?

JASS:
function Waygate_Teleport_Conditions takes nothing returns boolean
    return true
endfunction

function Waygate_Teleport_Actions takes nothing returns nothing
    local location temp
    set temp = Location(GetRandomReal(GetRectMinX(gg_rct_Waygate_Teleport), GetRectMaxX(gg_rct_Waygate_Teleport)), GetRandomReal(GetRectMinY(gg_rct_Waygate_Teleport), GetRectMaxY(gg_rct_Waygate_Teleport)))
    call SetUnitPositionLoc(GetTriggerUnit(), temp)
    call RemoveLocation(temp)
    set temp = null
endfunction


//===========================================================================
function InitTrig_Waygates takes nothing returns nothing

    local region tempRegion = CreateRegion()
    local trigger WaygateTeleport = CreateTrigger()
    
    call RegionAddRect(tempRegion, gg_rct_NewLoc)
    call TriggerRegisterEnterRegion(Waygate_Teleport, tempRegion, null)
    call TriggerAddCondition(Waygate_Teleport, Condition(function Waygate_Teleport_Conditions))
    call TriggerAddAction(Waygate_Teleport, function Waygate_Teleport_Actions) 
    call RegionClearRect(tempRegion, gg_rct_NewLoc)

    call RemoveRegion(tempRegion)
    set tempRegion = null
	set WaygateTeleport = null
  
endfunction
 

SineCosine

I'm still looking for my Tangent
Reaction score
77

CaptainJack

New Member
Reaction score
2
I'm not particularly worried about optimizations like using coordinates at the time being, I just want the damn thing to fire.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
JASS:
    call RegionClearRect(tempRegion, gg_rct_NewLoc)

    call RemoveRegion(tempRegion)
    set tempRegion = null
    set WaygateTeleport = null


What's all that about ?!
You can't expect people to be able to enter a region, when you remove it just after you've registered it...
 
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