HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

funny thing...

09-01-2007, 05:49 PM#1
MaD[Lion]
Collapse JASS:
function config takes nothing returns nothing
    call SetMapName( "TRIGSTR_001" )
    call SetMapDescription( "TRIGSTR_003" )
    call SetPlayers( 10 )
    call SetTeams( 10 )
    call SetGamePlacement( MAP_PLACEMENT_TEAMS_TOGETHER )

    ...
 
    // Player setup
    call InitCustomPlayerSlots(  )
    call InitCustomTeams(  )
    call InitAllyPriorities(  )
endfunction

this function is in every map, tat defines the name of map and player amount...
i wonder wat happens if we do this:

Collapse JASS:
function config takes nothing returns nothing
    local integer i = GetRandomInt(5,10)
    call SetMapName( "TRIGSTR_001" )
    call SetMapDescription( "TRIGSTR_003" )
    call SetPlayers( i )
    call SetTeams( i )
    call SetGamePlacement( MAP_PLACEMENT_TEAMS_TOGETHER )

    ...
 
    // Player setup
    call InitCustomPlayerSlots(  )
    call InitCustomTeams(  )
    call InitAllyPriorities(  )
endfunction
would the player amount change randomly every game, or will it crash? :P
09-01-2007, 05:56 PM#2
Silvenon
I think the player number will change randomly every game, I don't see a reason to crash. Anyways, I don't know how can you change that.

P.S. Sorry about my negative feedbacks on your systems. Just outta curiosity, isn't there a Systems section in the Resources for that?
09-01-2007, 09:02 PM#3
DioD
you may test it self, but, this will crush, cos most functions cannot be run before map is inited, also random seed not exist, it will return same value all time.
09-02-2007, 12:27 AM#4
Toadcop
DioD it works perfectly <_< every time you select the map you will have random player number. lol anyway =) it's a funny stuff =)
09-02-2007, 04:16 AM#5
MaD[Lion]
lol ye very funny indeed :D I once had idea for something funny tat required this... but forgot.
Well anyone know any other funny stuff like this to share? :P

to Silvernon: well why would people make many type of consoles (playstation, nitendo, xbox...), Opertaion Systems, Digital Imaging programs ect... ? Isnt it enough with only 1?
09-02-2007, 04:23 AM#6
Toink
So you can randomize the name? omg lol..

Collapse JASS:
function config takes nothing returns nothing
local integer i = GetRandomInt(1, 3)
local string array s [4]
    set s[1] = "Just another Wc3 map"
    set s[2] = "Dota Allstars 6." + I2S(GetRandomInt(5, 9)) + I2S(GetRandomInt(1, 9))
    set s[3] = "Maze of Porn"
    call SetMapName( s[i] )
    call SetMapDescription( "Hi" )
    call SetPlayers( 10 )
    call SetTeams( 10 )
    call SetGamePlacement( MAP_PLACEMENT_TEAMS_TOGETHER )

    ...
 
    // Player setup
    call InitCustomPlayerSlots(  )
    call InitCustomTeams(  )
    call InitAllyPriorities(  )
endfunction

Oh btw, can you set players() to something like players(15)?
09-02-2007, 04:29 AM#7
MaD[Lion]
a ye tat u can too (un)fortunately :P

but i wonder how it would be now if you do this:
Collapse JASS:
function config takes nothing returns nothing
    call SetMapName( "TRIGSTR_001" )
    call SetMapDescription( "Hosted by: "+GetPlayerName(Player(0)) )
    call SetPlayers( 10 )
    call SetTeams( 10 )
    call SetGamePlacement( MAP_PLACEMENT_TEAMS_TOGETHER )

    ...
 
    // Player setup
    call InitCustomPlayerSlots(  )
    call InitCustomTeams(  )
    call InitAllyPriorities(  )
endfunction

EDIT: ok changing the map name doesnt work, neither is the description... But the random players work tho.
09-02-2007, 05:14 AM#8
The Elite
Does that meen we could detect the host much easier by doing this
Collapse JASS:
function config takes nothing returns nothing
  set udg_Host = Player(0)
    call SetMapName( "TRIGSTR_001" )
    call SetMapDescription( "TRIGSTR_003" )
    call SetPlayers( 10 )
    call SetTeams( 10 )
    call SetGamePlacement( MAP_PLACEMENT_TEAMS_TOGETHER )

    ...
 
    // Player setup
    call InitCustomPlayerSlots(  )
    call InitCustomTeams(  )
    call InitAllyPriorities(  )
endfunction
09-02-2007, 05:18 AM#9
MaD[Lion]
u cant, the globals arent initialized at this state yet
09-02-2007, 06:23 AM#10
The Elite
but what if we initialized the host global in a function right before the config function
09-02-2007, 09:52 AM#11
Toadcop
gamecache O_O ? =) maybe or crash it ^^ ahhhhhhhh damnnn =) gc create a handle :'( so it will crash. (i think) but if not...

Quote:
EDIT: ok changing the map name doesnt work, neither is the description... But the random players work tho.
! cause this description is fake ! OR I BET ! i know ^^ it will be shown in Quest log... but the description... (the true description is in w3i file)

Quote:
but what if we initialized the host global in a function right before the config function
no ! the needed scope does not exists. it's like pld files.