(Keeps Hive Alive)
Go Back   The Hive Workshop - A Warcraft III Modding Site > Warcraft III Resources > Submissions

Submissions Submit JASS resources! If approved, they will be moved to their proper section.
Please read me first.

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-25-2008, 10:56 AM   #1 (permalink)
 
Anachron's Avatar

You are never right
 
Join Date: Sep 2007
Posts: 1,479

Anachron will become famous soon enough (105)Anachron will become famous soon enough (105)Anachron will become famous soon enough (105)


Loop Helper System

##############################################
---------Advanced Loop System by Anachron (dhk_undead_lord) ---
--------------------------ALPHA RELEASE-------------------------
##############################################

INDEX
1. What this system does.
2. How this system works.
3. How to use.
4. Misc

::::::::::1 - WHAT THIS SYSTEM DOES::::::::::::

This system allows you to create loops with waittime of 0.3 AND less.
Its thought for jass noobs which are not be able to use handle funcs and gamecaches.

::::::::::::2 - HOW THIS SYSTEM WORKS::::::::::::

You need JASS NEW GEN PACK ( JNGP ) to this to work proberly.

All you need is to force a start of my system (FORCE START TRIGGER) and to order to create a new timeevent based
function (ADD EVENT).


::::::::::::3- HOW TO USE::::::::::::
Well all you need is to create new function with whatever you want.

Example from me was ''function test takes nothing returns nothing''.

You can use any function you want here.
::::::::::::4- MISC::::::::::::
This system has been made by Anachron (dhk_undead_lord).
This system requires JNGP.
This is the ALPHA version.

Thank you for using my system! - Give credits plz


Map Download:
Click here to download
__________________

Last edited by The Administration; Today at 02:08 PM.. Reason: Do not spam, flame, harass and discriminate other users in a such way.


Templar Arena
Preview - Thread

Last edited by Anachron; 06-25-2008 at 01:30 PM..
Anachron is online now  
Old 06-25-2008, 08:16 PM   #2 (permalink)

Anozer jasser
 
Join Date: Apr 2008
Posts: 237

Troll-Brain has little to show at this moment (13)Troll-Brain has little to show at this moment (13)


You should post the code
Troll-Brain is offline  
Old 06-25-2008, 10:16 PM   #3 (permalink)

User
 
Join Date: Nov 2007
Posts: 94

Deaod has little to show at this moment (11)Deaod has little to show at this moment (11)


globals
    // Generated
    trigger gg_trg_Force_Start = null
    trigger gg_trg_Add_Event = null
    real ELAPSED_TIME = 0.01


//JASSHelper struct globals:

endglobals
[...]
//***************************************************************************
//*
//* Custom Script Code
//*
//***************************************************************************
//TESH.scrollpos=66
//TESH.alwaysfold=0

function increase_time_Actions takes nothing returns nothing

local timer t= GetExpiredTimer()
local timer g

    call DestroyTimer(t)

    set ELAPSED_TIME = ELAPSED_TIME + 0.01

    set g = CreateTimer()
    call TimerStart(g , 0.01 , false , function increase_time_Actions)
//call DisplayTextToPlayer(Player(0),0,0, R2S(ELAPSED_TIME))

endfunction


function Loop_System_init_Actions takes nothing returns nothing
local timer g= CreateTimer()

    //call DisplayTextToForce(GetPlayersAll(),"Timerstart!")
call TimerStart(g , 0.01 , false , function increase_time_Actions)

endfunction

//===========================================================================
function Init_Loop_System_init takes nothing returns nothing
    local trigger Loop_System_init= CreateTrigger()
    call TriggerAddAction(Loop_System_init , function Loop_System_init_Actions)
endfunction



function test takes nothing returns nothing
local trigger t= GetTriggeringTrigger()
local unit u
local real x
local real y
local rect r= GetPlayableMapRect()

    set x = GetRectCenterX(r)
set y = GetRectCenterY(r)

    set u = CreateUnit(Player(0) , 'hwat' , x , y , 270)
    call UnitApplyTimedLife(u , '0000' , 0.25)

    call DisplayTextToForce(GetPlayersAll() , R2S(ELAPSED_TIME) + " : A trigger has been executed!")
call DestroyTrigger(t)

endfunction


//===========================================================================
function Init_test takes nothing returns nothing
    local trigger test_init= CreateTrigger()
    call TriggerAddAction(test_init , function test)
endfunction

//#################################################
function ADD_EVENT takes real WhichTime returns trigger
local trigger t= CreateTrigger()
local timer g= CreateTimer()
local real r= 0.00

    set r = WhichTime - ELAPSED_TIME

    call TimerStart(g , r , false , function test)

return t

endfunction
//#################################################

function TEST_ACTIONS takes nothing returns nothing
local integer i= 0

local real r= 0.00
local trigger d

loop
    exitwhen i == 10

    set r = ELAPSED_TIME + 1.25 + ( i * 0.25 )
    call DisplayTextToForce(GetPlayersAll() , "Current time :" + R2S(ELAPSED_TIME))
    call DisplayTextToForce(GetPlayersAll() , "Execution time :" + R2S(r))

    set d = ADD_EVENT(r)

    call TriggerAddAction(d , function test)

    set i = i + 1

