I know where to locate it, and how to copy and paste stuff in it. However, I have no idea what is going on in here and what my options are. Are there any rules to making a file or the layout? How do you set up your wordpad for it etc. Is there any specific order to write code or doesn't that matter?
A simple tutorial wouldn't fit your description, it would take quite an endeavor to cover everything. But here are some basics...
1. I use Notepad to edit SCAR documents. I highly recommend Notepad ++ for beginners.
2. Any SCAR scripting goes in the file YOURMAPNAME.SCAR
3. DO NOT EDIT - YOURMAPNAME_ID.SCAR It will be replaced every time the map is saved.
4. "--" means the line is commented out, and not read by the game. Anything following this is notes for the programmer.
5. Many of the scripting tutorials, custom pop cap, resources...ect, are written as standalone.
You must identify how to interweave them together. Below is how I combined the custom pop cap, and made the map winter with blizzards, fires...ect.
Default Blank - No code
The Term "function" begins a routine, the term "end" stops that routine. You may have subroutine's inside of routines. They define variables using statements, or wait for conditions to be met before executing a statement. The tutorials will highlight which lines need to be edited. Just read what is written, and feel free to ask specific questions.
Code
function OnInitID()
end
Custom Pop Cap
The Term "For" begins a subroutine, and the first "end" stops that subroutine, within the Oninit Routine, and the second "End" stops the script.
Code
function OnInitID()
--Population cap override value
g_popCapOverRide = 200
for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_SetPopCapOverride(player, g_popCapOverRide)
end
-- [[ Markers ]]
-- [[ Squad Groups ]]
-- [[ Entity Groups ]]
end
Blizzard on Custom Map
Code
import("ScarUtil.scar")
import("Systems/BlizzardMulitplayer.scar")
function OnInit()
MP_BlizzardInit(
"data:art/scenarios/presets/atmosphere/_mp_2p_kholodnaya_ferma_blizzard.aps", -- Blizzard atmosphere
"data:art/scenarios/presets/atmosphere/_mp_2p_Kholodnaya_Ferma.aps", --Default atmosphere
true, -- Start in Blizzard
nil, -- Blizzard Data
true, -- Use Speech
"data:art/scenarios/presets/atmosphere/_mp_2p_kholodnaya_ferma_transition_out.aps" --Blizzard out transition atmosphere
)
end
Scar_AddInit(OnInit)
Combined
Function OnInit() starts the scar script, once initialized, it begins what is defined in the function. The Import's prior to the OnInit define other scar scripts, which in the case, are for the blizzard system. One is a utility, the other is specifics for the blizzard process. The last "END" stops the script. I add in the custom pop cap just before that, in order to make sure it is included in the fall through execution, but not interrupting the blizzard definitions.
Code
import("ScarUtil.scar")
import("Systems/BlizzardMulitplayer.scar")
function OnInit()
MP_BlizzardInit(
"data:art/scenarios/presets/atmosphere/_mp_2p_kholodnaya_ferma_blizzard.aps", -- Blizzard atmosphere
"data:art/scenarios/presets/atmosphere/_mp_2p_Kholodnaya_Ferma.aps", --Default atmosphere
true, -- Start in Blizzard
nil, -- Blizzard Data
true, -- Use Speech
"data:art/scenarios/presets/atmosphere/_mp_2p_kholodnaya_ferma_transition_out.aps" --Blizzard out transition atmosphere
)
--Population cap override value
g_popCapOverRide = 200
for i = 1, World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_SetPopCapOverride(player, g_popCapOverRide)
end
end
Scar_AddInit(OnInit)
It is probably a bit vague, and possibly confusing for you, just keep reading, and keep asking questions.