Remove retreat option
Posts: 1006
I'd like to remove the retreat option for grenadiers in SCAR, any idea how this is possible? Couldn't find anything in Relic missions or in ScarDoc.
Posts: 165 | Subs: 2
Posts: 1006
So if you're willing to make a tuning pack for this then that'd be the best course of action.
Its for a SP sccenario. Sorry, I should have mentioned this in my first post.
Posts: 318
Use in "Mission_Start()"
player1 = World_GetPlayerAt(1)
Cmd_Upgrade(player1, BP_GetUpgradeBlueprint("order227"), 1, true)
Posts: 1006
there is an upgrade used in the tow mission "no retreat, no surrender" and will disable the ability to retreat for all units under the "upgraded" players command.
Use in "Mission_Start()"
player1 = World_GetPlayerAt(1)
Cmd_Upgrade(player1, BP_GetUpgradeBlueprint("order227"), 1, true)
Thanks. Once they completed an objective I'd like to remove this "Upgrade". How is this possible? I didn't find anything like remove upgrade.
Posts: 318
player1 = World_GetPlayerAt(1)
Player_RemoveUpgrade(player1, BP_GetUpgradeBlueprint("order227"))
Posts: 1006
Posts: 756 | Subs: 8
function Modify_Enable_PlayerIssueRetreat(playerid, value)
if value == true then
value = 1
elseif value == false then
value = 0
end
-- create the appropriate modifier
local modifier = Modifier_Create(MAT_Player, "modifiers\\enable_player_issue_retreat.lua", MUT_Enable, false, value, "")
Modifier_ApplyToPlayer( modifier, playerid )
end
Example of use:
Modify_Enable_PlayerIssueRetreat(player1, true)
Keep in mind that both methods enable/disable retreat for ALL of the player's units. There is no way to enable/disable for a specific unit in SCAR.
Posts: 1006
function Modify_Enable_PlayerIssueRetreat(playerid, value)
if value == true then
value = 1
elseif value == false then
value = 0
end
-- create the appropriate modifier
local modifier = Modifier_Create(MAT_Player, "modifiers\\enable_player_issue_retreat.lua", MUT_Enable, false, value, "")
Modifier_ApplyToPlayer( modifier, playerid )
end
Example of use:
Modify_Enable_PlayerIssueRetreat(player1, true)
I tried using this, but it gives me a Fatal error.
SCAR ERROR Callstack:
C [C] Ln -1 (Modifier_Create)
Lua test.scar"] Ln 337 (Modify_Enable_PlayerIssueRetreat)
Lua test.scar"] Ln 47 (OnInit)
GameObj:nFatalScarError: [Invalid parameter 5 (type expected=float, received=nil) in function Modifier_Create
Lua test.scar"] Ln 337 (Modify_Enable_PlayerIssueRetreat)
Lua test.scar"] Ln 47 (OnInit)
]
function Modify_Enable_PlayerIssueRetreat(playerid, value)
if value == true then
value = 1
elseif value == false then
value = 0
end
-- Create the appropriate modifier
local modifier = Modifier_Create(MAT_Player, "modifiers\\enable_player_issue_retreat.lua", MUT_Enable, false, value, "")
Modifier_ApplyToPlayer(modifier, playerid)
end
function BaseBuild()
Modify_Enable_PlayerIssueRetreat(player1, true)
Camera_MoveTo(mkr_camerabase, true, SLOW_CAMERA_PANNING, true, true);
Game_FadeToBlack(FADE_OUT, 0)
EGroup_DeSpawn(firstbase);
Rule_AddOneShot(OBJ_Farm_Mission, 2);
Rule_AddOneShot(CP_Meter, 1)
Rule_AddOneShot(BaseStart, 1)
Rule_AddOneShot(NoRetreat, 1)
function NoRetreat()
Modify_Enable_PlayerIssueRetreat(player1, false)
end
Posts: 756 | Subs: 8
Posts: 1006
http://pastebin.com/cNr1pyCZ
Line 47 Modify_Enable_PlayerIssueRetreat();
Line 53 Rule_AddOneShot(NoRetreat, 1)
Line 149 function Modify_Enable_PlayerIssueRetreat(playerid, value)
Line 162 Modify_Enable_PlayerIssueRetreat(player1, false)
Line 315 Modify_Enable_PlayerIssueRetreat(player1, true)
Posts: 756 | Subs: 8
-- Function call
Restriction();
InitializeObjectives();
Villageattack(); -- Call villageattack function
Modify_Enable_PlayerIssueRetreat();
In OnInit, you call the function without arguments. Hence the nil.
Livestreams
64 | |||||
31 | |||||
29 | |||||
118 | |||||
24 | |||||
19 | |||||
16 | |||||
4 | |||||
3 | |||||
1 |
Ladders Top 10
-
#Steam AliasWL%Streak
- 1.831222.789+37
- 2.600215.736+15
- 3.34957.860+14
- 4.1107614.643+8
- 5.305114.728+1
- 6.916405.693-2
- 7.273108.717+24
- 8.722440.621+4
- 9.1041674.607-2
- 10.17146.788+1
Replay highlight
- cblanco ★
- 보드카 중대
- VonManteuffel
- Heartless Jäger
Board Info
8 posts in the last week
37 posts in the last month
Welcome our newest member, zhcnwps
Most online: 2043 users on 29 Oct 2023, 01:04 AM