endloop

endfunction

//===========================================================================
function TEST_init takes nothing returns nothing
    local trigger TEST= CreateTrigger()
    call TriggerAddAction(TEST , function TEST_ACTIONS)
endfunction



//***************************************************************************
//*
//* Triggers
//*
//***************************************************************************

//===========================================================================
// Trigger: Force Start
//===========================================================================
function Trig_Force_Start_Actions takes nothing returns nothing
    call Loop_System_init_Actions()
endfunction

//===========================================================================
function InitTrig_Force_Start takes nothing returns nothing
    set gg_trg_Force_Start = CreateTrigger()
call TriggerRegisterTimerEventSingle(gg_trg_Force_Start , 0.00)
    call TriggerAddAction(gg_trg_Force_Start , function Trig_Force_Start_Actions)
endfunction

//===========================================================================
// Trigger: Add Event
//===========================================================================
function Trig_Add_Event_Actions takes nothing returns nothing
    call TEST_ACTIONS()
endfunction

//===========================================================================
function InitTrig_Add_Event takes nothing returns nothing
    set gg_trg_Add_Event = CreateTrigger()
    call TriggerRegisterTimerEventSingle(gg_trg_Add_Event , 1.00)
    call TriggerAddAction(gg_trg_Add_Event , function Trig_Add_Event_Actions)
endfunction

//===========================================================================
function InitCustomTriggers takes nothing returns nothing
    call InitTrig_Force_Start()
    call InitTrig_Add_Event()
endfunction

Thats the whole code.

Suggestion: Use ABCT instead. Whatever you are trying to do, let it be and use ABCT.

It's hard to follow the code with no comments at all and no good explanation what to do.
And using JNGP only for globals is a waste of JASSHelper. Use libraries with initializers. And PLEASE use the keywords private and constant.

Last edited by Deaod; 06-29-2008 at 03:11 AM.. Reason: Posted whole Map code.
Deaod is offline  
Old 06-26-2008, 06:09 AM   #4 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,349

PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)

Paired Mapping Contest #4 Winner: Fallen Angel - Lucifer's Keep Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

You don't need a real for elapsed game time.

And if this even works, which I doubt, I don't see how it would help in any way.
PurplePoot is offline  
Old 06-26-2008, 07:04 AM   #5 (permalink)
 
Anachron's Avatar

You are never right
 
Join Date: Sep 2007
Posts: 1,479

Anachron will become famous soon enough (105)Anachron will become famous soon enough (105)Anachron will become famous soon enough (105)


It works please download the map and look how I solved it.
__________________

Last edited by The Administration; Today at 02:08 PM.. Reason: Do not spam, flame, harass and discriminate other users in a such way.


Templar Arena
Preview - Thread
Anachron is online now  
Old 06-26-2008, 04:38 PM   #6 (permalink)

User
 
Join Date: Nov 2007
Posts: 94

Deaod has little to show at this moment (11)Deaod has little to show at this moment (11)


implementing the changes i suggested would help getting this approved.
And as I wrote before, I can't read that code. It's horribly obfuscated, and nothing tells me what you are doing in this specific segment of code.

And why did you paste the system code into the same place as the example's code?

Edit: Ok, i think i figured what hes doing.
- NOT nulling local handle types (--> LEAKS, a _LOT_ of them [at least 100/sec])
- CREATING a new handle every 0.01 seconds (100/sec)
- your handle counter will go up by 100 every second

Verdict: Its basically a custom TriggerRegisterTimerEvent(), though its not hardcoded, thus loosing by far in terms of efficiency. This code is incredibly inefficient (100 NEW Timers per second) and leaking lots of handles (even if they only increase the ref. counter).

Last edited by Deaod; 06-29-2008 at 03:10 AM..
Deaod is offline  
Old 06-28-2008, 02:54 PM   #7 (permalink)

iRawr
 
Join Date: Dec 2005
Posts: 8,349

PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)PurplePoot is a splendid one to behold (807)

Paired Mapping Contest #4 Winner: Fallen Angel - Lucifer's Keep Respected User: This user has been given the respected user award. Map Development Mini-Contest #1 Winner: Stand of the Elements 

All this is is a time counter, it doesn't help people get around waits, judging by the code Deaod posted (I'll have to download the test map). It isn't even done very well for a time counter, and leaks.
PurplePoot is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Terrain-Helper Hoernchen Project Recruitment 4 06-19-2007 12:14 PM
Searchin an helper ZerO.KitChen Map Development 1 09-17-2006 06:46 PM
Wc3 Helper Zoxc Warcraft Editing Tools 0 10-02-2005 04:17 PM
I need a helper Sharp-grass Requests 1 08-02-2005 02:47 PM
Trigger Helper lorothrigs Map Development 4 09-12-2004 07:29 AM

All times are GMT. The time now is 09:33 AM.






Your link here 
Guest house insurance | Buy Anything On eBay | Debt Consolidation | Online Loans | Articles directory
Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Copyright©Ralle