- Joined
- May 2, 2005
- Messages
- 9
Making an rpg and been working on it for quite some time. I dont have any saving triggers or anything like that. Now What I need help with is only 3 things.
1)No 1 player mode.
2)Saving triggers, how to make my own, simplified.
3)And mainly making a better respawning trigger.
What i have so far.
1 player mode trigger i have so far. (knowing that it doesnt work atm, just need to improve it.) *I know I can make it work if some1 is player 1 and I can get it to work, but I wana know another way for future reference.
And respawning trigger I have right now. (Made each unit seperatly and basically they dont drop any items.)
1)No 1 player mode.
2)Saving triggers, how to make my own, simplified.
3)And mainly making a better respawning trigger.
What i have so far.
1 player mode trigger i have so far. (knowing that it doesnt work atm, just need to improve it.) *I know I can make it work if some1 is player 1 and I can get it to work, but I wana know another way for future reference.
Code:
function Trig_No_1_Player_Func001Func001Func009Func001C takes nothing returns boolean
if ( ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(1)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(2)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(3)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(4)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(5)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(6)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(7)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
return false
endfunction
function Trig_No_1_Player_Func001Func001Func009C takes nothing returns boolean
if ( not Trig_No_1_Player_Func001Func001Func009Func001C() ) then
return false
endif
return true
endfunction
function Trig_No_1_Player_Func001Func001C takes nothing returns boolean
if ( ( GetPlayerSlotState(Player(0)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(1)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(2)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(3)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(4)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(5)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(6)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( ( GetPlayerSlotState(Player(7)) == PLAYER_SLOT_STATE_PLAYING ) ) then
return true
endif
if ( Trig_No_1_Player_Func001Func001Func009C() ) then
return true
endif
return false
endfunction
function Trig_No_1_Player_Func001C takes nothing returns boolean
if ( not Trig_No_1_Player_Func001Func001C() ) then
return false
endif
return true
endfunction
function Trig_No_1_Player_Actions takes nothing returns nothing
if ( Trig_No_1_Player_Func001C() ) then
call DisableTrigger( GetTriggeringTrigger() )
else
call CustomDefeatBJ( Player(0), "TRIGSTR_121" )
call CustomDefeatBJ( Player(1), "TRIGSTR_122" )
call CustomDefeatBJ( Player(2), "TRIGSTR_123" )
call CustomDefeatBJ( Player(3), "TRIGSTR_124" )
endif
endfunction
//===========================================================================
function InitTrig_No_1_Player takes nothing returns nothing
set gg_trg_No_1_Player = CreateTrigger( )
call DisableTrigger( gg_trg_No_1_Player )
call TriggerAddAction( gg_trg_No_1_Player, function Trig_No_1_Player_Actions )
endfunction
And respawning trigger I have right now. (Made each unit seperatly and basically they dont drop any items.)
Code:
function Trig_Respawn_Conditions takes nothing returns boolean
if ( not ( GetOwningPlayer(GetDyingUnit()) == Player(PLAYER_NEUTRAL_AGGRESSIVE) ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'hfoo' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func002C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'ngno' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func003C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'n002' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func004C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nnmg' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func005C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nggr' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func006C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nhyc' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func007C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nnrg' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func008C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nmyr' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func009C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nnsw' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func010C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'nsnp' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func011C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'h000' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func012Func001Func005001 takes nothing returns boolean
return ( GetUnitTypeId(GetDyingUnit()) == 'Hblm' )
endfunction
function Trig_Respawn_Func012Func001Func005002 takes nothing returns boolean
return ( I2S(GetHeroLevel(GetDyingUnit())) == "1" )
endfunction
function Trig_Respawn_Func012Func001C takes nothing returns boolean
if ( not GetBooleanAnd( Trig_Respawn_Func012Func001Func005001(), Trig_Respawn_Func012Func001Func005002() ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func012Func002Func007001 takes nothing returns boolean
return ( GetUnitTypeId(GetDyingUnit()) == 'Hblm' )
endfunction
function Trig_Respawn_Func012Func002Func007002 takes nothing returns boolean
return ( I2S(GetHeroLevel(GetDyingUnit())) == "2" )
endfunction
function Trig_Respawn_Func012Func002C takes nothing returns boolean
if ( not GetBooleanAnd( Trig_Respawn_Func012Func002Func007001(), Trig_Respawn_Func012Func002Func007002() ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func012Func003Func006001 takes nothing returns boolean
return ( GetUnitTypeId(GetDyingUnit()) == 'Hblm' )
endfunction
function Trig_Respawn_Func012Func003Func006002 takes nothing returns boolean
return ( I2S(GetHeroLevel(GetDyingUnit())) == "3" )
endfunction
function Trig_Respawn_Func012Func003C takes nothing returns boolean
if ( not GetBooleanAnd( Trig_Respawn_Func012Func003Func006001(), Trig_Respawn_Func012Func003Func006002() ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func012Func004Func006001 takes nothing returns boolean
return ( GetUnitTypeId(GetDyingUnit()) == 'Hblm' )
endfunction
function Trig_Respawn_Func012Func004Func006002 takes nothing returns boolean
return ( I2S(GetHeroLevel(GetDyingUnit())) == "4" )
endfunction
function Trig_Respawn_Func012Func004C takes nothing returns boolean
if ( not GetBooleanAnd( Trig_Respawn_Func012Func004Func006001(), Trig_Respawn_Func012Func004Func006002() ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func012Func005Func004001 takes nothing returns boolean
return ( GetUnitTypeId(GetDyingUnit()) == 'Hblm' )
endfunction
function Trig_Respawn_Func012Func005Func004002 takes nothing returns boolean
return ( I2S(GetHeroLevel(GetDyingUnit())) == "5" )
endfunction
function Trig_Respawn_Func012Func005C takes nothing returns boolean
if ( not GetBooleanAnd( Trig_Respawn_Func012Func005Func004001(), Trig_Respawn_Func012Func005Func004002() ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Func012C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetDyingUnit()) == 'Hblm' ) ) then
return false
endif
return true
endfunction
function Trig_Respawn_Actions takes nothing returns nothing
if ( Trig_Respawn_Func001C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'hfoo', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_000), GetUnitLoc(GetAttacker()) )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func002C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'ngno', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_006), GetUnitLoc(GetAttacker()) )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func003C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'n002', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_008), GetUnitLoc(GetAttacker()) )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func004C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'nnmg', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_011), GetUnitLoc(GetAttacker()) )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func005C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'nggr', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_007), GetUnitLoc(GetAttacker()) )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func006C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'nhyc', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_012), GetUnitLoc(GetAttacker()) )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func007C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLoc( 1, 'nnrg', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRectCenter(gg_rct_Region_014), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func008C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLoc( 1, 'nmyr', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_013), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func009C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLoc( 1, 'nnsw', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_013), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func010C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLoc( 1, 'nsnp', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_013), bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func011C() ) then
call TriggerSleepAction( 10.00 )
call CreateNUnitsAtLocFacingLocBJ( 1, 'h000', Player(PLAYER_NEUTRAL_AGGRESSIVE), GetRandomLocInRect(gg_rct_Region_002), GetUnitLoc(GetAttacker()) )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func012C() ) then
if ( Trig_Respawn_Func012Func001C() ) then
call TriggerSleepAction( 10.00 )
call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(gg_rct_Region_001), true )
call SetHeroLevelBJ( GetDyingUnit(), ( GetHeroLevel(GetDyingUnit()) + 1 ), true )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func012Func002C() ) then
call TriggerSleepAction( 10.00 )
call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(gg_rct_Region_001), true )
call SetHeroLevelBJ( GetDyingUnit(), ( GetHeroLevel(GetDyingUnit()) + 1 ), true )
call SelectHeroSkill( GetDyingUnit(), 'AHfs' )
call SelectHeroSkill( GetDyingUnit(), 'AHbn' )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func012Func003C() ) then
call TriggerSleepAction( 10.00 )
call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(gg_rct_Region_001), true )
call SetHeroLevelBJ( GetDyingUnit(), ( GetHeroLevel(GetDyingUnit()) + 1 ), true )
call SelectHeroSkill( GetDyingUnit(), 'AHdr' )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func012Func004C() ) then
call TriggerSleepAction( 10.00 )
call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(gg_rct_Region_001), true )
call SetHeroLevelBJ( GetDyingUnit(), ( GetHeroLevel(GetDyingUnit()) + 1 ), true )
call SelectHeroSkill( GetDyingUnit(), 'AHfs' )
else
call DoNothing( )
endif
if ( Trig_Respawn_Func012Func005C() ) then
call TriggerSleepAction( 10.00 )
call ReviveHeroLoc( GetDyingUnit(), GetRectCenter(gg_rct_Region_001), true )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
endfunction
//===========================================================================
function InitTrig_Respawn takes nothing returns nothing
set gg_trg_Respawn = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Respawn, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Respawn, Condition( function Trig_Respawn_Conditions ) )
call TriggerAddAction( gg_trg_Respawn, function Trig_Respawn_Actions )
endfunction