Random starting locations through trigger

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

patrick-the-bomb
Senior Member
Posts: 165
Joined: February 25th, 2008, 2:56 am
Title: Sir Awesome

Random starting locations through trigger

Post by patrick-the-bomb »

Yeah, fucked up.
<--- Super Tard.

Originally wrote -> How do I change the starting locations in Pimp My peon, since they are random, and I want the to not be random.

Part in here has it:
Spoiler:
function Trig_Init_Player_Bases_Func001001001 takes nothing returns boolean
return(GetPlayerSlotState(GetFilterPlayer())==PLAYER_SLOT_STATE_PLAYING)
endfunction

function Trig_Init_Player_Bases_Func001Func008A takes nothing returns nothing
call RemoveDestructable(GetEnumDestructable())
endfunction

function Trig_Init_Player_Bases_Func001A takes nothing returns nothing
set udg_integer01=GetConvertedPlayerId(GetEnumPlayer())
call ForceAddPlayerSimple(GetEnumPlayer(),udg_force01)
call ForceAddPlayerSimple(GetEnumPlayer(),udg_force02)
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_RESOURCE_GOLD,50)
call SetPlayerStateBJ(GetEnumPlayer(),PLAYER_STATE_RESOURCE_LUMBER,75)
call SetPlayerFlagBJ(PLAYER_STATE_GIVES_BOUNTY,true,GetEnumPlayer())
call SetPlayerFlagBJ(PLAYER_STATE_ALLIED_VICTORY,true,GetEnumPlayer())
call EnumDestructablesInCircleBJ(700.00,GetPlayerStartLocationLoc(GetEnumPlayer()),function Trig_Init_Player_Bases_Func001Func008A)
call SetPlayerHandicapXPBJ(GetEnumPlayer(),0.00)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=5
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call CreateNUnitsAtLoc(1,'opeo',GetEnumPlayer(),PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),250.00,(I2R(GetForLoopIndexA())*72.00)),bj_UNIT_FACING)
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call CreateNUnitsAtLoc(1,'otrb',GetEnumPlayer(),GetPlayerStartLocationLoc(GetEnumPlayer()),bj_UNIT_FACING)
set udg_units02[udg_integer01]=GetLastCreatedUnit()
call CreateNUnitsAtLoc(1,'O00V',GetEnumPlayer(),GetPlayerStartLocationLoc(GetEnumPlayer()),bj_UNIT_FACING)
set udg_units01[udg_integer01]=GetLastCreatedUnit()
call CreateNUnitsAtLoc(1,'owtw',GetEnumPlayer(),OffsetLocation(GetPlayerStartLocationLoc(GetEnumPlayer()),448.00,448.00),bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'owtw',GetEnumPlayer(),OffsetLocation(GetPlayerStartLocationLoc(GetEnumPlayer()),448.00,-448.00),bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'owtw',GetEnumPlayer(),OffsetLocation(GetPlayerStartLocationLoc(GetEnumPlayer()),-448.00,448.00),bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'owtw',GetEnumPlayer(),OffsetLocation(GetPlayerStartLocationLoc(GetEnumPlayer()),-448.00,-448.00),bj_UNIT_FACING)
call CreateNUnitsAtLoc(1,'o00J',GetEnumPlayer(),PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),384.00,135.00),bj_UNIT_FACING)
call SetUnitTimeScalePercent(GetLastCreatedUnit(),5.00)
call SetUnitLookAt(GetLastCreatedUnit(),"bone_chest",GetLastCreatedUnit(),20.00,-100.00,90.00)
set bj_forLoopAIndex=1
set bj_forLoopAIndexEnd=3
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(-10.00,10.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(80.00,100.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(170.00,190.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(260.00,280.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(-5.00,5.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(85.00,95.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(175.00,185.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(265.00,275.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call SetCameraFieldForPlayer(GetEnumPlayer(),CAMERA_FIELD_ANGLE_OF_ATTACK,300.00,0.00)
call SetCameraFieldForPlayer(GetEnumPlayer(),CAMERA_FIELD_TARGET_DISTANCE,2000.00,0.00)
endfunction

function Trig_Init_Player_Bases_Actions takes nothing returns nothing
call ForForce(GetPlayersMatching(Condition(function Trig_Init_Player_Bases_Func001001001)),function Trig_Init_Player_Bases_Func001A)
call SetForceAllianceStateBJ(udg_force01,GetPlayersAll(),bj_ALLIANCE_NEUTRAL)
endfunction

Ok, third edit... again...
<--- Super Tard.
Last edited by patrick-the-bomb on December 15th, 2008, 1:48 am, edited 2 times in total.
Chinoman10
Member
Posts: 66
Joined: October 18th, 2008, 4:12 pm
Title: Chinoman10 is here:)
Location: Lisbon, Portugal

Re: Random starting locations through trigger

Post by Chinoman10 »

Just look for the word Random >_>
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(-10.00,10.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(80.00,100.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(170.00,190.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTbs',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),550.00,GetRandomReal(260.00,280.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(-5.00,5.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(85.00,95.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(175.00,185.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))
call CreateDestructableLoc('LTba',PolarProjectionBJ(GetPlayerStartLocationLoc(GetEnumPlayer()),600.00,GetRandomReal(265.00,275.00)),GetRandomDirectionDeg(),GetRandomReal(0.90,1.40),GetRandomInt(1,2))

"RandomInt(1,2)" that's the part... It's at the right >>>>>>>>>>>>>
Image
The Holy Happiness that Love gives, will NEVER compensate the Deep Sadness that it will bring in the End...
Made By: Chinoman10
My advice?: If you desire to be truthfully happy, be in Love, but you'll suffer the consequences... If you don't want to suffer, don't Love... ( It's what I wished... )
[blinking]Respect others to be respected![/blinking]
Click on ChinoMon10 to level him up! ;)
Image_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Image
(Yea, I actually decided to try this :P) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Which Final Fantasy Character Are You?
patrick-the-bomb
Senior Member
Posts: 165
Joined: February 25th, 2008, 2:56 am
Title: Sir Awesome

Re: Random starting locations through trigger

Post by patrick-the-bomb »

^^
Well
I feel like even mroe of an idiot... cuz i was super wrong...


sooo what do I do with that
GetRandomInt(1,2))
part?
Chinoman10
Member
Posts: 66
Joined: October 18th, 2008, 4:12 pm
Title: Chinoman10 is here:)
Location: Lisbon, Portugal

Re: Random starting locations through trigger

Post by Chinoman10 »

Try just removing the word Random...
On all of the parts I said above... Not only the Int part...
Image
The Holy Happiness that Love gives, will NEVER compensate the Deep Sadness that it will bring in the End...
Made By: Chinoman10
My advice?: If you desire to be truthfully happy, be in Love, but you'll suffer the consequences... If you don't want to suffer, don't Love... ( It's what I wished... )
[blinking]Respect others to be respected![/blinking]
Click on ChinoMon10 to level him up! ;)
Image_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Image
(Yea, I actually decided to try this :P) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Which Final Fantasy Character Are You?
patrick-the-bomb
Senior Member
Posts: 165
Joined: February 25th, 2008, 2:56 am
Title: Sir Awesome

Re: Random starting locations through trigger

Post by patrick-the-bomb »

Definitely doesn't work. Like at all. Gives me an error about how each of the aforementioned lines should "have a name"

Any ideas?
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Random starting locations through trigger

Post by weirdone2 »

Just tell it to create the units at a specific location you like. o.0