Login

russian armor

Single Player Script: Bounty

7 Aug 2015, 11:02 AM
#1
avatar of IronMedic

Posts: 318

note: This is a re-writen/updated script that was used in vCoH's ToV La Fière


This Script checks whenever player2 loses a squad and reward player1 whit manpower, munition and fuel.


How to use:


This script ether be appended directly into your already existing "mapname".scar
or
Import into your "mapname".scar.

If you append the directly into "mapname".scar you can export the map as normal using the worldbuilder. To do this simply copy paste the bounty script at the end of "mapname".scar.

If you wish to keep your "mapname".scar a bit more tidy copy the script file into the same folder as your map and ad import("bounty.scar") to the beginning of "mapname".scar, but this will require you to create a scenario pack using the CoH2 Mod Builder

Variables Of The Script


g_playerToRewardForSquadWhipe = The player who gets rewarded when the player defined as "g_playerEnemyAI" losses a squad.

g_playerEnemyAI = The enemy of "g_playerToRewardForSquadWhipe".

These multipliers will be applied on the base "cost" value for each resource type
g_MunitionMultiplier = Affects the amount of Munition.
g_ManpowerMultiplier = Affects the amount of Manpower.
g_FuelMultiplier = Affects the amount of Fuel.

g_textString =This is the text string displayed as the Reward "Kicker" and has to be formatted like this "+%1AMOUNT%:MP\n +%2AMOUNT%:MU\n +%3AMOUNT%:FU" the text highlighted in red is the most important part of this text string and will break the script if missing from the string.

g_vehKillCount =completely optional, and if defined this script can track vehicles destroyed for objectives.

The table cost is used to define the base value of the bounty.

The table BountyRewards is used to define each unit. I've defined the most common units in full script, the script contains a few example unit.

Download the full script:the_bounty_script.zip


--This is a re-writen/updated script that was used in CoH ToV La Fière Campaign, re-writen/updated by IronMedic @coh2.org.
function BountyInit()

sg_Bounty = SGroup_CreateIfNotFound("sg_Bounty")
sg_Kicker = SGroup_CreateIfNotFound("sg_Kicker")
sg_temp = SGroup_CreateIfNotFound("sg_temp")

g_playerToRewardForSquadWhipe = player1
g_playerEnemyAI= player2
g_HasSyncWeapon = false
--g_vehKillCount = 0


--these multipliers will be applied on the base "cost" value for each resource type
g_MunitionMultiplier = 1
g_ManpowerMultiplier = 0.8
g_FuelMultiplier = 0.2


--"+%1AMOUNT%:MP\n +%2AMOUNT%:MU\n +%3AMOUNT%:FU" or $uniqueModID:lineInLocaleLanguageFile"
--g_textString = "$024741c43f0f47a783f888eaf1983d4a:3"
t_Bounty = {
cost = {
--bounty reward for:
--basic infantry.
basicInf = 15,
--elite infantry.
eliteInf = 25,
--light and medium vehicles.
LMVeh = 55,
--buildings and team weapons.
TWorBuilding = 75,
--"heavy medium" and heavy vehicles.
MHVeh = 100,
},
}
t_Bounty.BountyRewards = {
--infantry
{
sbp = SBP.AEF.RIFLEMEN_SQUAD_MP,
value = t_Bounty.cost.basicInf,
},
--team weapons
{
sbp = SBP.AEF.M1_57MM_AT_GUN_SQUAD_MP,
value = t_Bounty.cost.TWorBuilding,
teamweapon = true,
},
--vehicles
{
sbp = SBP.AEF.DODGE_WC51_50CAL_SQUAD_MP,
value = t_Bounty.cost.LMVeh,
vehicle = true,
},
}


SGroup_Clear(sg_Bounty)
Rule_AddInterval(Bounty_RuleAdd, 5)

end

Scar_AddInit(BountyInit)

function Bounty_SetSGroupKicker(sgroup)

SGroup_Clear(sg_Kicker)
SGroup_AddGroup(sg_Kicker, sgroup)

end

function Bounty_DeathEvent(squad)

for k, this in pairs(t_Bounty.BountyRewards) do
-- if squad that's dead is a heavyMG or a mortar
if Squad_GetBlueprint(squad) == this.sbp and this.teamweapon ==true then

if g_HasSyncWeapon == false then

