There's 2 major issues in this function.
The first is "bj_forLoopAIndex" is a global and doesn't need to be passed to the function in order to access it.
The second problem is, "GetTriggerPlayer()". It's an event response (Meaning that in order for it to work, the function is an actionfunc that TAKES NO VALUE).
Basically, this can be fixed by doing this: function hec7 takes nothing returns nothing
>> JASS/GUI requests/questions in here <<
Moderator: Cheaters
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: >> JASS/GUI requests/questions in here <<
Code: Select all
function wait1 takes player p7 returns nothing
loop
call TriggerSleepAction(2)
endloop
endfunction
function wait2 takes player p7 returns nothing
loop
call TriggerSleepAction(2)
endloop
endfunction
==========================
function takes nothing returns nothing
call wait1(Player(1))
call wait2(Player(2))
endfunction
I want to call both function wait1 and wait2, in ONE action. Yet since wait1 is actually looping and won't return, so wait2 will not be called, ever.
Is there anyway I can call both function wait1 and wait2, even though a function is looping.
I tried
ExecuteFunc(wait1)
ExecuteFunc(wait2)
but since they can't bring p7 to another function, so what's solution? (beside calling them seperately in 2 function actions.)
PLease help. Thanks
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: >> JASS/GUI requests/questions in here <<
Tell me what you're trying to do.
And second, what's the point of passing a player variable to a wait function.
And second, what's the point of passing a player variable to a wait function.
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: >> JASS/GUI requests/questions in here <<
hm....
lol...
It's a simplify version of what I am doing.
It's just pressing an arrow key, let's say Up key, it execute both let's say, -mh and -cdon commands.
Of course I can run 2 triggers so that both of those commands will work. But that's what I am trying too avoid. Too much triggers will lag too much I think.
hm...
If there is nothing can be done, let it be. I think it can be fixed by using more globals triggers, but...w/e I don't really want that.
actually JASS has its limits too. I actually planning on making the bindkey able to bind command such as -mhoff and such. It's possible, but it required too at least one more global and it also slow down the whole system.
I am not a guy persuing perfectnism so, w/e.
Question:
always wanted to ask but forgot. How many maximum buttons can one menu have?
It's around 11-13, I just can't be sure. Can you confirm it for me?
lol...
It's a simplify version of what I am doing.
It's just pressing an arrow key, let's say Up key, it execute both let's say, -mh and -cdon commands.
Of course I can run 2 triggers so that both of those commands will work. But that's what I am trying too avoid. Too much triggers will lag too much I think.
hm...
If there is nothing can be done, let it be. I think it can be fixed by using more globals triggers, but...w/e I don't really want that.
actually JASS has its limits too. I actually planning on making the bindkey able to bind command such as -mhoff and such. It's possible, but it required too at least one more global and it also slow down the whole system.
I am not a guy persuing perfectnism so, w/e.
Question:
always wanted to ask but forgot. How many maximum buttons can one menu have?
It's around 11-13, I just can't be sure. Can you confirm it for me?
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: >> JASS/GUI requests/questions in here <<
I doubt you could make it really laggy that way; depends on the cheat. Mass unit creation would lag.
As for dialog button, I think it's around 10 or 11.
As for dialog button, I think it's around 10 or 11.
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: >> JASS/GUI requests/questions in here <<
can you show me the simplest way to make a player descyn(disconnected from other player)? I realise that net traffic under "if getlocalplayer==player i thren" will do the job. But waht's the simplest way?
-
- Newcomer
- Posts: 16
- Joined: May 12th, 2007, 11:26 am
Re: >> JASS/GUI requests/questions in here <<
i have a question...what do the triggers below do in JJ's CP??
Code: Select all
function Str2RAW takes string s2s returns integer
return S2RAW[s2i(SubString(s2s,0,1))]*0x1000000+S2RAW[s2i(SubString(s2s,1,2))]*0x10000+S2RAW[s2i(SubString(s2s,2,3))]*0x100+S2RAW[s2i(SubString(s2s,3,4))]
endfunction
function RAW2Str takes integer I2I,player p2p returns nothing
local string s2s
set s2s=S2RAWa[I2I/0x1000000]+S2RAWa[(I2I-0x1000000*(I2I/0x1000000))/0x10000]+S2RAWa[((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))/0x100]+S2RAWa[((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))-0x100*(((I2I-0x1000000*(I2I/0x1000000))-0x10000*((I2I-0x1000000*(I2I/0x1000000))/0x10000))/0x100)]
call DisplayTextToPlayer(p2p,0,0,s2s)
endfunction
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: >> JASS/GUI requests/questions in here <<
convert a string to RaW code and vice versa.
you didn't get the whole thing. The codes you pasted is just a part of it. It also required some functions which convert id to RaW.
you didn't get the whole thing. The codes you pasted is just a part of it. It also required some functions which convert id to RaW.
-
- Newcomer
- Posts: 16
- Joined: May 12th, 2007, 11:26 am
Re: >> JASS/GUI requests/questions in here <<
i know its just a part of it....i cant understand this part
-
- Senior Member
- Posts: 136
- Joined: June 9th, 2007, 11:27 pm
- Location: Indonesia
Re: >> JASS/GUI requests/questions in here <<
question : are there any mistakes??
syntax checker said "line 1:syntax error" , "line 5 :undeclared variable i" and "line 6:undeclared variable tmp1"
syntax checker said "line 1:syntax error" , "line 5 :undeclared variable i" and "line 6:undeclared variable tmp1"
Code: Select all
function Trig_Mul_Actions takes nothing returns nothing
integer tmp1
integer i
if ( GetSpellAbilityId() == 'A000' ) then
set i = 1
set tmp1 = GetUnitAbilityLevel(GetTriggerUnit(),GetSpellAbilityId()) + 1
call PauseUnit(GetTriggerUnit(),true)
call PauseUnit(GetSpellTargetUnit(),true)
loop
call TriggerSleepAction(0.4)
set i=i+1
exitwhen i>tmp1
call SetUnitAnimation(GetTriggerUnit(),"attack2")
call SetUnitAnimation(GetSpellTargetUnit(),"death")
call DamageUnitByTypes(GetTriggerUnit(),GetSpellTargetUnit(),GetHeroAgi(GetTriggerUnit(),true),ATTACK_TYPE_HERO,DAMAGE_TYPE_FIRE)
endloop
call PauseUnit(GetTriggerUnit(),false)
call PauseUnit(GetSpellTargetUnit(),false)
endif
endfunction
