|
发表于 2006-4-11 09:37:02
|
显示全部楼层
TriggerWaitOnSleeps
http://www.wc3campaigns.net/showthread.php?t=7783
Wait Info Discovery, Untested
ZellDominiko
12-22-2002, 05:03 PM #5
I haven\'t tested this and I don\'t think it\'s necessary to. Obviously these two triggers affect the Wait in triggers. The first one TriggerWaitOnSleeps takes a trigger and a boolean: false to disallow waits in a specified trigger, true to allow waits in a specified trigger. Similarly, IsTriggerWaitOnSleeps takes a trigger and returns a boolean: false if the specified trigger currently skips any waits, true if the specified trigger currently \"sleeps\" or \"pauses\" when it runs into a Wait action.
http://www.wc3campaigns.net/showthread.php?t=55851
What would TriggerWaitOnSleeps
weaaddar
05-23-2004, 02:08 AM #2
this just means if the trigger ignores or accepts the sleep action command. if it doesn\'t wait on sleep it just keeps on churning. Default its on.
http://www.wc3jass.com/viewtopic.php?t=2726
PipeDream
Wed Mar 29, 2006 11:11 am
I tried to use this to measure game latency
[jass]
function GetHost takes nothing returns nothing
local timer t = CreateTimer
local real dt
call TimerStart(t,20.,false,null)
set dt = TimerGetElapsed(t)
call StoreInteger(udg_MedalCache, \"Alpha\", \"Beta\", GetPlayerId(GetLocalPlayer()) + 1)
call TriggerSyncStart()
call SyncStoredInteger(udg_MedalCache, \"Alpha\", \"Beta\")
call TriggerSyncReady()
set udg_GameHost = Player(GetStoredInteger(udg_MedalCache, \"Alpha\", \"Beta\") - 1)
call FlushStoredMission(udg_MedalCache,\"Alpha\")
set dt = TimerGetElapsed(t) - dt //dt is now max latency, I think
call PauseTimer(t)
call DestroyTimer(t)
set t = null
call DisplayTextToPlayer(GetLocalPlayer(),0,0,\"Game latency: \"+I2S(R2I(dt*1000))+\"ms\")
endfunction
[/jass]
also tried SyncSelections() instead of TriggerSyncStart/TriggerSyncReady()
Didn\'t work out. TriggerSyncStart/ready always consumed 500ms, SyncSelections() 250ms. Possibly all sync commands do a 250ms sleep and SyncStoredInteger really does sync by itself.
Anyone got other ideas?
http://www.wc3campaigns.net/showthread.php?t=57379
Unknown Functions
danny760311
06-13-2004, 07:29 PM #1
These are the functions in common.j that I hasn\'t known what they\'re doing...:( Could someone explain how to use them?
ExecuteFunc
TriggerWaitOnSleeps
IsTriggerWaitOnSleeps
TriggerExecuteWait
TriggerSyncStart
TriggerSyncReady
IssueInstantTargetOrder
IssueInstantTargetOrderById
(2 targets?? why??)
IssueNeutralImmediateOrder
IssueNeutralImmediateOrderById
IssueNeutralPointOrder
IssueNeutralPointOrderById
IssueNeutralTargetOrder
IssueNeutralTargetOrderById
(What\'s different from IssueImmediateOrder...??)
SyncStoredInteger
SyncStoredReal
SyncStoredUnit
SyncStoredString
FlushGameCache
FlushStoredMission
FlushStoredInteger
FlushStoredReal
FlushStoredBoolean
FlushStoredUnit
FlushStoredString
AIAndy
06-13-2004, 08:26 PM #2
ExecuteFunc allows you to call a function by its name as a string. That is very useful although it works only on takes nothing returns nothing functions. I use that for example in my class system to implement polymorphism.
IssueInstantTarget stuff is used for orders that actually require 2 targets. For example selling an item.
IssueNeutral stuff is for orders that require a player like orders to neutral buildings
the flush stuff deletes gamecache entries.
Cubasis
06-13-2004, 09:37 PM #3
The Sync functions synchronize the data saved in the file and the data in memory.
If a trigger is set not to WaitOnSleeps, then all TriggerSleepActions are ignored in it.
And I forgot what the other 3 trigger-functions did.
danny760311
06-13-2004, 10:04 PM #4
>IssueInstantTarget stuff is used for orders that actually require 2 targets. For example selling an item.
Uh...how to make a \"sellitem\" order???
>IssueNeutral stuff is for orders that require a player like orders to neutral buildings
Example??
danny760311
06-13-2004, 10:20 PM #5
>The Sync functions synchronize the data saved in the file and the data in memory.
What does it mean? I can\'t understand :(
Cubasis
06-13-2004, 10:25 PM #6
Before you run: SaveGameCache() - All game cache stuff is stored in memory... not on the hard drive. So when you run this function, all the stuff that is in memory, is now put into a file on the hard drive. After that is done, you can continue to change stuff in the game cache, but that won\'t affect the file, that will only affect the data in memory. So you have too manually update the file by either synchronizing a specific data by using one of these Sync functions, or run the SaveGameCache function again.
Note that this is also how you can use GameCache on Multiplayer, that is, you can do anything except run SaveGameCache or Sync functions.
AIAndy
06-14-2004, 05:44 AM #7
The order string for selling is \"dropitem\" and then one of the targets is the shop and the other the item.
call IssueNeutralImmediateOrderById(ai_player, buy_place, old_id[id])
That is from AMAI for buying a mercenary.
danny760311
06-15-2004, 10:51 PM #8
Well....I still can\'t figure out how to use IssueNeutral<xxx>Order...
What does the player matter??
Cubasis
06-15-2004, 10:53 PM #9
eh.
If you have a function that orders a shop to sell a unit. Then it must know which player should get the unit. The player parameter only discerns who\'s the buyer/user.
danny760311
06-22-2004, 01:24 PM #10
TriggerExecuteWait
TriggerSyncStart
TriggerSyncReady
Still don\'t know them...
Any1 has the idea?
AIAndy
06-22-2004, 02:18 PM #11
Quote from Brett Wood:
TriggerExecuteWait
native TriggerExecuteWait takes trigger whichTrigger returns nothing
Runs the given trigger in a special mode which affects all other triggers that have the \"wait on sleep\" property set. When this trigger sleeps (via TriggerSleepAction), all other triggers that have \"wait on sleep\" turned on will wait until this trigger stops sleeping and resumes execution before they also resume execution.
TriggerSyncStart
TriggerSyncReady
native TriggerSyncStart takes nothing returns nothing
native TriggerSyncReady takes nothing returns nothing
This pair of functions can be used to synchronize all players after performing asynchronous operations (such as loading files). Once TriggerSyncStart is called, execution will continue until TriggerSyncReady is called, and then wait until all other players have also called TriggerSyncReady before continuing. |
|