Custom Half-Life 2 .fgd Help

Mapster

Newbie
Joined
Feb 16, 2005
Messages
357
Reaction score
0
Hey all,

I've been working on a mod for half-life 2 in secret for a couple months now with a couple problems which I've been able to overcome via tutorials and other help adds around, but this error just keeps coming back and biting me in the *** every time.

The entity in the .fgd is a modified version of the item_item_crate but with 2 Item Classes to spawn instead of 2 so someone and input 2 different items which the crate can spawn when it's broken instead of 1, .fgd code below.

@PointClass base(BasePropPhysics, Targetname, Angles, DamageFilter, BaseFadeProp) studio("models/items/item_item_crate.mdl") = item_item_crate : "Item Crate"
[
ItemClass(choices) : "Item Type #1" : "item_dynamic_resupply" : "Class name of the random entity to spawn ( 'Skip' will set self to 0 on

selection )" =
[
"0" : "Skip"
"item_ammo_357" : "item_ammo_357"
"item_ammo_ar2" : "item_ammo_ar2"
"item_ammo_ar2_altfire" : "item_ammo_ar2_altfire"
"item_ammo_crossbow" : "item_ammo_crossbow"
"item_ammo_pistol" : "item_ammo_pistol"
"item_ammo_smg1" : "item_ammo_smg1"
"item_ammo_smg1_grenade" : "item_ammo_smg1_grenade"
"item_battery" : "item_battery"
"item_box_buckshot" : "item_box_buckshot"
"item_healthkit" : "item_healthkit"
"item_healthvial" : "item_healthvial"
"item_item_rpg_round" : "item_rpg_round"
"item_dynamic_resupply" : "item_dynamic_resupply"
"item_battery" : "item_battery"
"weapon_357" : "weapon_357"
"weapon_ar2" : "weapon_ar2"
"weapon_crossbow" : "weapon_crossbow"
"weapon_crowbar" : "weapon_crowbar"
"weapon_frag" : "weapon_frag"
"weapon_physcannon" : "weapon_physcannon"
"weapon_pistol" : "weapon_pistol"
"weapon_rpg" : "weapon_rpg"
"weapon_shotgun" : "weapon_shotgun"
"weapon_smg1" : "weapon_smg1"
]

ItemCount(integer) : "Item Count #1" : 1 : "Number of items to emit upon breakage"
SpecificResupply(target_destination) : "Specific resupply #1" : "" : "If item type is item_dynamic_resupply, specify a specific one to use

instead of the master"

ItemClass2(choices) : "Item Type #2" : "0" : "Class name of the random entity to spawn ( 'Skip' will set self to 0 on selection )" =
[
"0" : "Skip"
"item_ammo_357" : "item_ammo_357"
"item_ammo_ar2" : "item_ammo_ar2"
"item_ammo_ar2_altfire" : "item_ammo_ar2_altfire"
"item_ammo_crossbow" : "item_ammo_crossbow"
"item_ammo_pistol" : "item_ammo_pistol"
"item_ammo_smg1" : "item_ammo_smg1"
"item_ammo_smg1_grenade" : "item_ammo_smg1_grenade"
"item_battery" : "item_battery"
"item_box_buckshot" : "item_box_buckshot"
"item_healthkit" : "item_healthkit"
"item_healthvial" : "item_healthvial"
"item_item_rpg_round" : "item_rpg_round"
"item_dynamic_resupply" : "item_dynamic_resupply"
"item_battery" : "item_battery"
"weapon_357" : "weapon_357"
"weapon_ar2" : "weapon_ar2"
"weapon_crossbow" : "weapon_crossbow"
"weapon_crowbar" : "weapon_crowbar"
"weapon_frag" : "weapon_frag"
"weapon_physcannon" : "weapon_physcannon"
"weapon_pistol" : "weapon_pistol"
"weapon_rpg" : "weapon_rpg"
"weapon_shotgun" : "weapon_shotgun"
"weapon_smg1" : "weapon_smg1"
]
ItemCount2(integer) : "Item Count #2" : 0 : "Number of items to emit upon breakage"
SpecificResupply2(target_destination) : "Specific resupply #2" : "" : "If item type is item_dynamic_resupply, specify a specific one to use

instead of the master"
]

In the code I've run a loop when spawning the items class string which checks if the item spawning is not "NULL_STRING" then it will spawn the item... but regardless it still tries to spawn the item and gives me an error saying "Unable to create unknown entity 0" when someone chooses the option "Skip" in hammer.

Anyone else come across the error before and know how to fix it?

Cheers,
Mapster
 
working on it

edit: i came up with these (i tried some other stuff to get it working, but no luck)

-you can make ItemClass, string based:

ItemClass(string) : "Item Type #1" (you can enter any value you want, give it a try)

-you can parent a npc_maker (or func_breakable) to your item_item_crate for secondary item (does this even work? parentname makes npc_maker won't work for me)
 
The itemclass type doesn't matter what will will be, its imported as a string in the code anyway, the type in the .fgd just gives the user options to cvhoose from.

I changed the 0 to "None" and used the "Q_stricmp" command to compare the string to None and that made it work.

Thanks for the reply though.
 
Back
Top