• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] Red Rift

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: usfmohy and Cihparg
Resource Owner - Prince.Zero
Credits Distribution - Vexorian (Dummy.mdx model)

Documentation Bellow
JASS:
*******************************
//Ability :  RED RIFT
// ````````````````````````````````
// Version : 1.0.4
//*******************************
//What it does?
//Unleashes a negative crimson bolt that binds nearby enemy units in its wake to a lightning grip. 
//If the orb explodes and the enemy units that are binded to it are further than 500 units away, 
//they get teleported to the orb's location and take magic damage whilst getting purged for 2 seconds, 
//removing any buffs on them and having their movement slowed for 2 seconds.
//NOTE: You can add your own effects if you want instead of the purging thing.
//It's on line : 59
//********************************

//********************************
//HOW TO IMPORT TO YOUR MAP
//Extract the dummy.mdx model if you don't have it already in your map and import it
//If you don't have an universal dummy unit i suggest you copy mine or create one at your map using the dummy.mdx model we've imported.
//Copy the trigger, Create a variable : a hashtable variable called RedRiftHT
//Make sure the trigger name is : Red Rift
//If you already have an ability that's called that way rename this line : function InitTrig_Red_Rift takes nothing returns nothing
InitTrig_ must be left as it is, Red_Rift must be renamed, rememeber, for each space you add to the name, you gotta add _ . example : Trigger name = The Red Rift
function InitTrig_Red_Rift takes nothing returns nothing => function InitTrig_The_Red_Rift takes nothing returns nothing
//********************************
//********************************
Enjoy

Credits :  Vexorian  (dummy.mdx model)
Map Code
JASS:
function RedRift_CastAbility takes nothing returns integer
    return 'A000' //Enter the raw code of the ability that triggers this
endfunction    

function RedRift_OrbModel takes nothing returns string
    return "Abilities\\Weapons\\VengeanceMissile\\VengeanceMissile.mdl"   //Enter the model you want to use for the orb
endfunction

function RedRift_OrbHeight takes nothing returns real
    return 150.55 //Enter the flying height of your orb, make sure your dummy model has at least hovering movement or flying
endfunction    

function RedRift_BaseDmg takes nothing returns real
    return 100.0 //Enter here the base damage of the spell
endfunction

function RedRift_IncDmg takes nothing returns real
    return 60.0 //Enter here the damage increment per level
endfunction

function RedRift_Distance takes nothing returns real
    return 2000.0 //Distance in units which the orb travells
endfunction

function RedRift_Speed takes nothing returns real
    return 14.25 //The speed that the orb has when released (about 460 units per second)
endfunction    

function RedRift_BaseGripRange takes nothing returns real
    return 200.0 //The base range that enemy units are caught
endfunction

function RedRift_IncGripRange takes nothing returns real
    return 30.0 //The increment value of the Grip range increases by this value per level
endfunction

function RedRift_DummyID takes nothing returns integer
    return 'e000' //The ID of the dummy orb unit
endfunction

function RedRift_LightningType takes nothing returns string
    //return"CLPB"                            //Chain Lightning Primary
    //return"CLSB"                           //Chain Lightning Secondary
    //return"DRAB"                           //Drain
    //return "DRAL"                           //Drain Life
    //return "DRAM"                           //Drain Mana
    //return "AFOD"                           //Finger of Death
    //return "FORK"                           //Forked Lightning
    //return "HWPB"                           //Healing Wave Primary
    //return "HWSB"                           //Healing Wave Secondary
    //return "CHIM"                           //Lightning Attack
    return "LEAS"                           //Magic Leash
    //return "MBUR"                           //Mana Burn
    //return "MFPB"                           //Mana Flare
    //return "SPLK"                           //Spirit Link
    //  Remember, if you wanna use something different, comment out your primary and uncomment the one you're gonna use
endfunction

function RedRift_AdditionalEffects takes unit c, unit victim returns nothing
    local integer DUMMY_SPELL = 'ACpu' //In my case this is the purge ability
    local string ORDER_STRING = "purge" //In my case i use purge... in case you wanna use something different, just change it
    local unit dummy = CreateUnit(GetOwningPlayer(c), RedRift_DummyID(), GetUnitX(victim), GetUnitY(victim), 0)
    call UnitAddAbility(dummy, DUMMY_SPELL)
    call UnitRemoveAbility(dummy, 'Aatk')
    call IssueTargetOrder(dummy, ORDER_STRING, victim)
    call UnitApplyTimedLife(dummy, 'BTLF', 1)
    set dummy = null
