View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005813 | DarkRadiant | GUI | public | 18.11.2021 16:47 | 19.08.2022 15:33 |
Reporter | Dragofer | Assigned To | greebo | ||
Priority | normal | Severity | normal | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.13.0 | ||||
Target Version | 2.14.0 | Fixed in Version | 2.14.0 | ||
Summary | 0005813: Spawnarg types and tooltips not reliably inherited in entityDefs | ||||
Description | When writing an entityDef in a .def file, it's possible to specify the type of a spawnarg, for example: "editor_color color_sweeping" "Color of the camera's spotlight & lens when it has not recently seen something suspicious, default green." This has the following purpose: 1) display a small icon representing what type of spawnarg this is in the entity inspector. 2) display a tooltip in the entity inspector when the "Show help" box is checked. 3) if applicable, provide a "Choose..." button to help set a value for the spawnarg. However, it seems that there's a problem when entities inherit these spawnargs from other entities. In that case, there are the following problems with the inheriting entity: 1) spawnargs are always shown as having the "editor_var" type ("T" icon) instead of what was specified in the entityDef. 2) tooltips are only shown for some spawnargs. I've not been able to discern a pattern here. 3) no "Choose..." buttons are offered for these spawnargs. Spawnargs that are automatically identified based on their prefix, such as skin, skin_lit and skin_unlit, do show the correct icon and offer an appropriate "Choose..." button. | ||||
Steps To Reproduce | Attached is the latest SVN version of the func_securitycamera and atdm:security_camera01 entityDefs, isolated in a .txt file. The latter inherits from the former. 1) Create entity > func_securitycamera. 2) Create entity > atdm:security_camera01. 3) Select the func_securitycamera entity. In the entity inspector, enable "Show inherited properties" and "Show help". 4) Key through the spawnarg list. Almost all spawnargs have tooltips and quite a few (like "color_alerted") have appropriate "Choose..." buttons, as intended. 5) Click on "color_alerted" and click on the checkbox next to the spawnarg field to apply this spawnarg to the entity. Disable "Show inherited properties" to help see that the "color_alerted" spawnarg has the correct type icon (4 coloured squares), then re-enable it again. 6) Deselect func_securitycamera and select atdm:security_camera01. 7) Key through the spawnarg list. Some spawnargs no longer have tooltips (such as "color_alerted" or "follow_constrain_ccw") and none of the spawnargs that were manually identified in the entityDef (such as "color_alerted") have "Choose..." buttons. 8) Click on "color_alerted" and click on the checkbox next to the spawnarg field to apply this spawnarg to the entity. Disable "Show inherited properties" to help see that the "color_alerted" spawnarg is displayed with the editor_var icon ("T" symbol) instead of the colour icon. | ||||
Additional Information | Tested in DR 2.13 and DR 2.14pre1. | ||||
Tags | No tags attached. | ||||
Attached Files | sec_cam.txt (14,715 bytes)
// grayman #4615 - redesigned for 2.06 // Dragofer #5528 - developed for 2.10 entityDef func_securitycamera { "inherit" "atdm:entity_base" "editor_color" "1 .5 .3" "editor_mins" "-4 -4 -4" "editor_maxs" "4 4 4" "editor_rotatable" "1" "editor_displayFolder" "Func" "editor_usage" "Don't use, base class for security cameras. See AI/Machines/Security Camera for properly useable entities." "editor_bool legacy" "Don't use, this designates an old version of the security camera. Affects how some spawnargs are processed." "editor_bool rotate" "1 = camera rotates back and forth, 0 = camera remains stationary." "editor_int sweepAngle" "The amount of horizontal sweep." "editor_float sweepSpeed" "Horizontal rotation speed in degrees per second. If 'legacy' = 1, this instead defines the time in seconds taken to perform one sweep." "editor_float sweepWait" "Length of the pause at the end of a sweep before reversing direction." "editor_bool follow" "Let the camera track the player horizontally. This will make it harder to escape its view." "editor_int follow_tolerance" "How far in degrees the player has to move before the camera readjusts its rotation, horizontally." "editor_float follow_speed_mult" "Speed up horizontal movements by this multiplier when the camera is following the player." "editor_bool follow_incline" "The camera will also track the player vertically." "editor_int follow_incline_tolerance" "How far in degrees the player has to move before the camera readjusts its rotation, vertically." "editor_int follow_incline_speed" "Speed of vertical movements to track the player. Not affected by 'follow_speed_mult'." "editor_int follow_constrain_up" "Limit how far the camera can turn upwards from its starting position when following the player. Set to 90 for no limit." "editor_int follow_constrain_down" "Limit how far the camera can turn downwards from its starting position when following the player. Set to 90 for no limit." "editor_int follow_constrain_cw" "Limit how far the camera can turn clockwise beyond its clockwise position when following the player. Set to 180 for no limit." "editor_int follow_constrain_ccw" "Limit how far the camera can turn counter-clockwise beyond its counterclockwise position when following the player. Set to 180 for no limit." "editor_int scanDist" "How far the camera can see the player." "editor_int scanFov" "Camera's field of view." "editor_bool seePlayer" "1 = camera reacts to the player, 0 = camera ignores the player." "editor_float sight_threshold" "From 0.0 to 1.0, how lit up the player's lightgem has to be for the camera to see him." "editor_float sightTime" "Time taken to become fully alerted by the player and trigger the alarm." "editor_float sightResume" "The camera will wait this amount of time before resuming its regular sweep if it saw the player but didn't become fully alerted." "editor_float alarm_duration" "Minimum duration of the fully alert state. Will be extended by half if the player is in view or was recently seen." "editor_float alarm_interval" "Time between alarm sounds when fully alerted." "editor_float wait" "Don't use, use 'alarm_duration' instead." "editor_bool trigger_alarm_start" "Trigger targets when an alarm begins." "editor_bool trigger_alarm_end" "Trigger targets when an alarm ends." "editor_bool start_off" "Camera starts powered off." "editor_int modelAxis" "0, 1 or 2 based on which axis the source model was built on." "editor_bool flipAxis" "Set to 1 to flip the model axis of the cam." "editor_vector viewOffset" "Offset at which the camera's 'eye' is placed. Should be outside the visual model so it doesn't block its own view." "editor_vector lightOffset" "Offset at which the camera's spotlight is placed. Should be outside the visual model so it doesn't block its own spotlight." "editor_bool spotLight" "Toggle to enable or disable a spotlight for the camera. You can specify an existing spotlight with a 'spotlight_custom' spawnarg. Otherwise a spotlight will be spawned." "editor_var spotlight_custom" "Specify an existing light entity as the spotlight, rather than letting the security camera spawn one. Requires 'spotLight' to be set to '1', other spotlight spawnargs will be ignored." "editor_texture spotlight_texture" "Texture projected by the spawned spotlight. You should use a texture designed for projected lights: one that uses a gradient as its falloff image. This ensures that light intensity gradually fades to black, rather than abruptly." "editor_int spotlight_range" "Maximum reach of the spawned spotlight." "editor_int spotlight_diameter" "Diameter of the spawned spotlight's projection. If 0, will automatically be calculated to match spotlight_range and scanFov, for scanFov up to 90°. Formula: spotlight_diameter = 2 * spotlight_range * tan(scanFov / 2)." "editor_bool useColors" "Toggle to disable color changes of the camera's spotlight & lens depending on alert state." "editor_color color_sweeping" "Color of the camera's spotlight & lens when it has not recently seen something suspicious, default green." "editor_color color_sighted" "Color of the camera's spotlight & lens when it has seen something suspicious, default yellow." "editor_color color_alerted" "Color of the camera's spotlight & lens when it has confirmed an intruder, default red." "editor_int health" "Health of the security camera. Setting to 0 will make it invicible." "editor_var break_up_script" "This script is called if the camera is destroyed." "editor_var break_up_target" "This entity is triggered if the camera is destroyed." "editor_bool notice_destroyed" "Whether AIs notice that the security camera has been destroyed (enables the visual stim)." "editor_model broken" "Switch to this model when the security camera is broken." "editor_model broken_flinderized" "Switch to this model when the security camera is broken and flinderized (fragmented). Set the flinderize threshold with 'damage_flinderize'. If no model is set here, will use 'broken' instead." "editor_int damage_flinderize" "Attacks dealing at least this amount of damage can turn the security camera into fragments upon or after destruction. Set to 0 to disable." "editor_int damage_blackjack" "Damage taken from blackjack attacks. Default damage: 0" "editor_int damage_splash_falloff" "Splash damage will decay exponentially by this number, increase this to make splash damage decrease faster with distance." "editor_float damage_mult_sword" "Damage multiplier for sword attacks. Default damage: 42" "editor_float damage_mult_arrow" "Damage multiplier for broadheads and rope arrows. Default damage: 35" "editor_float damage_mult_firearrow_direct" "Damage multiplier for fire arrow and mine direct hits. Fire arrows and mines deal either direct damage or splash damage. Default damage: 400" "editor_float damage_mult_firearrow_splash" "Damage multiplier for fire arrow and mine splash damage. Fire arrows and mines deal either direct damage or splash damage. Default maximal damage: 30" "editor_float damage_mult_moveable" "Damage multiplier for all moveables. Significant mass and velocity are needed to do significant damage. Default maximal damage: mass divided by 5" "editor_float damage_mult_other" "Damage multiplier for anything else. You can create individual damage_ spawnargs by naming the damage def, i.e. 'damage_mult_atdm:damage_rock' '1.0', or the inflicting entity, i.e. 'damage_atdm:attachment_melee_shortsword' '1.0'" "editor_var fx_damage" "Fx to play whenever the camera is damaged while power is on." "editor_var fx_damage_nopower" "Fx to play whenever the camera is damaged while power is off." "editor_var fx_destroyed" "Fx to play whenever the camera is destroyed while power is on." "editor_var fx_destroyed_nopower" "Fx to play whenever the camera is destroyed while power is off." "editor_snd snd_sight" "Sound emitted when the camera notices the player." "editor_snd snd_moving" "Sound emitted when the camera is rotating." "editor_snd snd_stationary" "Sound emitted by a stationary type of camera." "editor_snd snd_alert" "Alarm sound emitted when fully alerted." "editor_snd snd_end" "Sound emitted when the camera is about to reach the end point of a sweep." "editor_snd snd_death" "Sound emitted when the camera is destroyed while power is on. Additional to 'fx_destroyed'." "editor_snd snd_death_nopower" "Alternative death sound if camera is destroyed while power is off. Additional to 'fx_destroyed_nopower'." "editor_snd snd_sparks" "Sound emitted when the camera emits sparks after it was destroyed." "editor_var sprS_alert" "How far snd_alert propagates to AIs." "editor_var cameraTarget" "Obsolete, 'cameraTarget' no longer needs to be set on security cameras since it can now be set directly on the display screen for all entity types." "editor_int cameraFovX" "Display screens showing the camera's view will have this field of view in X. If not set, scanFov will be used instead." "editor_int cameraFovY" "Display screens showing the camera's view will have this field of view in Y. If not set, scanFov will be used instead." "editor_bool sparks" "1 = When the camera is destroyed, spawn a post-destruction particle func_emitter and play snd_sparks." "editor_model sparks_particle" "Particle that is spawned upon destruction." "editor_var sparks_delay" "Delay the initial appearance of the particle emitter after the camera is destroyed." "editor_bool sparks_power_dependent" "Only show the particle if power to the camera is switched on." "editor_float sparks_interval" "For non-looping particles, minimum time between each trigger of the particle emitter + snd_sparks." "editor_float sparks_interval_rand" "For non-looping particles, additional random factor added to the time between each trigger of the particle + snd_sparks." "editor_skin skin" "Only for in-editor display." "editor_skin skin_on" "Skin used when on." "editor_skin skin_on_spotlight_off" "For models with inbuilt lamps and/or light rays. Used when the security camera is on but its spotlight was toggled off via a button (see AI/Machines prefabs) or script." "editor_skin skin_off" "Skin used when off." "editor_skin skin_broken" "Switch to this skin when broken." "editor_skin skin_flinderized" "Switch to this skin when broken & flinderized. If no skin is set here, will use 'skin_broken' instead." "spawnclass" "idSecurityCamera" "scriptobject" "tdm_security_camera" "legacy" "1" "model" "models/darkmod/mechanical/security_camera.ase" "clipmodel" "models/darkmod/misc/clipmodels/security_camera_cm.lwo" "broken" "models/darkmod/mechanical/security_camera_broken.ase" "broken_flinderized" "-" "start_off" "0" // camera starts powered on "rotate" "1" "seePlayer" "1" "sweepAngle" "90" "sweepSpeed" "5" "sight_threshold" "0.1" "scanFov" "90" "scanDist" "200" "sightTime" "5" "sightResume" "1.5" "sweepWait" "0.5" "lightOffset" "6 0 8" "viewOffset" "8 0 0" "useColors" "1" "alarm_duration" "20" "alarm_interval" "5" "trigger_alarm_start" "1" "trigger_alarm_end" "0" "follow" "0" "follow_tolerance" "15" "follow_speed_mult" "2.5" "follow_incline" "0" "follow_incline_tolerance" "10" "follow_incline_speed" "20" "follow_constrain_up" "90" "follow_constrain_down" "90" "follow_constrain_cw" "180" "follow_constrain_ccw" "180" "color_sweeping" "0.3 0.7 0.4" "color_sighted" "0.7 0.7 0.3" "color_alerted" "0.7 0.3 0.3" "health" "100" "break_up_script" "-" "break_up_target" "-" "notice_destroyed" "1" "damage_flinderize" "90" "damage_blackjack" "0" "damage_splash_falloff" "3" "damage_mult_sword" "0.0" "damage_mult_arrow" "0.0" "damage_mult_firearrow_direct" "1.0" "damage_mult_firearrow_splash" "3.5" "damage_mult_moveable" "0.0" "damage_mult_other" "0.0" "fx_damage" "fx/metaldamage_small_sparks" "fx_damage_nopower" "fx/metaldamage_small" "fx_destroyed" "fx/metaldamage_sparks" "fx_destroyed_nopower" "fx/metaldamage" "skin_on" "security_camera_on" "skin_off" "security_camera_off" "skin_on_spotlight_off" "security_camera_on_spotlight_off" "skin_broken" "security_camera_off" "skin_flinderized" "-" "spotLight" "0" "spotlight_custom" "-" "spotlight_texture" "lights/biground1" "spotlight_range" "0" "spotlight_diameter" "0" "snd_sight" "security_camera_sight" "snd_moving" "security_camera_moving" "snd_stationary" "security_camera_stationary" "snd_alert" "security_camera_alert" "snd_end" "security_camera_end" "snd_death" "sizzle" "snd_death_nopower" "silence" "snd_sparks" "security_camera_spark" "sprS_alert" "alarm_mild" // Propagated alarm sound "sparks" "1" "sparks_particle" "sparks_wires_oneshot.prt" "sparks_delay" "3" "sparks_power_dependent" "1" "sparks_interval" "3" "sparks_interval_rand" "2" //visual stim: enabled when camera is destroyed "sr_class_1" "S" "sr_time_interval_1" "977" "sr_type_1" "STIM_VISUAL" "sr_state_1" "0" "sr_radius_1" "500" "AIUse" "AIUSE_BROKEN_ITEM" } entityDef atdm:security_camera01 { "inherit" "func_securitycamera" "legacy" "" "editor_displayFolder" "AI/Machines/Security Camera" "editor_usage" "Immobile sentry that watches for the player." "editor_usage1" "Can sound an alarm, illuminate an area with a spotlight and track the player's movements horizontally." "editor_usage2" "Sweeps back and forth over 'sweepAngle' degrees unless 'rotate' is set to 0. Start direction is clockwise." "editor_usage3" "Only vulnerable to fire arrows by default. Can be switched on/off by triggering it from a button or lever." "editor_usage4" "Designed to be mounted on a func_static wall/ceiling mount." "model" "models/darkmod/mechanical/security_camera.ase" "broken" "models/darkmod/mechanical/security_camera_broken.ase" "nonsolid" "" "lightOffset" "6 0 0" "viewOffset" "12 0 0" "sweepSpeed" "15" "follow" "1" "skin_on" "security_camera01_on" "skin_off" "security_camera01_off" "skin_on_spotlight_off" "security_camera01_on_spotlight_off" "skin_broken" "security_camera01_broken" "scanFov" "60" "scanDist" "450" "sightTime" "2.5" "spotLight" "1" "trigger_alarm_end" "1" "color_sweeping" "0.18 0.42 0.25" "color_sighted" "0.42 0.40 0.18" "color_alerted" "0.46 0.14 0.17" "spotlight_texture" "lights/spotlight_security_camera" "spotlight_range" "450" "spotlight_diameter" "0" //automatically calculated to match range & scanFov } | ||||
I'm having difficulties reproducing your exact inheritance, since there is already a func_securitycamera in tdm_defs01.pk4/defs/func.def, so just placing this file somewhere will lead to entityDef redefinition warnings. But I can at least confirm that 2.14 has difficulties resolving the "editor_color color_sweeping" helper key on the entityDef, it doesn't display any icon at all. This was lost during the recent EntityInspector overhaul, I have to look into getting this to work again. |
|
It's probably best if you use your TDM SVN install or a 2.10 dev build (except rev 9175), since both of the defs I attached are included in there. I only attached them to make it easier to see what's defined in each entityDef, it wasn't my intention that you should place those defs in your installation. |
|
DarkRadiant: master 51dddba0 21.11.2021 05:24 Details Diff |
0005813: Refactoring to reduce the method size |
Affected Issues 0005813 |
|
mod - radiant/ui/einspector/EntityInspector.cpp | Diff File | ||
mod - radiant/ui/einspector/EntityInspector.h | Diff File | ||
DarkRadiant: master e11ba0ff 21.11.2021 05:38 Details Diff |
0005813: Refactor EntityInspector::getPropertyParmsForKey. |
Affected Issues 0005813 |
|
mod - radiant/ui/einspector/EntityInspector.cpp | Diff File | ||
DarkRadiant: master f6e7145c 21.11.2021 07:40 Details Diff |
0005813: Introduce EntityInspector::getPropertyTypeForKey |
Affected Issues 0005813 |
|
mod - radiant/ui/einspector/EntityInspector.cpp | Diff File | ||
mod - radiant/ui/einspector/EntityInspector.h | Diff File | ||
DarkRadiant: master 9359f164 21.11.2021 12:53 Details Diff |
0005813: Implement the key type look up in the EntityInspector. Right now the type lookup is not respecting the entityDef inheritance properly. |
Affected Issues 0005813 |
|
mod - radiant/ui/einspector/EntityInspector.cpp | Diff File | ||
mod - radiant/ui/einspector/EntityInspector.h | Diff File | ||
DarkRadiant: master 316bfda3 21.11.2021 13:36 Details Diff |
0005813: Add new method IEntityClass::getAttributeType() which should be used to determine the key type, respecting the ancestor defs. |
Affected Issues 0005813 |
|
mod - include/ieclass.h | Diff File | ||
mod - radiantcore/eclass/EntityClass.cpp | Diff File | ||
mod - radiantcore/eclass/EntityClass.h | Diff File | ||
mod - test/Entity.cpp | Diff File | ||
add - test/resources/tdm/def/attribute_types.def | Diff File | ||
DarkRadiant: master 6d143d3b 21.11.2021 13:45 Details Diff |
0005813: More test cases |
Affected Issues 0005813 |
|
mod - test/Entity.cpp | Diff File | ||
mod - test/resources/tdm/def/attribute_types.def | Diff File | ||
DarkRadiant: master e4a11d40 21.11.2021 13:56 Details Diff |
0005813: Implement EntityClass::getAttributeType |
Affected Issues 0005813 |
|
mod - radiantcore/eclass/EntityClass.cpp | Diff File | ||
DarkRadiant: master e3822ec2 21.11.2021 14:22 Details Diff |
0005813: The default type of entity class attributes is empty now (has always been set to "text" before). As soon as a non-empty type is encountered in the same entity class, it will be used instead. |
Affected Issues 0005813 |
|
mod - radiantcore/eclass/EntityClass.cpp | Diff File | ||
mod - radiantcore/eclass/EntityClass.h | Diff File | ||
mod - test/Entity.cpp | Diff File | ||
DarkRadiant: master 6d4157f8 21.11.2021 14:25 Details Diff |
0005813: EntityInspector is using IEntityClass::getAttributeType() now, this fixes the problem of wrong icons being shown when the corresponding editor_ descriptor is defined on the base. |
Affected Issues 0005813 |
|
mod - radiant/ui/einspector/EntityInspector.cpp | Diff File | ||
DarkRadiant: master ac0dd4ba 21.11.2021 16:31 Details Diff |
0005813: Entity key help text is now shown even or especially when the description is inherited |
Affected Issues 0005813 |
|
mod - include/ieclass.h | Diff File | ||
mod - radiant/ui/einspector/EntityInspector.cpp | Diff File | ||
mod - radiantcore/eclass/EntityClass.cpp | Diff File | ||
mod - radiantcore/eclass/EntityClass.h | Diff File | ||
mod - test/Entity.cpp | Diff File | ||
mod - test/resources/tdm/def/attribute_types.def | Diff File | ||
DarkRadiant: master 4b5e78ce 21.11.2021 16:44 Details Diff |
0005813: EntityInspector is now displaying a property editor for keys with inherited descriptor. |
Affected Issues 0005813 |
|
mod - radiant/ui/einspector/EntityInspector.cpp | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
18.11.2021 16:47 | Dragofer | New Issue | |
18.11.2021 16:47 | Dragofer | File Added: sec_cam.txt | |
18.11.2021 16:52 | Dragofer | Description Updated | |
20.11.2021 16:42 | greebo | Status | new => acknowledged |
20.11.2021 17:28 | greebo | Status | acknowledged => confirmed |
20.11.2021 17:28 | greebo | Note Added: 0014553 | |
20.11.2021 17:29 | greebo | Relationship added | related to 0005613 |
20.11.2021 17:40 | Dragofer | Note Added: 0014554 | |
20.11.2021 17:43 | Dragofer | Note Edited: 0014554 | |
21.11.2021 15:52 | greebo | Relationship added | related to 0005814 |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master 51dddba0 |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master e11ba0ff |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master f6e7145c |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master 9359f164 |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master 316bfda3 |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master 6d143d3b |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master e4a11d40 |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master e3822ec2 |
21.11.2021 16:13 | greebo | Changeset attached | => DarkRadiant master 6d4157f8 |
21.11.2021 16:13 | greebo | Target Version | => 2.14.0 |
21.11.2021 16:13 | greebo | Assigned To | => greebo |
21.11.2021 16:13 | greebo | Status | confirmed => assigned |
21.11.2021 16:44 | greebo | Changeset attached | => DarkRadiant master ac0dd4ba |
21.11.2021 16:44 | greebo | Changeset attached | => DarkRadiant master 4b5e78ce |
21.11.2021 16:45 | greebo | Status | assigned => resolved |
21.11.2021 16:45 | greebo | Resolution | open => fixed |
21.11.2021 16:45 | greebo | Fixed in Version | => 2.14.0 |
21.11.2021 16:46 | greebo | Relationship added | related to 0005817 |
19.08.2022 15:33 | greebo | Status | resolved => closed |