Login

russian armor

blueprint name for new squad or entity?

17 Jul 2015, 07:05 AM
#1
avatar of trigg

Posts: 139

For a map script I want to see whether a mod is in use, and the first way that occurs to me is to use EBP_Exists for some custom entity in the mod. I've seen the instructions for prepending your mod's ID to the entity's name, but I don't see how to specify the entity's name so that the script can find the blueprint.

I see that the Attribute Editor will let you export luaconstsauto.scar for the mod, but it does not have the new entities and squads in it.

Anyone know how to reference a new squad or entity from a script?
17 Jul 2015, 12:52 PM
#2
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

Your mod's ID (without dashes), then a colon, then the blueprint.

Example:
Code
BP_GetSquadBlueprint("94e80b04a136401b963d3806d5b13ef4:fuesilier_squad_mp")
17 Jul 2015, 17:57 PM
#3
avatar of trigg

Posts: 139

I was wondering how to find the name of "fuesilier_squad_mp". Without a faction, there could be duplicates.

However, I think I can use World_GetPossible{Squads,Entities}Blueprint to iterate over everything in the mod, and output the blueprint names. I'll probably try that tonight.
17 Jul 2015, 18:36 PM
#4
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

Blueprints are unique per type (squad, entity, etc), and per mod (presumably).

Here is a utility function you might find useful:

-- @param  blueprintFunction  Relic function that will retrieve a blueprint
-- @param blueprintName Name of the blueprint to be retrieved
-- @return blueprint if it exists; nil otherwise
function getBlueprintIfItExists(blueprintFunction, modID, blueprintName)
local exists, blueprint = pcall(blueprintFunction, modID .. ":" .. blueprintName);

if ( exists == false ) then
blueprint = nil;
end

return blueprint;
end


Usage:
local squadBlueprint = getBlueprintIfItExists(BP_GetSquadBlueprint, "94e80b04a136401b963d3806d5b13ef4", "fuesiliers_mp");

if ( squadBlueprint ) then
-- do stuff with squadBlueprint
end


You could wrap it further like so:
function getSquadBlueprintIfItExists(modID, blueprintName)
return getBlueprintIfItExists(BP_GetSquadBlueprint, modID, blueprintName);
end
17 Jul 2015, 22:36 PM
#5
avatar of trigg

Posts: 139

So if one faction has ...whatever...\combat_engineers in its archive, there won't be a ...somethingelse..\combat_engineers ? And you can just use "combat_engineers" as the short blueprint name?
18 Jul 2015, 02:09 AM
#6
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

18 Jul 2015, 02:33 AM
#7
avatar of trigg

Posts: 139

Great, thanks!
1 user is browsing this thread: 1 guest

SHOUT IT OUT!

No ProfanityNumber of ShoutsRefresh Shout Box
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

Livestreams

unknown 20
Australia 1

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

337 users are online: 337 guests
0 post in the last 24h
3 posts in the last week
47 posts in the last month
Registered members: 53741
Welcome our newest member, Cobell50
Most online: 2043 users on 29 Oct 2023, 01:04 AM