- Joined
- May 1, 2008
- Messages
- 1,605
Seas =)
Jeah I remember post of this but after fail searching with search function I decide to make a new topic about this.
Yes the "If Then Else" in Jass is for me totally complicated. So if you know the answers, please explain it, that even a Jass beginner ( me ) can understand it <-- Thanks!
1)
What does this trigger do?
- If a unit ( Hero ( checked in the conditions )) dies, the unit should remove the unit after 5.00 seconds ( works in GUI/Jass )
Now my Questions:
1) At the 1st line you see "..... Trig_Hero_Death_Jass_Func002C ....". What is this "Func002C"? and can I change it?
2) I don't remember if the following is correct, but somehow I remember that this:
can be changed so it's faster - how this? ( I think it was that, if I'm not correct sorry ^^ )
3) Actually can you help me to change this trigger to the normal Jass ( with this "Func002C and so on"
===================== New Jass Trigger - What the hell is this? =====================
I have another trigger that I want to do in Jass. I'm a beginner so I convert normal GUI triggers to Jass that I can get some basic information the I write the trigger completely myself but I got a problem at this:
after I convert it to Jass it looks like:
As you see there are sooooo many If then else in the Jass - and I never will remember all this numbers and everything, so my question is:
Can I change the Jasstrigger that I have all the conditions in one part - or just make the Jasstrigger without all this "If then else" lines?
If someone have some time and could help me would be nice and please! remember to explain what you doing - it has no effect if I just copy it without understanding it =)
Thanks in advanced!
Jeah I remember post of this but after fail searching with search function I decide to make a new topic about this.
Yes the "If Then Else" in Jass is for me totally complicated. So if you know the answers, please explain it, that even a Jass beginner ( me ) can understand it <-- Thanks!
1)
JASS:
function Trig_Hero_Death_Jass_Func002C takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true ) ) then
return false
endif
return true
endfunction
function Trig_Hero_Death_Jass_Actions takes nothing returns nothing
if ( Trig_Hero_Death_Jass_Func002C() ) then
call TriggerSleepAction( 5.00 )
call RemoveUnit( GetTriggerUnit() )
else
endif
endfunction
//===========================================================================
function InitTrig_Hero_Death_Jass takes nothing returns nothing
set gg_trg_Hero_Death_Jass = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hero_Death_Jass, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Hero_Death_Jass, function Trig_Hero_Death_Jass_Actions )
endfunction
What does this trigger do?
- If a unit ( Hero ( checked in the conditions )) dies, the unit should remove the unit after 5.00 seconds ( works in GUI/Jass )
Now my Questions:
1) At the 1st line you see "..... Trig_Hero_Death_Jass_Func002C ....". What is this "Func002C"? and can I change it?
2) I don't remember if the following is correct, but somehow I remember that this:
JASS:
return false
endif
return true
endfunction
3) Actually can you help me to change this trigger to the normal Jass ( with this "Func002C and so on"
===================== New Jass Trigger - What the hell is this? =====================
I have another trigger that I want to do in Jass. I'm a beginner so I convert normal GUI triggers to Jass that I can get some basic information the I write the trigger completely myself but I got a problem at this:
-
Unit Death
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of Hamburg 0076 <gen>) Not equal to Player 12 (Brown)
-
(Owner of Munich 0204 <gen>) Not equal to Player 12 (Brown)
-
(Owner of Berlin 0032 <gen>) Not equal to Player 12 (Brown)
-
(Owner of Vienna 0017 <gen>) Not equal to Player 11 (Dark Green)
-
(Owner of Budapest 0031 <gen>) Not equal to Player 11 (Dark Green)
-
(Owner of Prague 0029 <gen>) Not equal to Player 11 (Dark Green)
-
(Owner of Sarajevo 0030 <gen>) Not equal to Player 11 (Dark Green)
-
(Owner of East Instanbul 0010 <gen>) Not equal to Player 5 (Yellow)
-
(Owner of West Istanbul 0013 <gen>) Not equal to Player 5 (Yellow)
-
(Owner of Sofia 0019 <gen>) Not equal to Player 8 (Pink)
-
-
Then - Actions
-
Game - Display to (All players) the text: The allies have ach...
-
Trigger - Run Ally unally cmds <gen> (checking conditions)
-
Trigger - Turn off USA to GB <gen>
-
Trigger - Turn off Unit Death <gen>
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Owner of Paris 0002 <gen>) Not equal to Player 4 (Purple)
-
(Owner of Algiers 0027 <gen>) Not equal to Player 4 (Purple)
-
(Owner of London 0015 <gen>) Not equal to Player 3 (Teal)
-
(Owner of Dublin 0028 <gen>) Not equal to Player 3 (Teal)
-
(Owner of Alexandria 0119 <gen>) Not equal to Player 3 (Teal)
-
(Owner of Rome 0014 <gen>) Not equal to Player 7 (Green)
-
(Owner of Brussels 0009 <gen>) Not equal to Player 2 (Blue)
-
(Owner of Moscow 0012 <gen>) Not equal to Player 1 (Red)
-
(Owner of St. Petersburg 0026 <gen>) Not equal to Player 1 (Red)
-
(Owner of Warsaw 0079 <gen>) Not equal to Player 1 (Red)
-
(Owner of Belgrade 0018 <gen>) Not equal to Player 6 (Orange)
-
-
Then - Actions
-
Game - Display to (All players) the text: The central powers ...
-
Trigger - Run Ally unally cmds <gen> (checking conditions)
-
Trigger - Turn off USA to GB <gen>
-
Trigger - Turn off Unit Death <gen>
-
-
Else - Actions
-
-
-
JASS:
function Trig_Unit_Death_Jass_Func001C takes nothing returns boolean
if ( not ( GetOwningPlayer(gg_unit_h01U_0076) != Player(11) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00L_0204) != Player(11) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00K_0032) != Player(11) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00M_0017) != Player(10) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h01T_0031) != Player(10) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00N_0029) != Player(10) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00O_0030) != Player(10) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00V_0010) != Player(4) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h011_0013) != Player(4) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h004_0019) != Player(7) ) ) then
return false
endif
return true
endfunction
function Trig_Unit_Death_Jass_Func002C takes nothing returns boolean
if ( not ( GetOwningPlayer(gg_unit_h00R_0002) != Player(3) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h010_0027) != Player(3) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00U_0015) != Player(2) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00P_0028) != Player(2) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00Q_0119) != Player(2) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00Z_0014) != Player(6) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h044_0009) != Player(1) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00T_0012) != Player(0) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00S_0026) != Player(0) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h01V_0079) != Player(0) ) ) then
return false
endif
if ( not ( GetOwningPlayer(gg_unit_h00X_0018) != Player(5) ) ) then
return false
endif
return true
endfunction
function Trig_Unit_Death_Jass_Actions takes nothing returns nothing
if ( Trig_Unit_Death_Jass_Func001C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2605" )
call ConditionalTriggerExecute( gg_trg_Ally_unally_cmds )
call DisableTrigger( gg_trg_USA_to_GB )
call DisableTrigger( gg_trg_Unit_Death )
else
endif
if ( Trig_Unit_Death_Jass_Func002C() ) then
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_2606" )
call ConditionalTriggerExecute( gg_trg_Ally_unally_cmds )
call DisableTrigger( gg_trg_USA_to_GB )
call DisableTrigger( gg_trg_Unit_Death )
else
endif
endfunction
//===========================================================================
function InitTrig_Unit_Death_Jass takes nothing returns nothing
set gg_trg_Unit_Death_Jass = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_Death_Jass, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddAction( gg_trg_Unit_Death_Jass, function Trig_Unit_Death_Jass_Actions )
endfunction
As you see there are sooooo many If then else in the Jass - and I never will remember all this numbers and everything, so my question is:
Can I change the Jasstrigger that I have all the conditions in one part - or just make the Jasstrigger without all this "If then else" lines?
If someone have some time and could help me would be nice and please! remember to explain what you doing - it has no effect if I just copy it without understanding it =)
Thanks in advanced!