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?
			blueprint name for new squad or entity?
									17 Jul 2015, 07:05 AM
				
	#1					
								
					
				
		
Posts: 139
									17 Jul 2015, 12:52 PM
				
	#2					
								
					
				
		
 
    		            							
			    		Posts: 756 | Subs: 8
Your mod's ID (without dashes), then a colon, then the blueprint.
Example:
			
		Example:
Code
BP_GetSquadBlueprint("94e80b04a136401b963d3806d5b13ef4:fuesilier_squad_mp")
									17 Jul 2015, 17:57 PM
				
	#3					
								
					
				
		
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.
			
		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					
								
					
				
		
 
    		            							
			    		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:
Usage:
You could wrap it further like so:
			
		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;
endUsage:
local squadBlueprint = getBlueprintIfItExists(BP_GetSquadBlueprint, "94e80b04a136401b963d3806d5b13ef4", "fuesiliers_mp");
if ( squadBlueprint ) then
	-- do stuff with squadBlueprint
endYou could wrap it further like so:
function getSquadBlueprintIfItExists(modID, blueprintName)
	return getBlueprintIfItExists(BP_GetSquadBlueprint, modID, blueprintName);
end
									17 Jul 2015, 22:36 PM
				
	#5					
								
					
				
		
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					
								
					
				
		
 
    		            							
			    		Posts: 756 | Subs: 8
Exactly.
			
		
									18 Jul 2015, 02:33 AM
				
	#7					
								
					
				
		
Posts: 139
Great, thanks!
			
		PAGES (1)
		
	1 user is browsing this thread: 
	1 guest	
	
		
	
Livestreams
|   |   |   | 95 | ||
|   |   |   | 61 | ||
|   |   |   | 12 | ||
|   |   |   | 2 | 
Ladders Top 10
- 
							#Steam AliasWL%Streak
- 1.46467.874+6
- 2.794136.854-1
- 3.14465.689-1
- 4.21154.796+4
- 5.400212.654+2
- 6.296127.700+2
- 7.353186.655+2
- 8.501325.607+4
- 9.327117.736+4
- 10.857232.787+4
Replay highlight
VS
					- 
									 cblanco ★ cblanco ★
- 
									 보드카 중대 보드카 중대
- 
									 VonManteuffel VonManteuffel
- 
									 Heartless Jäger Heartless Jäger
 
											
						Einhoven Country
						
							
								
									 
								
								 
								
								
				 
								
								Honor it
								15
							
						
						
												
							
								
									 
								
								Download
								2705
							
						
												
					Board Info
						888 users are online:
									888 guests
					
		
			1 post in the last 24h
1 post in the last week
23 posts in the last month
		
		1 post in the last week
23 posts in the last month
			
			
				Registered members: 61833
Welcome our newest member, 32winhost
Most online: 4501 users on 26 Oct 2025, 01:00 AM
	Welcome our newest member, 32winhost
Most online: 4501 users on 26 Oct 2025, 01:00 AM
 
	 
			 
			 
  
  
  
										 
									
 
  
						 
						 
						 
						 
						 
						 Relic Entertainment
						 Relic Entertainment