/// Use any custom effects here if you wish, like stunning, slow... anything that is related from handle c to handle victim
endfunction

///////////////////////////////////////////////////////////
//No touching belllow if you don't know what you're doing//
//Don't bother reading, Jass is a mess but quite efficient if you know how to use it.//
///////////////////////////////////////////////////////////

function RedRift_Condition takes nothing returns boolean
    return GetSpellAbilityId() == RedRift_CastAbility()
endfunction    
//Irrelevant functions to the user...
//Very useful since we dont want our game to crash if the orb goes outside boundaries
//That's because we use SetUnitX/Y instead of SetUnitPosition
//Even with a collision enabled, SetUnitX/Y totally ignores it, thats why the orb can get outside the map boundaries. duh
function RedRift_SafeX takes real x returns real
	local real rx=GetRectMinX(bj_mapInitialPlayableArea)+50
	if(x<rx)then
		return rx
	endif
	set rx=GetRectMaxX(bj_mapInitialPlayableArea)-50
	if(x>rx)then
		return rx
	endif
	return x
endfunction

function RedRift_SafeY takes real y returns real
	local real ry=GetRectMinY(bj_mapInitialPlayableArea)+50
	if(y<ry)then
		return ry
	endif
	set ry=GetRectMaxY(bj_mapInitialPlayableArea)-50
	if(y>ry)then
		return ry
	endif
	return y
endfunction

function RedRift_SafeShift takes real a returns real
    if a < .01 then
        return .01
    elseif a > .99 then
        return .99
    endif
    return a
endfunction    


