Sorry for the late reply General Pao.
I haven't worked with RA3 so I can't directly answer your question but if it's at all like Generals or Tiberium Wars then these ideas might help.
Setting Players:You'll be starting with at least one AI controlled player. I'll call this player "TheEnemy" and the human player called "ThePlayer". These names and their relationship are set under Edit/Edit Player List. Be sure to "Check" the box for AI players so they are computer controlled. Add a "civilian" player (PlyrCivilian) for trees, props, buildings etc with a neutral relation to the other players.
Set Player Cash:If any of the players are to "Build" units, you will need to give them cash to start. Under Edit/Scripts, you should see the players you created. Click on the player and click "New Script". Name the script (Set Cash), then under "Actions IF TRUE" look for "Player/Money" and fill in the variables for the script to "Set the Player's Money". You should have something like this.
*** IF ***
True.
*** THEN ***
Set Player 'TheEnemy''s money to $ 250000
Note: You will also need to give them the appropriate structures to create units.
Making a general counter:It's nice to have general counter for controlling the game. Create the following scripts in the "PlyrCivilian" folder. This is done by first setting your counter to zero like this.
Script Name: SetCounter [ns A D]
*** IF ***
True.
*** THEN ***
Set 'Time' to 0
Enable Script 'StartTime'[/code].
Then have this script activate your counter script that is set to re-evaluate every second.
🅱Script Name:[/b] StartTime [ns na D]
[code]*** IF ***
True.
*** THEN ***
Add 1 to counter 'Time'
This will add "one" to the counter called "Time" each time this script is re-evaluated.
NOTE: If you wish to turn this into a countdown then just reverse these numbers by setting the total time first then subtracting.
Showing the timer (counter) in the game:This requires making a file called "map.str" and placing it in your map folder located in one of the following locations depending on the system you use.
* Under Windows XP:
o C:\Documents and Settings\[USER_NAME]\Application Data\Red Alert 3\Maps\
* Under Windows Vista:
o C:\Users\[USER_NAME]\AppData\Roaming\Red Alert 3\Maps\
Using Notepad, type in using the following style formatting,
SCRIPT:ScriptName
"What you want to show in game"
End
For Example:SCRIPT:Coundown
"Prisoners will be killed in:"
End
As noted above, save this file as "map.str" without quotes in your map folder making sure NOT to save it as a txt file. Use the "All Files" type when saving.
After creating this file, reload Worldbuilder and open your "counter" script again. Let's say you called the counter "CountdownToExecution" using a file like this,
*** IF ***
True.
*** THEN ***
Set ' CountdownToExecution ' to 900
Enable Script 'StartCountdown'.
You would just add the line to show the counter in game by adding this line calling the SCRIPT line you made in the map.str file.
*** IF ***
True.
*** THEN ***
Set ' CountdownToExecution ' to 900
Enable Script 'StartCountdown'.
Show ' CountdownToExecution ' with text Localized String: 'SCRIPT: Coundown '
Mission Briefings:These are made in the same way using the same map.str file. For Example,
SCRIPT:Briefing1
"Your goal is to find and rescue… bla bla"
END
Then using your "General Counter" you can active these briefings.
***IF***
Counter 'PlyrCivilian/Time' IS Greater Than 5
***THEN***
Show military briefing Localized String: 'SCRIPT: Briefing1' for 8.00 seconds.
Note: Adjust the pathway to your counter script and how long the message shows accordingly.
Basic Team Creation and Action:
Assuming you've placed structures for player "TheEnemy" you can now build a team.
One simple subroutine script can
build a team and
control their action. In this example I've set the script to fire sequentially on '
' (which is usually the setting for a team action script). This is set in the "Script Properties" TAB by checking Sequential Script checkbox and selecting "Team" as the type and then '' for the team. In this example I will first move the team to a location then garrison a building. Notice we're using our counter to trigger this script.
Script Name: Garrison1 [S A nd]
*** IF ***
Counter 'PlyrCivilian/Time' IS Greater Than 150
*** THEN ***
AttackMove Team '<This Team>' to Unit 'GarrisonBuilding1'.
Team '<This Team>' enters into building named Unit 'GarrisonBuilding1'
Now in the Team Editing section, make a new team called "Garrison1" and select this subroutine script for both the team "Production Condition" trigger script and the "On Create" behavior script so when this script is triggered the team is built they will perform the action specified. In most cases, teams produced in this way will be automatically rebuilt when lost.
Basic Patrols:
Just like the last script you can make a patrol team and have them follow a pathway. Using the "Waypoint Tool" drag out a pathway and label it under "Waypoint Path Labels" giving your path a name, i,e, "PatrolPath1".
Script Name : PatrolTeam1Path1 [S A nd]
*** IF ***
Counter 'PlyrCivilian/Time' IS Greater Than 10
*** THEN ***
Have Team ' PatrolTeam1Path1' AttackMove follow Waypoint Path 'PatrolPath1' , as a team is TRUE , in formation is FALSE
You could use this same pathway for other teams to stagger the number of patrols. Just copy the script and change it to a new team,i,e, "PatrolTeam2Path1" and create a new team using this script.
Script Name : PatrolTeam2Path1 [S A nd]
*** IF ***
Counter 'PlyrCivilian/Time' IS Greater Than 30
*** THEN ***
Have Team ' PatrolTeam2Path1' AttackMove follow Waypoint Path 'PatrolPath1' , as a team is TRUE , in formation is FALSE
If you wish to build a team that will hunt the player then just have "This team '' starts hunting" as the action or setup pathways leading the the players base and use the attackmove type of script.
Adding Reinforcements:
There are several ways this can be done but in this example we'll just tell the player that if they find "CompanyX", they will help complete the mission. Go to the Team Editing section and create a new team called "CompanyX" under PlyrCivilian. Place the team and set the team name as "CompanyX"” then just make a script that says,
*** IF ***
Team 'CompanyX' has been discovered by Player 'ThePlayer'
*** THEN ***
Control of Team 'CompanyX' transfers to Player 'ThePlayer'
This same setup would also work for a "rescue operation" so the team to be found would be transferred to the player when found and the player would escort them out of the enemy area.
***
Where you take this is up to you but you could for example use your "General Counter" to tell Enemy teams to hunt after a specified amount of time or if the player has been discovered, all enemy units start hunting. Areas can also be specified on the map using the polygon tool so that if the player reaches this area, it triggers a scripted event.
I hope these little tips will help you get going.
Best of luck