 |
WC3Jass.com "The Jass Vault"
|
Affiliates
|
|
|
| Message |
Posted:
Wed Dec 20, 2006 9:27 pm Post subject:
|
|
|
Let me try and rewrite the code for you:
| Code: |
// From inv100
call ExecuteFunc(get_session_param("fs_module") + "_ClickHandler")
// Re-written, but still the same
local string funcName = get_session_param("fs_module") + "_ClickHandler"
call ExecuteFunc( funcName )
|
get_session_param is just a function that returns a string. For example, let's say it returns "Foo". Then funcName = "Foo" + "_ClickHandler" = "Foo_ClickHandler". ExecuteFunc then calls the function called "Foo_ClickHandler" with no parameters. You can build the string however you like, but it does not affect how the function is called, only what function is called. |
|
|
|
 |
|
|
|
| Message |
Posted:
Wed Dec 20, 2006 9:28 pm Post subject:
|
|
|
| ok, so would you like me to delete the inv100 file or is it ok? |
|
|
|
 |
|
|
|
| Message |
Posted:
Wed Dec 20, 2006 9:49 pm Post subject:
|
|
|
| No no don't worry about that. |
|
|
|
 |
|
|
|
| Message |
Posted:
Thu Dec 21, 2006 2:32 am Post subject:
|
|
|
*bump* my questions?  |
|
|
|
 |
|
|
|
| Message |
Posted:
Thu Dec 21, 2006 10:15 am Post subject:
|
|
|
Hehe, sorry Purple.
| Quote: |
| A) Does that mean that functions like GetEnumUnit() and GetTriggerUnit() are passed through when creating a new thread? |
Yes.
| Quote: |
| B) Can you pass local variables in some manner or other as well? |
You can use global variables to pass them over, or you can put them in a game cache. See the Jump script and the comments where I explained how to do it with bj_ globals. |
|
|
|
 |
|
|
|
| Message |
Posted:
Wed Jan 10, 2007 1:13 pm Post subject:
|
|
|
Aight, late answer, but thanks
I know about GCs already, but they're so damn slow that I was *hoping* for an alternative
And I personally try to avoid BJ globals as much as possible, since whenever I tend to make maps I tend to do them with someone else, and if that person uses any triggers [GUI] with Get Last Created Unit, etc, in them, they map have unforseen consequences  |
|
|
|
 |
|
 |
|
 |
 |
|
 |
|
|
| Message |
Posted:
Wed Jan 10, 2007 7:44 pm Post subject:
|
|
|
There is many bj_ globals that are only for temporary use or arrays where all indexes are never used.
Unit -> array bj_ghoul
People usually use index 100 but just anything that size and above is safe.
Integer -> bj_groupCountUnits
and more.
String -> I don't know if there is any safe to use strings but if you need one then you can do this:
| Code: |
local string temp = bj_lastPlayedMusic
call ExecuteFunc("DoNothing")
set bj_lastPlayedMusic = temp
|
group -> bj_groupAddGroupDest
and more.
And so on. Look in blizzard.j for more variables. |
|
|
|
 |
|
 |
|
 |
 |
|
 |
|
|
| Message |
Posted:
Mon Apr 16, 2007 5:58 pm Post subject:
|
|
|
So that way event responses can be used from another function? Cool..........uhmm, I didn't understand the part about TriggerSleepAction, so when I have this:
| Code: |
function DisplayText takes nothing returns nothing
call TriggerSleepAction(2)
call BJDebugMsg("hi")
endfunction
function CallingFunc takes nothing returns nothing
call ExecuteFunc("DisplayText")
call BJDebugMsg("hello")
endfunction
|
"hello" will display before "hi"? _________________ To much JASS for me........ |
|
|
|
 |
|
|
|
| Message |
Posted:
Mon Apr 16, 2007 9:56 pm Post subject:
|
|
|
That's right. Though I thought you said you didn't understand it  |
|
|
|
 |
|
|
|
| Message |
Posted:
Tue Jul 24, 2007 3:18 pm Post subject:
|
|
|
Hmm, can I use timers with this? IE:
| Code: |
function TimerBlah takes nothing returns nothing
// ...whatever stuff...
endfunction
function TimerInit takes nothing returns nothing
local unit u=GetEnumUnit()
local timer t=CreateTimer()
call SetHandleHandle(t,"unit",u)
call TimerStart(t,0.1,true,function TimerBlah)
set u=null
endfunction
function ExecTimer takes nothing returns nothing
call ExecuteFunc(TimerInit)
endfunction
function GroupSkill takes group g returns nothing
call ForGroup(g,function ExecTimer)
call DestroyGroup(g)
set g=null
endfunction
|
It didn't work when I tried... Sorry if I'm noob. Please help lol. |
|
|
|
 |
|
|
|
| Message |
Posted:
Tue Jul 24, 2007 3:19 pm Post subject:
|
|
|
| Oops I forgot to add the quotes in the ExecuteFunc, but that doesn't matter, they're in my real script... Should it work? |
|
|
|
 |
|
|
|
| Message |
Posted:
Thu Jul 26, 2007 5:08 pm Post subject:
|
|
|
Can't anyone tell me if it's possible to use this along with timers??
Right now I'm using sloppy TriggerSleepActions... they work but they are slow and not precise.. |
|
|
|
 |
|
|
|
| Message |
Posted:
Thu Jul 26, 2007 5:30 pm Post subject:
|
|
|
| I see nothing wrong with the code you posted, apart from the missing quotes you mentioned yourself. But it's a crude example too, since you might as well replace ExecuteFunc("TimerInit") with call TimerInit(), and it should do the same thing. If your code doesn't work, something else must be wrong. |
|
|
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|