Player_AddResource(g_playerToRewardForSquadWhipe, RT_Munition, this.value * g_MunitionMultiplier)
Player_AddResource(g_playerToRewardForSquadWhipe, RT_Manpower, (this.value * g_ManpowerMultiplier))
Player_AddResource(g_playerToRewardForSquadWhipe, RT_Fuel, (this.value * g_FuelMultiplier))
print("Someone killed "..this.value )
if g_textString ~= nil then
local num1 = Loc_ConvertNumber(math.floor(this.value * g_ManpowerMultiplier))
local num2 = Loc_ConvertNumber(math.floor(this.value * g_MunitionMultiplier))
local num3 = Loc_ConvertNumber(math.floor(this.value * g_FuelMultiplier))

local text = Loc_FormatText(g_textString, num1, num2, num3)

UI_CreateColouredPositionKickerMessage( g_playerToRewardForSquadWhipe, Squad_GetPosition( squad ), text, 198, 120, 74, 0)
--UI_CreateColouredPositionKickerMessage( g_playerToRewardForSquadWhipe, Squad_GetOffsetPosition( squad, 5, 5), "teameWeapon", 250, 120, 74, 0)
end
-- switches flag to true so that it skips the next duplicated team weapon squad
g_HasSyncWeapon = true

if Rule_Exists(Bounty_RestoreSyncWeapon) == false then

Rule_Add(Bounty_RestoreSyncWeapon)

end

end
break
elseif Squad_GetBlueprint(squad) == this.sbp then
Player_AddResource(g_playerToRewardForSquadWhipe, RT_Munition, this.value * g_MunitionMultiplier)
Player_AddResource(g_playerToRewardForSquadWhipe, RT_Manpower, (this.value * g_ManpowerMultiplier))
Player_AddResource(g_playerToRewardForSquadWhipe, RT_Fuel, (this.value * g_FuelMultiplier))
print("Someone killed "..this.value )
if g_textString ~= nil then
local num1 = Loc_ConvertNumber(math.floor(this.value * g_ManpowerMultiplier))
local num2 = Loc_ConvertNumber(math.floor(this.value * g_MunitionMultiplier))
local num3 = Loc_ConvertNumber(math.floor(this.value * g_FuelMultiplier))
--"+%1AMOUNT%:MP\n +%2AMOUNT%:MU\n +%3AMOUNT%:FU"
local text = Loc_FormatText(g_textString, num1, num2, num3)
UI_CreateColouredPositionKickerMessage( g_playerToRewardForSquadWhipe, Squad_GetPosition( squad ), text, 198, 120, 74, 0)
--UI_CreateColouredPositionKickerMessage( g_playerToRewardForSquadWhipe, Squad_GetOffsetPosition( squad, 5, 5), "squad", 250, 120, 74, 0)
end
-- track the number of vehicles the player has killed for the first mission
if this.vehicle == true then

if g_vehKillCount ~= nil then
g_vehKillCount = g_vehKillCount + 1
local textKill = ("Vehicles Killed: "..g_vehKillCount )
--UI_CreateColouredPositionKickerMessage( g_playerToRewardForSquadWhipe, Squad_GetOffsetPosition( squad, 6, 6), textKill, 250, 120, 74, 0)
end

end
break
end
end

end

function Bounty_RestoreSyncWeapon()
-- restores the flag so that the next sync weapon equipped squad can be counted
if g_HasSyncWeapon == true then

g_HasSyncWeapon = false
Rule_RemoveMe()
end

end

function Bounty_RuleAdd()

SGroup_Clear(sg_temp)
Player_GetAll(g_playerEnemyAI, sg_temp)
SGroup_RemoveGroup(sg_temp, sg_Bounty)

if SGroup_IsEmpty(sg_temp) == false then
Rule_AddSGroupEvent(Bounty_DeathEvent, sg_temp, GE_SquadKilled)
end

SGroup_AddGroup(sg_Bounty, sg_temp)

end
7 Aug 2015, 21:47 PM
#2
avatar of Sirlami
Donator 11

Posts: 422 | Subs: 3

Very nice feature!
9 Aug 2015, 01:54 AM
#3
avatar of IronMedic

Posts: 318

Added a download to the full script, and a quite simple tutorial.
1 user is browsing this thread: 1 guest

SHOUT IT OUT!

