Login

russian armor

How To: Pseudo-Random Offmap Abilities

5 Dec 2014, 16:55 PM
#1
avatar of IronMedic

Posts: 318

How To: Pseudo-Random Offmap Abilities


note: This is one way to do it.

Larger picture.

Step1: Open your level inside world-builder and select the Render Marker Prox() tool.

Step2: Set the Marker Mode to Scar Markers.

Step3: Set the marker type to Enemy_Spawn, to
easier keep a track of which markers are used to call in off-map abilities.

Step4: Right-click on your desired target zone(s).

Step5: Select the freshly placed marker, you can rename or keep the default name, and note down it's name( this is not necessary but highly recommended for step9).

Step6: Save your level and minimize the world-builder.

Step7: Open/navigate to the folder were your level is saved open or create mapname.scar (if your level is named "4_6_rostov.sgb" your need to open/create "4_6_rostov.scar").

Step8: Copy paste the code into mapname.scar.

Step9a: Scroll down to the function RES_Cast(), add your markers to the table "local markers_Cast", also remove the example markers.

Step9b: Optional you can change the following variables g_offmap_interval_first_min, g_offmap_interval_first_max, g_offmap_interval_min, g_offmap_interval_max, these will affect how often the ability is cast. The g_aef_ability (usa), g_west_german_ability (OKW), g_german_ability (ost/wher) and g_soviet_ability (sov), will affect what ability is cast.

Step10: save/save as "mapname.scar", maximize world-builder and "export package".
Code

function OnInit()
t_players = {}
--Time in seconds to first
g_offmap_interval_first_min = 60
g_offmap_interval_first_max = 120
--Time in seconds to the following strikes after first
g_offmap_interval_min = 120
g_offmap_interval_max = 240
--Give each race a ability.
g_aef_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
g_west_german_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
g_german_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
g_soviet_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
for i=1,World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
table.insert (t_players, player)
if Player_GetRaceName(player) == "german" then
Player_AddAbility(t_players[i], g_german_ability)
elseif Player_GetRaceName(player) == "west_german" then
Player_AddAbility(t_players[i], g_west_german_ability)
elseif Player_GetRaceName(player) == "soviet" then
Player_AddAbility(t_players[i], g_soviet_ability)
elseif Player_GetRaceName(player) == "aef" then
Player_AddAbility(t_players[i], g_aef_ability)
end
end
Rule_AddInterval(RES_Cast, World_GetRand(g_offmap_interval_first_min, g_offmap_interval_first_max))

end

--Cast offmap-----------------------------------
function RES_Cast ()
--Exampel markers, replace them whit YOUR MARKERS!!!
local markers_Cast =
{
mkr_44,
mkr_45,
mkr_46,
mkr_47,
mkr_48,
}

local target_R = Table_GetRandomItem(markers_Cast)
local target_Player = t_players[World_GetRand(1, World_GetPlayerCount())]
if Player_GetRaceName(target_Player) == "german" then
Cmd_Ability(target_Player, g_german_ability,target_R, nil, true)
elseif Player_GetRaceName(target_Player) == "west_german" then
Cmd_Ability(target_Player, g_west_german_ability,target_R, nil, true)
elseif Player_GetRaceName(target_Player) == "soviet" then
Cmd_Ability(target_Player, g_soviet_ability,target_R, nil, true)
elseif Player_GetRaceName(target_Player) == "aef" then
Cmd_Ability(target_Player, g_aef_ability,target_R, nil, true)
end

Rule_ChangeInterval(RES_Cast, World_GetRand(g_offmap_interval_min, g_offmap_interval_max))

end

Scar_AddInit(OnInit)
6 Dec 2014, 02:36 AM
#2
8 Dec 2014, 14:17 PM
#3
avatar of simpelekees
Patrion 310

Posts: 159

what about letting SCAR search for a random world object? And bomb it.
25 Mar 2015, 03:45 AM
#4
avatar of jaysonv

Posts: 28

How To: Pseudo-Random Offmap Abilities


note: This is one way to do it.

Larger picture.

Step1: Open your level inside world-builder and select the Render Marker Prox() tool.

Step2: Set the Marker Mode to Scar Markers.

Step3: Set the marker type to Enemy_Spawn, to
easier keep a track of which markers are used to call in off-map abilities.

Step4: Right-click on your desired target zone(s).

Step5: Select the freshly placed marker, you can rename or keep the default name, and note down it's name( this is not necessary but highly recommended for step9).

Step6: Save your level and minimize the world-builder.

Step7: Open/navigate to the folder were your level is saved open or create mapname.scar (if your level is named "4_6_rostov.sgb" your need to open/create "4_6_rostov.scar").

Step8: Copy paste the code into mapname.scar.

Step9a: Scroll down to the function RES_Cast(), add your markers to the table "local markers_Cast", also remove the example markers.

Step9b: Optional you can change the following variables g_offmap_interval_first_min, g_offmap_interval_first_max, g_offmap_interval_min, g_offmap_interval_max, these will affect how often the ability is cast. The g_aef_ability (usa), g_west_german_ability (OKW), g_german_ability (ost/wher) and g_soviet_ability (sov), will affect what ability is cast.

Step10: save/save as "mapname.scar", maximize world-builder and "export package".
Code

function OnInit()
t_players = {}
--Time in seconds to first
g_offmap_interval_first_min = 60
g_offmap_interval_first_max = 120
--Time in seconds to the following strikes after first
g_offmap_interval_min = 120
g_offmap_interval_max = 240
--Give each race a ability.
g_aef_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
g_west_german_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
g_german_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
g_soviet_ability = ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
for i=1,World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
table.insert (t_players, player)
if Player_GetRaceName(player) == "german" then
Player_AddAbility(t_players[i], g_german_ability)
elseif Player_GetRaceName(player) == "west_german" then
Player_AddAbility(t_players[i], g_west_german_ability)
elseif Player_GetRaceName(player) == "soviet" then
Player_AddAbility(t_players[i], g_soviet_ability)
elseif Player_GetRaceName(player) == "aef" then
Player_AddAbility(t_players[i], g_aef_ability)
end
end
Rule_AddInterval(RES_Cast, World_GetRand(g_offmap_interval_first_min, g_offmap_interval_first_max))

end

--Cast offmap-----------------------------------
function RES_Cast ()
--Exampel markers, replace them whit YOUR MARKERS!!!
local markers_Cast =
{
mkr_44,
mkr_45,
mkr_46,
mkr_47,
mkr_48,
}

local target_R = Table_GetRandomItem(markers_Cast)
local target_Player = t_players[World_GetRand(1, World_GetPlayerCount())]
if Player_GetRaceName(target_Player) == "german" then
Cmd_Ability(target_Player, g_german_ability,target_R, nil, true)
elseif Player_GetRaceName(target_Player) == "west_german" then
Cmd_Ability(target_Player, g_west_german_ability,target_R, nil, true)
elseif Player_GetRaceName(target_Player) == "soviet" then
Cmd_Ability(target_Player, g_soviet_ability,target_R, nil, true)
elseif Player_GetRaceName(target_Player) == "aef" then
Cmd_Ability(target_Player, g_aef_ability,target_R, nil, true)
end

Rule_ChangeInterval(RES_Cast, World_GetRand(g_offmap_interval_min, g_offmap_interval_max))

end

Scar_AddInit(OnInit)
1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

839 users are online: 839 guests
0 post in the last 24h
12 posts in the last week
26 posts in the last month
Registered members: 49989
Welcome our newest member, LegalMetrologyConsul
Most online: 2043 users on 29 Oct 2023, 01:04 AM