function RedRift_Move takes nothing returns nothing
    local integer table = GetHandleId(GetExpiredTimer())
    local unit orb = LoadUnitHandle(udg_RedRiftHT, table, StringHash("Orb | Unit"))
    local real dmg = LoadReal(udg_RedRiftHT, table, StringHash("Orb | Dmg"))
    local real dist = LoadReal(udg_RedRiftHT, table, StringHash("Orb | Dist"))
    local real X = LoadReal(udg_RedRiftHT, table, StringHash("Orb | X"))
    local real Y = LoadReal(udg_RedRiftHT, table, StringHash("Orb | Y"))
    local real Angle = LoadReal(udg_RedRiftHT, table, StringHash("Orb | Angle"))
    local real speed = LoadReal(udg_RedRiftHT, table, StringHash("Orb | Speed"))
    local group Gripped = LoadGroupHandle(udg_RedRiftHT, table, StringHash("Orb | Group"))
    local real aoe = LoadReal(udg_RedRiftHT, table, StringHash("Orb | AOE"))
    local real x = RedRift_SafeX(GetUnitX(orb) + speed * Cos(Angle * bj_DEGTORAD))
    local real y = RedRift_SafeY(GetUnitY(orb) + speed * Sin(Angle * bj_DEGTORAD))
    local group g = CreateGroup()
    local real dur = LoadReal(udg_RedRiftHT, table, StringHash("Orb | Duration"))
    local real x1
    local real y1
    local real scale
    local unit u
    local lightning l
    local real array c    
    set dur = dur + .0315
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | Duration"), dur)
    call SetUnitX(orb, x)
    call SetUnitY(orb, y)
    call GroupEnumUnitsInRange(g, GetUnitX(orb), GetUnitY(orb), aoe, null)
    loop
    set u = FirstOfGroup(g)
    set l = null
    exitwhen u == null
    if ((not(IsUnitInGroup(u, Gripped))) and IsUnitEnemy(u, GetOwningPlayer(orb)) and (GetWidgetLife(u)>0.415) and (not(IsUnitType(u, UNIT_TYPE_STRUCTURE))) and (not(IsUnitType(u, UNIT_TYPE_MAGIC_IMMUNE)))) then
        call GroupAddUnit(Gripped, u)   
        set scale = LoadReal(udg_RedRiftHT, table, StringHash("Orb | size"))
        set scale = scale + .475    
        call SetUnitScale(orb, scale, scale, scale)
        call SaveReal(udg_RedRiftHT, table, StringHash("Orb | size"), scale)
        call SaveLightningHandle(udg_RedRiftHT, table, GetHandleId(u), AddLightning(RedRift_LightningType(), true, GetUnitX(u), GetUnitY(u), GetUnitX(orb), GetUnitY(orb)))
    endif
    call GroupRemoveUnit(g, u)
    endloop
    call GroupAddGroup(Gripped, g)
   loop
    set u = FirstOfGroup(g)
    set l = null
    exitwhen u == null
        set l = LoadLightningHandle(udg_RedRiftHT, table, GetHandleId(u))
        call MoveLightningEx(l, true, GetUnitX(u), GetUnitY(u), GetUnitFlyHeight(u), x, y, GetUnitFlyHeight(orb))
        set x1 = GetUnitX(u)
        set y1 = GetUnitY(u)
        if SquareRoot((x - x1) * (x - x1) + (y - y1) * (y - y1)) > 500 then
            set c[0] = RedRift_SafeShift(GetLightningColorG(l) - .02)
            set c[1] = RedRift_SafeShift(GetLightningColorB(l) - .03)
        else
            set c[0] = RedRift_SafeShift(GetLightningColorG(l) + .06)
            set c[1] = RedRift_SafeShift(GetLightningColorB(l) + .09)
        endif    
        call SetLightningColor(l, 1, c[0], c[1], .9)
        if (GetWidgetLife(u)<.415) then
            call DestroyLightning(l)
            call GroupRemoveUnit(Gripped, u)
        endif    
    call GroupRemoveUnit(g, u)
    endloop
    call DestroyGroup(g)
    if (SquareRoot((X - x) * (X - x) + (Y - y) * (Y - y)) > dist) or (dur > 15) then
        call PauseTimer(GetExpiredTimer())
        loop
        set u = FirstOfGroup(Gripped)
        set l = null
        exitwhen u == null
            set l = LoadLightningHandle(udg_RedRiftHT, table, GetHandleId(u))
            call DestroyLightning(l)
            set x1 = GetUnitX(u)
            set y1 = GetUnitY(u)
            if SquareRoot((x - x1) * (x - x1) + (y - y1) * (y - y1)) > 500 then
                call SetUnitPosition(u, GetUnitX(orb), GetUnitY(orb))
                call RedRift_AdditionalEffects(orb, u)
                call DestroyEffect(AddSpecialEffectTarget("Abilities\\Spells\\Demon\\DemonBoltImpact\\DemonBoltImpact.mdl" , u, "chest"))
                call UnitDamageTarget(orb, u, dmg, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
            endif    
            call GroupRemoveUnit(Gripped, u)
        endloop
        call DestroyGroup(Gripped)
        call SetUnitVertexColor(orb, 255, 55, 100, 205)
        call DestroyEffect(AddSpecialEffectTarget("Abilities\\Weapons\\Bolt\\BoltImpact.mdl", orb, "origin"))
        call DestroyEffect(LoadEffectHandle(udg_RedRiftHT, table, StringHash("Orb | Art")))
        call KillUnit(orb)
        call FlushChildHashtable(udg_RedRiftHT, table)
        call DestroyTimer(GetExpiredTimer())
    endif    
    set orb = null
    set g = null
    set Gripped = null    
endfunction    

function RedRift_Actions takes nothing returns nothing
    local timer t = CreateTimer()
    local integer table = GetHandleId(t)
    local real OrbX = GetUnitX(GetTriggerUnit())
    local real OrbY = GetUnitY(GetTriggerUnit())
    local real FINAL_DMG = RedRift_BaseDmg() + (RedRift_IncDmg() * (I2R(GetUnitAbilityLevel(GetTriggerUnit(), RedRift_CastAbility()))-1))
    local real GRIP_RANGE = RedRift_BaseGripRange() + RedRift_IncGripRange() * I2R(GetUnitAbilityLevel(GetTriggerUnit(), RedRift_CastAbility()))
    local real Angle = bj_RADTODEG * Atan2(GetSpellTargetY() - OrbY, GetSpellTargetX() - OrbX)
    local unit Orb = CreateUnit(GetOwningPlayer(GetTriggerUnit()), RedRift_DummyID(), OrbX, OrbY, Angle)
    call UnitRemoveAbility(Orb, 'Aatk')
    call SetUnitFlyHeight(Orb, RedRift_OrbHeight(), 3000)
    call SaveEffectHandle(udg_RedRiftHT, table, StringHash("Orb | Art"), AddSpecialEffectTarget(RedRift_OrbModel(), Orb, "origin"))
    call SaveUnitHandle(udg_RedRiftHT, table, StringHash("Orb | Caster"), GetTriggerUnit())
    call SaveUnitHandle(udg_RedRiftHT, table, StringHash("Orb | Unit"), Orb)
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | Dmg"), FINAL_DMG)
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | Dist"), RedRift_Distance())
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | X"), OrbX)
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | Y"), OrbY)
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | Angle"), Angle)
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | size"), 1)
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | Speed"), RedRift_Speed())
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | AOE"), GRIP_RANGE)
    call SaveReal(udg_RedRiftHT, table, StringHash("Orb | Duration"), 0) // Just in case this gets stuck just outside map boundaries... The orb dies after 10 seconds
    call SaveGroupHandle(udg_RedRiftHT, table, StringHash("Orb | Group"), CreateGroup())
    call TimerStart(t, .0315, true, function RedRift_Move)
    set t = null
    set Orb = null
endfunction

//===========================================================================

function InitTrig_Red_Rift takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition(t, Condition(function RedRift_Condition))
    call TriggerAddAction( t, function RedRift_Actions )
    set udg_RedRiftHT = InitHashtable()
    set t = null
endfunction

@ TriggerHappy
Well since i can't do anything to annoy you about the thing called ExecuteFunc() (Which tells me you got no idea what it does)
I've simply removed it as i don't want the tag 'NEEDS FIX!' over my resource (which stands absolutely nowhere)
I've used the spell hundreds of time, checked the memory usage. KB Leaked (0 zero)

@ Forum
Enjoy!

Keywords:
orb, rift, vortex, lightning, missile, red, spell, crimson
Contents

Red Rift v1.0.4 (Map)

Reviews
12th Dec 2015 IcemanBo: Too long time as NeedsFix. Rejected. 23:55, 18th Aug 2010 TriggerHappy: A spell cannot be MUI & MPI, it's either or. What's the reason you're using ExecuteFunc? You don't null all your handles in every function...

Moderator

M

Moderator

12th Dec 2015
IcemanBo: Too long time as NeedsFix. Rejected.

23:55, 18th Aug 2010
TriggerHappy:

A spell cannot be MUI & MPI, it's either or.
  • What's the reason you're using ExecuteFunc?
  • You don't null all your handles in every function, which makes this leak.
  • Your ClearUnit function is pretty sad, use timed life or something. I know it doesn't remove the unit but it's better than what you're doing now (wait + remove)
That's all for now, I'm sure there's more.
 
Level 15
Joined
Jul 6, 2009
Messages
889
• Map camera doesn't even start on the heroes when you test it, that's real handy isn't it?
• The lightning's look ugly as they just turn from one colour to another instantly. I would say you should fade it.
• Your code leaks alot. Don't say it doesn't. It leaks because you don't null local handles. Like orb and stuff.
• You might just want to turn StringHash(table) into a variable to save that many calls.
• It shouldn't be the user who has to scan through [messy] code to configure it. You should leave a configurable section at the top using constant functions that return a value. Even if it results in less effiency due to function calls (I think, does constant help? IDK), at least it's more user-friendly. Yes you can do this with JASS.
• The lightnings are not even attached to the orb, they are attached to the ground where the orb is. They should be connected WITH the orb.
• You can do a shitload of optimizing to your code.
 
Last edited:
Level 7
Joined
Jun 6, 2010
Messages
224
Well than, messy JASS code is messy JASS code. Hard to configure, saying it's plain JASS is a stupid excuse. You have constant functions for that. Header is just a wall of text to me.

• Map camera doesn't even start on the heroes when you test it.
• The lightning's look ugly as they just turn from one colour to another instantly. I would say you should fade it.

I'm not wanting to read over the JASS code. :(

Your review is plain ridiculous
If you saw what was behind your vJass code there goes the real mess.
You think that if you did this into vJass it would make the code more efficient than mine?

Let me tell you, you're wrong. This is the most efficient way that a spell can work. Constant functions are like BJ's. And i heard you guys hate BJ's.

Go read the map scrip of your vJASS code and see how messy it is then come back here so i can review your smartness.

-------------
Back to the point.
I'll leave the moderators to decide whether i must use Constant functions.

• The lightning's look ugly as they just turn from one colour to another instantly. I would say you should fade it.
yea sure, big deal. just a few more reals stored...
 
Level 15
Joined
Jul 6, 2009
Messages
889
Blah. I am not that smart. Everyone knows that but still I will persist:

If you saw what was behind your vJass code there goes the real mess.

Yes. Of course compiled vJass is messy, it's arrays and crap everywhere. But the point is we work with vJass, uncompiled, much more readable.

You think that if you did this into vJass it would make the code more efficient than mine?

In some aspects yes, you say constant functions are like BJs. But if you used JassHelper, you could declare globals freely and therefore less calls to these "BJs".

Constant functions are like BJ's. And i heard you guys hate BJ's.

Not all BJs are useless, seeing as constant functions offer easier configuration.

--

GetWidgetLife(u)<1 - Isn't it 0.415? Or something.
 
Level 7
Joined
Jun 6, 2010
Messages
224
No disrespect but

Yes. Of course compiled vJass is messy, it's arrays and crap everywhere. But the point is we work with vJass, uncompiled, much more readable.


Why the heck would READABLE be better than more EFFICIENT??
T_T' :cry:

I'm good with vJass but i simply stopped using it because it became very heavy on my AOS map making the map script 1.2mb in size which is unacceptable.

JASS is way more efficient if you know how to use it.
Also as you noticed all i use is one single variable called Hashtable.
And i can keep using that single variable for every single spell i can make in the future.

imagine a map with only one single global variable.
But again let's not go so far. Hashtables have a limit of instances and all pro-coders know it.

nvm... I'll just fix the "ugly" lightning that you stated above.
But still i must wait for a moderators comment if they want me to use Constant function for better "Readability"

And yea, some BJ's are useful. But still calling a function that calls many others is less efficient.
 
Level 31
Joined
May 3, 2008
Messages
3,155
It shouldn't be the user who has to scan through [messy] code to configure it.

it is indeed a bit messy to be read, but at least it was still readable. But you are right at this part. It is the responsibility for the coder to do it. :p

Let me tell you, you're wrong. This is the most efficient way that a spell can work. Constant functions are like BJ's. And i heard you guys hate BJ's.

QFT = Not all BJs are useless

Both party are right actually.

One are references to efficiency while the other are refer to user-friendly.

Prince Zero, you could eventually make 2 trigger of it with either 1 of it disable. Then post a documentation indicate 1 to be better in term of efficiency while the other as user-friendly.

Your code leaks alot. Don't say it doesn't. It leaks because you don't null local handles. Like orb and stuff.

Main reason why it won't approve.

I did't see you null it either, or the code might be too messy that i did't notice it.
 
Level 15
Joined
Jul 6, 2009
Messages
889
Rather than having the user make their own variables, maybe you should create a disabled trigger in the map for them to copy than delete. Also tell them to have Automatically create unknown variables when pasting trigger data turned on.

Can't stress enough on making things user friendly.

Why the heck would READABLE be better than more EFFICIENT??

Hm. I kind of mean't to put READABLE combined with CONFIGURABLE.
 
Level 7
Joined
Jun 6, 2010
Messages
224
There you go
Fancy looking lightnings that shine shiny shinelights
And a bit of code improvements.
• Your code leaks alot. Don't say it doesn't. It leaks because you don't null local handles. Like orb and stuff.

Are you sure you're a coder?
Define "Leaks a lot"

Because where i studied c++ i was tought that local handles are automatically cleaned up when the function/method exits.

Also i tested your leaking statement by opening task manager.
Not even a single kilobyte was leaked.
You don't even know what leaks are.
 
Level 15
Joined
Jul 6, 2009
Messages
889
NO I WONT USE GLOBAL Blocks from vJASS

Uhm. Global blocks are not vJass. It's a part of JassHelper features. But I get you, "I don't want dependency on a compiler" :(

Are you sure you're a coder?
Define "Leaks a lot"

Because where i studied c++ i was tought that local handles are automatically cleaned up when the function/method exits.

Not in JASS. I'm not a coder, I just know JASS. I've been taught and memorized these things - and am just passing on my knowledge*.

So for all these you declare locally:
• unit
• group
• lightning

You must set to null afterwards. Although I see you are nulling in some functions, and then in none? o_O?

* which requires citation a lot of the time

Also i tested your leaking statement by opening task manager.
Not even a single kilobyte was leaked.
You don't even know what leaks are.

http://www.wc3c.net/showthread.php?t=81872&highlight=local+leak ;|
http://www.wc3c.net/showpost.php?p=1125190&postcount=3
http://www.wc3c.net/showpost.php?p=905121&postcount=8

Are you sure? I made an demo script that declared a local unit and didn't null it. Guess what happened when I kept running that script?

--

• You forgot to remove the Food Usage of the dummy unit. I was spamming your skill and suddenly got Low Upkeep D:
 
Last edited:
Level 7
Joined
Jun 6, 2010
Messages
224
Bah you surely are a tough guy.
Too bad i can't debate this any longer because i have to go to work.
Oh well, see ya

P.S. You don't have to give credits t me if you wanna use this.
Just use it, study it, i don't care. Just helping new people to learn something.
 
Level 7
Joined
Jun 6, 2010
Messages
224
Locals leak like variables.
That means, Items - Groups - Locations - Effects.
Units don't leak. But they can cause your spell/system to fail.

Besides, Jass is better than vJass.
vJass is for babies.

a local unit referrance does not leak or cause anything at all.
And i didn't leak any location group, it's pretty obvious. Check the damn code!

And yea, vJass is for cry babies.
In the end, everything is Jass
GUI = JASS
vJASS = JASS
cJASS = JASS
 
Level 7
Joined
Oct 11, 2008
Messages
304
JASS:
function RedRift_AdditionalEffects takes unit c, unit victim returns nothing
    local unit dummy
    set dummy = CreateUnit(GetOwningPlayer(c), DUMMY_ID, GetUnitX(victim), GetUnitY(victim), 0)
endfunction


can be


JASS:
function RedRift_AdditionalEffects takes unit c, unit victim returns nothing
    local unit dummy = CreateUnit(GetOwningPlayer(c), DUMMY_ID, GetUnitX(victim), GetUnitY(victim), 0)
endfunction
 
Level 7
Joined
Jun 6, 2010
Messages
224
JASS:
function RedRift_AdditionalEffects takes unit c, unit victim returns nothing
    local unit dummy
    set dummy = CreateUnit(GetOwningPlayer(c), DUMMY_ID, GetUnitX(victim), GetUnitY(victim), 0)
endfunction


can be


JASS:
function RedRift_AdditionalEffects takes unit c, unit victim returns nothing
    local unit dummy = CreateUnit(GetOwningPlayer(c), DUMMY_ID, GetUnitX(victim), GetUnitY(victim), 0)
endfunction

i know, that's just an example of how new users can make their own custom effects upon the ability.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
a local unit referrance does not leak or cause anything at all.

Leaks an integer (the pointer). The pointer doesn't get recycled until it's nulled. When it goes out of scope, it isn't nulled until the var is reused. I'm not sure that these variables ever get reused if they have a pointer in them. This means that it can also leak an entire integer var ;o.

Then again, I'm also not sure how wc3 handles its memory allocation/deallocation. What I think it probably does is continues to allocate memory and then recycles the already allocate memory. If a variable has a pointer in it that isn't nulled, I don't think that variable gets recycled, meaning that it is just floating there.

This is all speculation at this point because there is no way for me to know without reading the memory addresses that wc3 uses while performing a test ; P.


Furthermore, you need to change your attitude about vjass and cjass and all of the other precompilers out there. You know what programming languages are? They are precompilers for assembly ; |, which translates to direct machine code, which in turn translates into direct bytecode ; |.

When a language is compiled, it's just parsed and translated into bytecode/assembly/machine code

Also if you use vjass correctly, it has no overhead ^.^. I don't know about you, but I prefer vJASS features and syntax over plain old JASS.
 
Level 7
Joined
Jun 6, 2010
Messages
224
Leaks an integer (the pointer). The pointer doesn't get recycled until it's nulled. When it goes out of scope, it isn't nulled until the var is reused. I'm not sure that these variables ever get reused if they have a pointer in them. This means that it can also leak an entire integer var ;o.

Then again, I'm also not sure how wc3 handles its memory allocation/deallocation. What I think it probably does is continues to allocate memory and then recycles the already allocate memory. If a variable has a pointer in it that isn't nulled, I don't think that variable gets recycled, meaning that it is just floating there.

This is all speculation at this point because there is no way for me to know without reading the memory addresses that wc3 uses while performing a test ; P.


Furthermore, you need to change your attitude about vjass and cjass and all of the other precompilers out there. You know what programming languages are? They are precompilers for assembly ; |, which translates to direct machine code, which in turn translates into direct bytecode ; |.

When a language is compiled, it's just parsed and translated into bytecode/assembly/machine code

Also if you use vjass correctly, it has no overhead ^.^. I don't know about you, but I prefer vJASS features and syntax over plain old JASS.


don't mind an old fool like me, i'm just old school ;)
 
Top