| 06-13-2004, 11:29 AM | #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 |
| 06-13-2004, 12: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. |
| 06-13-2004, 01: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. ~Cubasis |
| 06-13-2004, 02: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?? |
| 06-13-2004, 02: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 :( |
| 06-13-2004, 02: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. ~Cubasis |
| 06-13-2004, 09:44 PM | #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. |
| 06-15-2004, 02:51 PM | #8 |
Well....I still can't figure out how to use IssueNeutral<xxx>Order... What does the player matter?? |
| 06-15-2004, 02: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. ~Cubasis |
| 06-22-2004, 05:24 AM | #10 |
TriggerExecuteWait TriggerSyncStart TriggerSyncReady Still don't know them... Any1 has the idea? |
| 06-22-2004, 06:18 AM | #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. |
