[ News | About | Media | Downloads | Tutorials | Contact ]

News

Latest News | Previous Article | Next Article

13 September 2015 - Custom Items

A bit of bad news. My PC kind of exploded, though I am bit a bit over dramatic when I say that. When I tried to turn it on I got light flash inside the case and another time I got sparks coming out from the back. Luckily, all my data is multiple times backed up so there's been no data loss. Only a bit of time lost since I have been spending the last week watching Netflix rather than doing any serious work. Can still do some work on my laptop, but I trying to calculate if I can afford to buy a new PC or not.

Meanwhile, here's some overly technical details about how custom items work in From Earth. Posting this to hear any comments or suggestions.

Item customization

When I say "custom item" or customizable I usually mean something that is not hard coded. A lot of the items with more complicated or specific functions in From Earth have hardcoded models and can't be changed by Level Designers without overriding the model completely. There's few classes, though, that allow the Level Designers to select the model for the item. Because of this, by "Custom Item" I mean items that can be either customized by myself, level designers, or later on possible modders of FE without needing additional programming.

Items such as Helmets and Goggles allow custom models, the modeller can define few values including: FOV when worn, color correction when worn, its armour value, if it protect the player from gas, and other special functions.

Melee weapons such as Swords and Sticks can have few settings defined: The Length, damage scale, speed, tip size, if it's meant to be used as a weapon, and what type of damage it does (slash or club).

All of this data is written in the $keyvalues section of the model .qc file. Goggles, Helmets, Swords, and Sticks all use a specific animation set that can't be changed by the modeller.

hlss_item

The "custom item" model called the "hlss_item" entity has more customization options, but they can't be used for specific functions, or as weapons, at least not yet. All of these settings need to be included in the "hlss_settings" suction. The hlss_item entity class is a multi purpose class, it's there not only to replace the default item class from HL2, but also to replace prop_physics to some extent.

"animations"
First there's the animations set. Item / Weapon animations work differently in From Earth than in HL2. HL2 used activity tables specific for a weapon class, but instead of this I used one big table that defines all the basic activities (idle, walk, run, holster, deploy, drop, pickup, examine, etc.). The items refer to the animation set simply by its index in the table. In the keyvalues you simply refer to the name of the animation set and you don't have to worry about it knowing which animation to play. There's currently 21 unique animation sets.

"collisiongroup" Most items use the collision group "item". Items wont and shouldn't collide with the player or the NPCs as they can otherwise cause problems blocking the player from using interactive machines. If your item is really big, though, you can still make them collide with the player.

"energy"
What is the market value of the item in the alien shops. Value from 0.05 to 1.

"scanned"
If the item can be scanned.

"disintegrated"
If the item can be disintegrated.

"created"
If the item can be created with vending machines.

"explode_damage"
How much damage does it do when and if it explodes.

"explode_radius"
Explosion radius. "merge_scale"
If the item is merged with another, how should we scale this prop to better fit.

"health"
You can define collisiontext for the model and make it breakable. Items that are breakable can't be created with vending machines.

"id"
Item ID refers to the system that allows the aliens to identify specific objects. This has very limited use in terms of custom items, as most item IDs are meant for hard coded items. Adding a new item ID would mean having to record a voice explanation for the item name by the three voice actors.

"holster"
Only some animation sets have holstering animations, though I have been trying to add them to every set I can. The model needs to have an attachment defined where to put the item when it is holstered. Usually this has the same name as the animation set.

hlss_shoes

Shoes are also a subclass of "hlss_item". They can have more customization.

"speed"
How fast or slow the shoes make you. Value from 0.5 to 1.5.

"bodygroup"
What bodygroup to use for Zenaida's legs (whether or not to hide part of them).

"damagescale"
Shoes can increase or lower the damage you do when kicking.

"wallrunning"
Side-wall-running is disabled normally, but special shoes can re-enable it.

"icon"
Limited ability to have a specific icon appear on the HUD. Doesn't really offer much help for modders.

"model"
The model to change to when the shoes are worn.

Custom Buttons

Items can have buttons defined for them. Right now it's not possible to define functions for custom items. Custom items can for example use the sword animation settings and have buttons that use the sword attack animation, but they wont do any damage since they don't have that built in them.