No ProfanityNumber of ShoutsRefresh Shout Box
aerafield: @LimaOscarMike I would say nowadays is a decent time to try CoH3. If you loved CoH2 however, there is a solid chance you're gonna dislike CoH3
Yesterday, 17:04 PM
LimaOscarMike: My laptop can't even run COH3. Should I get them on my Series X or is it dead yet?
Last Saturday, 05:10 AM
Rosbone: One of my last major gripes about Coh3. Price is still too high I feel for growth. But progress is always good.
Last Saturday, 04:43 AM
Rosbone: I am not 100% sure but I think Relic actually fixed up the skirmish menus a little last patch. If so, thank you and keep it coming.
Last Saturday, 04:39 AM
Osinyagov: Suddenly, coh2 is slowly dying, but you can play it, playerbase still big enough
09 Apr 2025, 17:00 PM
Osinyagov: Wow, i remember you from zansi and vali videos, good old memories
09 Apr 2025, 16:58 PM
Beinhard: o7 miss this game and zansi
09 Apr 2025, 14:09 PM
Lady Xenarra: @Willy Pete The lack of April Fools this year is odd lol
02 Apr 2025, 01:34 AM
Willy Pete: @Rosbone not dead yet. when that happens the font will switch to Papyrus :*(
02 Apr 2025, 00:16 AM
dasheepeh: it was an honor guys :guyokay:
01 Apr 2025, 20:34 PM
aerafield: yeah I already prepared my "Can't believe there's comic mode for the 10 daily visitors even on this April 1st" :guyokay:
01 Apr 2025, 20:29 PM
Rosbone: @dasheepeh I guess that means this site is officially dead :guyokay:
01 Apr 2025, 20:19 PM
dasheepeh: no comic sans font for april 1st this year?
01 Apr 2025, 19:56 PM
Willy Pete: @Lady Xenarra this you? https://i.imgflip.com/3e4thi.jpg
01 Apr 2025, 02:53 AM
Lady Xenarra: Does anyone else think that USF needs buffs? It feels like they’re on life support sometimes
01 Apr 2025, 02:36 AM
Willy Pete: @Rosbone Ahh I missed that memo. I still think its a bad decision though. Adds frustration for players and isnt gonna make them that much money
27 Mar 2025, 15:46 PM
Rosbone: It is also good they left it free until after the free to play weekend. Points for that.
27 Mar 2025, 09:34 AM
Rosbone: But I agree, the cost to get a full decent Coh game pushing $115 US is not the best idea. Especially when it needs so much more work for casuals.
27 Mar 2025, 09:32 AM
Rosbone: To be fair, it was a thank you to early fans right? They said it was not free for long and it would become a pay DLC at some point.
27 Mar 2025, 09:30 AM
Willy Pete: Re-releasing free DLC so they can charge new players money for it. Brilliant marketing strategy :clap:
27 Mar 2025, 04:31 AM
Soheil: Coh2 still broken server ?
25 Mar 2025, 18:27 PM
Rosbone: Congrats to Relic. Looks like Coh3 has finally usurped Coh2 s the popular Coh. You smell terrific. :snfQuinn:.
24 Mar 2025, 02:46 AM
Nickbn: and again someone else replies. I mean come on guys. Give @adamírcz a chance
22 Mar 2025, 14:00 PM
Willy Pete: @Nickbn you didn't ask a question, and this is a chat box...
20 Mar 2025, 13:11 PM
Nickbn: @Rosbone it's incredibly rude to speak on someone elses behalf, especially when a question is directly adressed to them. I understand your passion for the subject at hand but I want to hear from him.
20 Mar 2025, 10:16 AM
Rosbone: @Nickbn No, I am just saying people should not be using any Relic owned forum since they have proven they ban anyone who says true things about Coh3.
18 Mar 2025, 19:01 PM
Nickbn: @Rosbone do you speak on his behalf? I didn't know. In that case keep us updated please.
18 Mar 2025, 16:47 PM
Rosbone: #RelicModdedEchoChamber
16 Mar 2025, 17:54 PM
Rosbone: @Nickbn True except, the only people on the Relic Discord/Reddit/Steam are brain washed monkey zealots. They wont even understand what @adamírcz is talking about. Anyone else is banned.
16 Mar 2025, 17:54 PM
Nickbn: @adamírcz might be a better idea to voice this to relic directly than to voice it here, in a shoutbox of a nearly deade fansite #justsaying...
16 Mar 2025, 16:36 PM
webdesign-muenchen-w: @Rosbone it is sick
14 Mar 2025, 22:09 PM
aerafield: @adamírcz aren't the first two disconnects free every day?
14 Mar 2025, 19:26 PM
Rosbone: It is so unlike Relic to punish its fans and community.
14 Mar 2025, 12:07 PM
adamírcz: So, I just got a leaver penalty without even getting onto the loading screen because of the game disconnecting, bravo Relic
14 Mar 2025, 10:45 AM
Rosbone: It is an indicator of the very short sighted capitalist view that plagues any company where leadership does not understand the product.
13 Mar 2025, 20:00 PM
Rosbone: They dont care about Coh3 or Coh in general. They are just trying to grab cash by ripping off the small user base they have.
13 Mar 2025, 19:58 PM
Rosbone: Just making mistake after mistake after mistake.
13 Mar 2025, 19:57 PM
Rosbone: It is clear they crapped out an unfinished game. And are now barely supporting it as they make new smaller games. Coh3 is stillborn. It will be meh for at least another 2-4 years. Meaning they killed the whole franchise instead of growing it.
13 Mar 2025, 19:56 PM
Rosbone: For a thing they could fix in minutes. Literally minutes.
13 Mar 2025, 19:53 PM
Rosbone: If I did play coh3 and was mainly a skirmish player, I would be pissed and probably stop playing. And it has been like this since release. Why? I would not tell my friends to buy a game I am not even playing. Lost sales and angered users.
13 Mar 2025, 19:53 PM
Rosbone: I am just saddened how Relic keeps hurting themselves by not fixing 5 minute things like menus. Why anger users with stuff that could be fixed in minutes???
13 Mar 2025, 19:50 PM
Rosbone: I was wondering why people think I was raging. I think it was when I said "because coh3 sucks so bad". That was not my opinion. Just a general feel from top players/streamers. I dont play Coh3 and have NO opinion of it.
13 Mar 2025, 19:48 PM
OKSpitfire: You can rage as often as you like btw, you usually manage to make it pretty funny.
12 Mar 2025, 11:18 AM
Rosbone: So it was a systemic failure across multiple disciplines and check points.
12 Mar 2025, 04:30 AM
Rosbone: Knowing how companies work, I imagine a new hire making the menus. The API they are using is complicated and things were hard to figure out. But at some point QA or management should have addressed these things. Usually within 6 months of starting.
12 Mar 2025, 04:29 AM
Rosbone: @theekvn I dont hate Coh3 or Relic. I just dont understand how you work on Coh3 for like 7 years and the menu system is worse than if a Programming 101 student made it. Feel free to explain it to me.
12 Mar 2025, 04:07 AM
theekvn: + 33% dmg rear hit was best deal ever.
12 Mar 2025, 04:00 AM
theekvn: KT just need fuel debuf from 15% to 50%, Ele arc of fire- aim time improve and they are good to go
12 Mar 2025, 03:59 AM
theekvn: and please Rosbone,I know you hate Coh3 to the bone due to your drama with relic, Still, Can you give a proper point of view instead of raging ?.
12 Mar 2025, 03:54 AM
theekvn: you rather go 76 to unity Whizbang 2.0 or go home.
12 Mar 2025, 03:52 AM
theekvn: also US tier 4 is 145f and Sherman pen 140 nerf is too much.
12 Mar 2025, 03:52 AM
theekvn: Whizbang lock behind CP, meanwhile stuka is techtree progress
12 Mar 2025, 03:51 AM
KoRneY: @aerafield It's possible that it is underpriced for what it is capable of now, no need to go full retard and take it immediately as a massive problem. It costs 60 more MP than a pz.3 and in 2v2 the barrage can be quite strong.
07 Mar 2025, 19:14 PM
OKSpitfire: I do like that they made the Stuka more expensive instead of nerfing it into the ground though. Found it pretty unsatisfying to use before that buff a while back....
06 Mar 2025, 16:35 PM
aerafield: USF already is by far the shittiest faction in terms of countering blobbing and turtling, now they supposedly have one overtuned tool locked behind a BG and it's immediately a massive problem?
06 Mar 2025, 13:33 PM
Lady Xenarra: I think post-2.0 Whizbang buffs, the price is too low esp since the Stuka got nerfed in cost too. Speaking of which, how exactly is one supposed to successfully dive this Sherman in disguise? Med tank spam running into SSFs?
06 Mar 2025, 12:13 PM
OKSpitfire: A powerful, doctrinal unit that outperforms stock stuff? Colour me shocked! :P
06 Mar 2025, 10:49 AM
Willy Pete: Cool you wanna lose your stock lategame arty too then?
06 Mar 2025, 03:20 AM

Livestreams

unknown 230
unknown 10
unknown 2

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

543 users are online: 543 guests
0 post in the last 24h
6 posts in the last week
37 posts in the last month
Registered members: 53864
Welcome our newest member, Gpinfski33
Most online: 2043 users on 29 Oct 2023, 01:04 AM