General talk about editing, cheating, and deprotecting maps.
Moderator: Cheaters
Black-Hole
Forum Fanatic
Posts: 315 Joined: October 16th, 2007, 7:32 pm
Post
by Black-Hole » April 20th, 2008, 8:20 pm
Code: Select all
//TESH.scrollpos=24
//TESH.alwaysfold=0
function GetHost takes nothing returns nothing
local gamecache g = InitGameCache("Map.w3v")
call StoreInteger ( g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
call TriggerSyncStart ()
call SyncStoredInteger ( g, "Map", "Host" )
call TriggerSyncReady ()
set udg_Host = Player( GetStoredInteger ( g, "Map", "Host" )-1)
call FlushGameCache( g )
set g = null
endfunction
Code: Select all
Choosing Host
Events
Map initialization
Conditions
Actions
Custom script: call GetHost()
For somereason when the game starts it dosnt pick the host? It dosnt pick anyone can someone help em please
weirdone2
Forum Staff
Posts: 926 Joined: June 3rd, 2007, 8:03 pm
Post
by weirdone2 » April 21st, 2008, 12:11 am
And how would you know it doesn't get host I don't see any code their to do anything once the host is found.
JJ2197
Legendary Genius
Posts: 1311 Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah
Post
by JJ2197 » April 21st, 2008, 12:25 am
Yea add like:
call DisplayTextToForce(GetPlayersAll(),I2S(GetPlayerId(udg_host)))
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
Aero
Forum Staff
Posts: 829 Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada
Post
by Aero » April 21st, 2008, 11:50 pm
Dont run that script at map initialization, run it at least a few seconds after game has started. It seems to yield much better results.
Ozzapoo
The Flying Cow!
Posts: 2196 Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne
Post
by Ozzapoo » April 22nd, 2008, 7:30 am
How does this script get the host anyway...
Aero
Forum Staff
Posts: 829 Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada
Post
by Aero » April 22nd, 2008, 12:46 pm
This stores an integer in every players' gamecache equal to their id+1
call StoreInteger ( g, "Map", "Host", GetPlayerId(GetLocalPlayer ())+1)
When working correctly, this block of code will sync all the players' stored integers to that of the host.
call TriggerSyncStart ()
call SyncStoredInteger ( g, "Map", "Host" )
call TriggerSyncReady ()
Therefore, this will return the id of the host.
set udg_Host = Player( GetStoredInteger ( g, "Map", "Host" )-1)
initialD
Some Honorary Title
Posts: 1713 Joined: June 8th, 2007, 5:08 am
Title: Angry Bird
Post
by initialD » April 25th, 2008, 6:17 am
I wonder why Icefrog didn't use this host tracing system to track don't the host and let only the host to type commands for game mode.
It's kinda annoying everytime the host has to be player blue.
It's also impossible for the host to be Scourge team if it was normal mode.(ie. team pick)