Adding an input output system would be problematic since if you disintegrate and then recreate that item, the input output data would be lost. Optionally if level designers had the inputs be dependent of entities other than the item themselves, it could create problems if the players would carry those items into another map. I am also not a fan of using the input output system excessively in general.

I have been thinking about adding a list of functions custom buttons could do, but I am not sure yet how it should work and what kind of list of functions I should add.

Buttons need to be defined in the "hlss_buttons" section.

"attachment"
Name of the attachment where to show the button when examining the item.

"type"
What type of button it is: "normal", "right", "left", "hold", "aim", "custom", "monitor", "knock", "open", "close", "invisible". Most of them only affect how they show up when examining the item, but "aim" and "hold" also change how they behave.

"hitbox"
Kind of redundant and not required. Used to define a box around the attachment to help position the examine arrows.

"activity1"
The start activity for the button. Can be custom activity name.

"activity2"
The loop activity for the button. Not required.

"activity3"
The stop activity for the button. Not required.

"item_prop"
If the button requires to have a specific prop model attached to the user to use this button. For example: You could define a lighter item that requires a cigarette model to be attached on the mouth for the player to use the lighter.

"item_prop" - "model"
Name of the model that needs to be attached. Modelnames like "models/items/cigarette01.mdl" and "models/items/cigarette02.mdl" are understood as the same model.

"item_prop" - "attachment"
Only accept models that are attached to this attachment.

"item_prop" - "effect"
Only accept models that have this effect enabled.

"item_prop" - "reverse"
Reverse the condition. For example, only allow the player to use the cigarette case if they don't already have a cigerette in their mouth.

"item_prop" - "search_operator"
If we should check the item or the operator for the item prop. By default yes.

"item_prop" - "required_for_npcs"
For example, the player can still open the cigarette case even if they have a cigerette, but an NPC should not open it if they already have one.

"bored_use"
If the NPC should try to use this machine when they are bored. The NPC wont even go through the button requirements if this is set to false. By default this is disabled.

"required_state"
State the item needs to be in order for the player or NPC to use this button. For example, to take a cigerette, the cigarette case needs to be open.

"state"
Set the item into this state when this button is in its loop animation. For example, the player opens the cigarette case, starts playing the ACT_CIGARETTES_LOOP activity and can then use the button to take a cigerette.

hlss_states

You can define specific states for the item to be when it's used. This all need to be in the "hlss_states" section:

"next" Go to this state after finishing this one. By default goes back to not-working state.

"time"
How long to stay in this state. If zero stays in this state forever until another input.

"energy" Custom interactive machines can have required energy defined. Not yet implemented for items.

"output"
Which output to fire when the state is ended.

"loop_sound"
Loop this sound while the state is active.

"start_sound"
Sound to play when this state is started.

"stop_sound"
Sound to play when this state ends.

"anim_start"
Activity to play when the item starts this state. Is overriden by the player activity if the item has that activity.

"anim_loop"
Activity to play when the item loops this state. Is overriden by the player activity if the item has that activity.

"anim_stop"
Activity to play when the item stops this state. Is overriden by the player activity if the item has that activity.

"default"
Consider this the "default" state. Can be used to play sounds or such when no buttons are used.

Example Cigarette case


$keyvalues
{ 
	"hlss_settings"
	{
		"animations" 	"holodisc"
		"collisiongroup"	"item"
		"energy"		"1"
		"scanned"		"1"
		"disintegrated"	"1"
		"holster"		"Holodisc"
		"bored_use"	"1"
	}

	"hlss_buttons"
	{
		"Open"
		{
			"attachment"	"Button"
			"type"		"normal"

			"state"		"open"
			"activity1"		"ACT_CIGARETTES_OPEN"
			"activity2"		"ACT_CIGARETTES_LOOP"
			"activity3"		"ACT_CIGARETTES_CLOSE"
		}

		"Smoke"
		{
			"attachment"	"Cigarette"
			"type"		"normal"

			"required_state"	"open"
			"activity1"		"ACT_CIGARETTES_SMOKE"

			"item_prop"
			{
				"model" "models/items/cigarette01.mdl"
				"reverse" "1"
				"required_for_npc" "1"
			}
		}

		"Drop"
		{
			"attachment"	"Cigarette"
			"type"		"invisible"
			"text"		"FE_DropCigarette"

			"activity1"		"ACT_CIGARETTES_DROP"

			"item_prop"
			{
				"model" "models/items/cigarette01.mdl"
				"reverse" "0"
			}
		}
	}

	"hlss_states"
	{
		"open"
		{
			"anim_loop"		"ACT_CIGARETTES_LOOP"
			"anim_stop"		"ACT_CIGARETTES_CLOSE"
		}
	}
}

