Originally Posted by: adrianemapmaker thanks
but wait i don't know how to use flags and what flags doing ,can you please said to me how to use this script ,how did they work?
dang these skirmishscripts are high level scripts ,these are from the developers right.
some of those are i cant understand damn
.
just like the <player> got greater than equal....... what!!
what is that for.
can you explain some of those too, i already seen these scripts from a downloadable mission.
Of course! I'd be glad to considering I work with these scripts all the time!
Let me expand on a few of them; Firstly, the one's that you asked about. If anything seems confusing let me know and I will edit this post to make things more clear!
Flags:Flags are very useful, considering they turn things on and off. They basically toggle items. Since scripts are activated by descending order (1...2...3...4...etc) flags can be used to keep a script active.
Example: (Applying this in cinematic intros)
Script 1:*** IF ***
True.
*** THEN ***
Set Flag named '_GAME_ON' to TRUEScript 2:*** IF ***
True.
*** THEN ***
Set Flag named '_GAME_ON' to FALSEThe world is revealed permanently for Player 'ThePlayer'.
Start letterbox mode (hide UI, add border).
Disable mouse and keyboard input.
Set timer '_CINE_TIMER' to expire in 1500 frames.
Set timer '_CINE_TIMER2' to expire in 2.00 seconds.
Position camera at Waypoint 'cm_Start1', zoom = 1.00(0.0 to 1.0), pitch = 1.00(1.0==default), looking towards Waypoint 'cm_Look1'.
Set the desired sound volume to 60.00%. (0-100)
Set the desired music volume to 80.00%. (0-100)
Script 3:
*** IF ***
Timer '_CINE_TIMER2' has expired.
*** THEN ***
Move camera to Waypoint 'cm_Pos1a' in 8.50 seconds, camera shutter 0.00 seconds, ease-in 2.00 seconds, ease-out 2.00 seconds.
Look towardWaypoint 'cm_Look1a' during the camera movement.
Set timer '_CINE_TIMER2' to expire in 9.00 seconds.
Enable Script 'Script 4'.
Script 4:*** IF ***
Timer '_CINE_TIMER2' has expired.
*** THEN ***
Set Flag named '_GAME_ON' to TRUESet the desired sound volume to 100.00%. (0-100)
Set the desired music volume to 100.00%. (0-100)
All sound events play at normal volume.
In this short example you can see that the game screen is switched on and off between the Game and the Intro using the flag "Game_ON".Player has greater than or equal to.....:This set of scripts are helpful for detecting the current state of the player. Once the current state is detected a desired effect will take place.
Example 1: (Using greater than or equal to for structures/units)
This one seems straightforward, but let's dig deeper!
Script 1*** IF ***
Player '<This Player>' has Greater Than or Equal To 4 unit or structure of type 'ChinaTankDragon'
*AND* 2000
is Less Than or Equal the number of credits possessed by Player '<This Player>'
*** OR ***
Player '<This Player>'
has Greater Than or Equal To 4 unit or structure of type 'ChinaJetMIG'
*AND* 2000
is Less Than or Equal the number of credits possessed by Player '<This Player>'
*** THEN ***
Have AI Player '<This Player>' build this upgrade: Upgrade 'Upgrade_ChinaBlackNapalm'
That seems like a lot! So let's break it down.*** IF ***
Player '<This Player>' has Greater Than or Equal To 4 unit or structure of type 'ChinaTankDragon'
The first *if* statement checks if the player has build 4 or more Dragon Tanks *AND* 2000 is Less Than or Equal the number of credits possessed by Player '<This Player>'
This *And* statement here means that the previous condition (The *If* statement just above) must be TRUE along with THIS statement. In other words both the *if* and *And* statement must be true in order for the script to activate
Going back to the script at hand, this *AND* statement detects if the player has $2,000 or less. Putting it together and the whole condition states that the player MUSThave BOTH $2,000 or less and 4 or more Dragon Tanks *** OR ***
Player '<This Player>' has Greater Than or Equal To 4 unit or structure of type 'ChinaJetMIG'
*AND* 2000 is Less Than or Equal the number of credits possessed by Player '<This Player>'
*OR* sets another condition. If the previous statements above were not met the game checks if these conditions are met.
Just like the dragon tanks this condition detects if the player has 4 or more China Mig's and if the player also has $2,000 or less.*** THEN ***
Have AI Player '<This Player>' build this upgrade: Upgrade 'Upgrade_ChinaBlackNapalm'
If the ***OR*** Statement or the ***IF**** statement are true, the follow effect takes place in the ***THEN*** statementExample 2: (Using greater than or equal to for range)
*** IF ***
Player '<This Player>' has a tech building within 500.00 of area '[Skirmish]MyInnerPerimeter'
*AND* Player '<This Player>' has Greater Than or Equal To 1 unit or structure of type 'ChinaBarracks'
*** THEN ***
Set 'China Tech Building Near' to 1
This is pretty self-explanatory so no problem hereExample 3: (Complicated Greater than or equal to)
In the case of this script:
*** IF ***
Flag named 'China Tech Stop Trying' IS FALSE
*AND* Counter '_ESCALATION' IS Greater Than or Equal To 100 *** THEN ***
Set Flag named 'China Tech Stop Trying' to TRUE
The variable is the COUNTER_ESCALATION instead of the THIS_PLAYER.The COUNTER_ESCALATION is a counter that's set in another script. The counter script does what it says.... It counts! lol. It's like a timer except it counts up and not down. Once this counter reached 100 or more the desired effect will take place: Setting the flag to false.Important Notes:
- Greater than or Equal to can be applied to Less Than or Equal to as well
- Different variables can be used ranging from Counters, Players, and Objects/Units
- These scripts detect if the conditions are met
See if you can decipher this script! *** IF ***
Flag named 'MORE CRATES' IS FALSE
*AND* Player '<This Player>' has Less Than 3 unit or structure with Kind is 'CRATE' in the area '[Skirmish]MyInnerPerimeter'
*** THEN ***
Set Flag named 'MORE CRATES' to TRUE
Extras:In this script you can see how the developers set all the variables. Most of which are flags!*** IF ***
True.
*** THEN ***
Set Flag named '_INVASION_ALERT' to FALSE
Set Flag named '_INVASION_ALERT_OVER' to FALSE
Set Flag named '_INVASION_ALERT_RESPONSE' to FALSE
Set Flag named 'China Start Garrisoning Buildings' to FALSE
Set Flag named 'China Air Team Is Building' to FALSE
Set Flag named 'China Inf Team Is Building' to FALSE
Set '_ATTACK_WAVE' to 0
Set '_ESCALATION' to 0
Set Flag named 'China Tech Stop Trying' to FALSE
Set '_COUNTER_FOR_ATTACK' to 0
Here one will notice that the Greater than or Equal to has been applied to check when the AI player has taken mast amounts of destruction, and if the conditions are met the AI will sell their buildings and surrender!*** IF ***
Player '<This Player>' has Less Than or Equal 0 unit or structure of type 'ChinaVehicleDozer'
*AND* Player '<This Player>' has Less Than or Equal 0 unit or structure of type 'ChinaCommandCenter'
*AND* Player '<This Player>' has Less Than or Equal 0 unit or structure of type 'Base Factories'
*** OR ***
2000 is Greater Than the number of credits possessed by Player '<This Player>'
*AND* Player '<This Player>' has Less Than or Equal 0 unit or structure of type 'ChinaVehicleSupplyTruck'
*AND* Player '<This Player>' has Less Than or Equal 0 unit or structure of type 'ChinaInfantryHacker'
*AND* Player '<This Player>' has Less Than or Equal 0 unit or structure of type 'ChinaSupplyCenter'
*AND* Player '<This Player>' has Less Than or Equal 0 unit or structure of type 'TechOilDerrick'
*** THEN ***
Set timer 'China - Sell Off Timer' to expire in 10.00 seconds.
Enable Script 'China Sell off'.
Script: China Sell off *** IF ***
Timer 'China - Sell Off Timer' has expired.
*** OR ***
*** THEN ***
Player '<This Player>' sells everything.
Let me know if there are any other scripts you are curious about!! Edited by user Monday, October 24, 2016 6:00:38 PM(UTC)
| Reason: Not specified