Frobbing: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
No edit summary
Line 25: Line 25:
= Using items on other items =
= Using items on other items =


* '''used_by''' UsedBy ist the list of entity names that this entity can be used by. i.e. A door can have a list of keys that can unlock it. A fountain can be used by a water arrow to make it holy, etc. The list is initialized by the key "used"_by" in the entity and contains the names of the entities seperated by ';'. If the first character of the name is a '*' the name donates a classname instead of an entity. In this case all entities of that class can be used by this entity.
* '''used_byN''' (with N being a number) UsedBy ist the list of entity names that this entity can be used by. I.e. a door can have a list of keys that can unlock it or a fountain can be used by a water arrow to make it holy, etc. The list is filled with values of the keys "used_byN" on the entity - for instance: "used_by", "used_by1", "used_by2" etc. (it's just important that the prefix "used_by" is there). Each spawnarg contains the name of an entity.


Example: If you have several holy fountains you would have to list all fountain names. Alternatively you can create a "holy_fountain" class and list it like this: "used_by" & quot;*holy_fountain;*holy_bottle;holy_cr
oss" In this example the entity can be used by any holy_fountain, any holy_bottle and addtionaly by the entity named holy_cross.
NOTE: If the item is frobbed without having selected any of the "used by" entities, the normal frob_action-script will be called on the entity.
NOTE: An item that can be used on another item (like a key), must also have the spawnArg "usable" set to "1" in order to use it on something else.
NOTE: An item that can be used on another item (like a key), must also have the spawnArg "usable" set to "1" in order to use it on something else.


[[Category:Editing]]
{{editing}}

Revision as of 16:34, 30 June 2008

Player Settings

Cvars

  • cv_frob_width: When a ray trace along the line the player is looking does not hit a frobable item directly, a box is created around the item. This setting is 1/2 the width of that box (in doomunits). I.e. it creates a cube with sides of length cv_frob_width * 2. Current default is 10.

NOTE to mappers: Frob can potentially go thru walls up to the frob width. We will eventually tweak this width and when everyone agrees on a setting that's good, we'll lock it in. At that point, make sure not to set anything closer than that distance to the outer surface of a barrier if you don't want it frobbed thru that barrier. Or, if you absolutely must have something closer than that distance, you can turn frobbing on and off on the items with scripting (see below).

  • cv_frob_fadetime: The time in milliseconds that it takes the frob highlight to fade in and out completely. Default is 100 [ms].

darkmod.ini

In the "[GlobalParams]" section:

  • DefaultFrobDistance=80: This value determines how close you have to be to an item before it will highlight. This value can be overwritten for each item individually (see below) and will only be applied if no value has been specified.

Entity Settings

The following keys control frobbing on individual entities, and should be placed in the entityDef or spawnargs:

  • frobable If set to "1", entity is frobable (default is 0)
  • frob_distance Distance (in doomunits) at or below which the entity may be frobbed.
  • frob_bias When no item is directly hit by the frob raytrace, and several items are within the frobdistance, an item is selected based on how close it is to dead ahead along the center of your view. Setting frob bias biases one item over others in this case, allowing it to be a bit farther off-center but still highlight. This can make it easier to frob small items (like coins) when they are next to larger items. The frob bias multiplis the measure of how close it is to the center of your screen. E.g., a frob bias of 1.5 means you can move your "focus" 50% farther towards another item (which has bias 1.0) and the 1.5 bias item will still be selected. Default is 1.0.
  • snd_acquire Name of the soundshader to play when the entity is "used" while frobbed. (NOTE: Maybe we should change the name of this to snd_frob or snd_frobaction or something?)
  • frob_action_script String name of the script that will be called when an item is frobbed. Note that you must specify the scope to call the script in. If it's on the same entity, you should use "<name of entity scriptobject>::<function>". Similarly, if the script to call is within the namespace of a map, you should use "<map namespace>::<function>". Otherwise, just inputting "<function>" will call a global scriptfunction.
  • frob_peer_<N> Determines what other ents shoud hilight when this ent is hilighted. For each ent you want to hilight, put in a key of the form "frob_peer_<N>" with value: "<entity name>". If you just want one frob peer, putting in "frob_peer" is also fine, but multiple frob peers must have the form "frob_peer_*". NOTE: Currently this only works to propagate the hilight. The frob action when you hit "use" is not propagated to all entities within a frob peer group. This is handled by setting "frob_master" described below.
  • frob_master Set to the name of an entity. This is used to propagate the frob action to other entities when one frobbed entity is used. It sets up a chain, and frobbing any link in the chain will call the frobaction on the whole chain.

Using items on other items

  • used_byN (with N being a number) UsedBy ist the list of entity names that this entity can be used by. I.e. a door can have a list of keys that can unlock it or a fountain can be used by a water arrow to make it holy, etc. The list is filled with values of the keys "used_byN" on the entity - for instance: "used_by", "used_by1", "used_by2" etc. (it's just important that the prefix "used_by" is there). Each spawnarg contains the name of an entity.

NOTE: An item that can be used on another item (like a key), must also have the spawnArg "usable" set to "1" in order to use it on something else.