Merging Items

Merging items or the "crafting system" is another thing I could talk about. It adds functionality to custom items, though even there the list of things you can do is finite. Just like the custom buttons in items, it's still stub, and wait for some kind of inspiration to see how I can improve it and add more. I will write a bit about the Item Merging later on.

Looking for help

We are still looking for people. If you are interested to apply, you can send me a message on Moddb, Twitter, Facebook, or e-mail me at au-heppa@hlssmod.net.

Composer
We are looking for a composer to help finish the music for From Earth.

Other
We are interested on getting any help we can get, especially world texture creators and prop modellers.



  



by Au-heppa
Permalink: http://hlssmod.net/index.php?page=0&news=43

Hide full article list
52.  Friday Update VIII - 13 May 2016
51.  1 April 2016 - Friday Update III
50.  25 March 2016 - Friday Update II
49.  18 March 2016 - Friday Update I
48.  10 March 2016 - Public Beta Released
47.  28 February 2016 - Public Beta Release Date
46.  31 January 2016 - Public Beta
45.  27 September 2015 - Merging Items
44.  20 September 2015 - Teaser Trailer
43.  13 September 2015 - Custom Items
42.  8 April 2015 - Voice Actors, Streams, and Alien Posters
41.  6 December 2014 - Asi pos Ruumste
40.  22 October 2014 - Steam Greenlight
39.  14 June 2014 - Language Barriers
38.  12 February 2014 - Language System
37.  28 December 2013 - Fighting System
36.  6 June 2013 - Level Designers and a Voice Actress
35.  28 April 2013 - Playtesting From Earth
34.  8 April 2013 - Alien AI
33.  18 March 2013 - From The Darkness
32.  4 March 2013 - Climbing System
31.  4 February 2013 - Interaction System
30.  14 January 2013 - First Person
29.  7 January 2013 - What happened to Human Error?
28.  1 January 2013 - From Earth
27.  15 February 2012 - LAST ZOMBIE
26.  16 December 2011 - World Of Water
25.  11 December 2011 - Speech Bubbles
24.  7 December 2011 - Making Of Water Part III
23.  3 December 2011 - Making Of Water Part II
22.  1 December 2011 - Making Of Water Part I
21.  21 November 2011 - A quick look into the making of a gesture
20.  13 November 2011 - Water Released
19.  6 November 2011 - Water Release Date
18.  30 July 2011 - Human Error Source Code Released
17.  6 January 2011 - First Ever Weapon Render
16.  3 December 2010 - Water
15.  26 November 2010 - Controllable Manhacks
14.  28 July 2010 - Alyx Mode and More
13.  14 July 2010 - Human Error Co-op Beta Released
12.  29 May 2010 - Alien Grunt & Controller Give Away
11.  26 April 2010 - He's a frakking Traitor
10.  8 Feb 2010 - Human Error Released
9.  7 Feb 2010 - This Is Larson
8.  29 Dec 2009 - 2010 Trailer
7.  28 Dec 2009 - Super Secret Beta Testing Blog
6.  17 Nov 2009 - Harder, Better, Faster, Stronger
5.  17 Oct 2009 - This Is Noah
4.  23 Jul 2009 - This Is Embarassing
3.  1 Jul 2009 - This Is Au-heppa
2.  17 Mar 2009 - HLSS in Podcast 17
1.  5 Nov 2008 - First Media Release



[ News | About | Media | Downloads | Tutorials | Contact ]



Valve, the Valve logo, Half-Life, the Half-Life logo, the Lambda logo, Steam, the Steam logo, Source, and the Source logo are trademarks and/or registered trademarks of Valve Software. All information is copyright their respective authors. Website designed by Han Solo.