User:Max34/SourceRenewed: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
			
 Note:Perhaps in the future it will be renamed to
Note:Perhaps in the future it will be renamed to 
 Code Fix:Fixed a crash when the filters tries to check an already deleted entity. If the entity does not exist when checking, the comparison will be made with an empty value.
Code Fix:Fixed a crash when the filters tries to check an already deleted entity. If the entity does not exist when checking, the comparison will be made with an empty value.
	
 Note:The parameter storing the coordinates in all logical entities will be removed in order to reduce the amount of information stored in the map. Also, for building logic in the new Hammer there will be a separate window (something in the style of a logical tree from the unreal engine).
Note:The parameter storing the coordinates in all logical entities will be removed in order to reduce the amount of information stored in the map. Also, for building logic in the new Hammer there will be a separate window (something in the style of a logical tree from the unreal engine).
 Important:It was decided to remove this entity and transfer its functionality to the world itself (
Important:It was decided to remove this entity and transfer its functionality to the world itself (
	
 Code Fix:Fixed a bug that caused the deleted
Code Fix:Fixed a bug that caused the deleted 
	
	
	
 Note:These Inputs support constants. For example, to set the value of the calculator to π (3.14159…), you can use
Note:These Inputs support constants. For example, to set the value of the calculator to π (3.14159…), you can use 
 Note:The entity now uses a new optimization system. Since this system is not fully implemented, the entity is partially broken, for now.
Note:The entity now uses a new optimization system. Since this system is not fully implemented, the entity is partially broken, for now.
		
	
| m (Say goodbye to info_player_start) | m (→logic_auto) | ||
| Line 222: | Line 222: | ||
| === logic_auto === | === logic_auto === | ||
| {{Important|It was decided to remove this entity and transfer its functionality to the world itself. This is not currently implemented, so the entity still exists.}} | {{Important|It was decided to remove this entity and transfer its functionality to the world itself ({{code|worldspawn}}). This is not currently implemented, so the entity still exists.}} | ||
| === logic_autosave === | === logic_autosave === | ||
Revision as of 07:09, 28 November 2023
SR SourceRenewed (working title) is a project based on the  Source 2013 Singleplayer. Adds some new and useful things to the engine and improves the existing ones. However, unlike
 Source 2013 Singleplayer. Adds some new and useful things to the engine and improves the existing ones. However, unlike  Mapbase, this project is not meant to be fully backward compatible with any Source branch. Made by Max_34.
 Mapbase, this project is not meant to be fully backward compatible with any Source branch. Made by Max_34.
Changes in the common class of all entities
| Parameters | Type | Description | Notes | 
|---|---|---|---|
| Entity State | choice | DisabledorEnabled(by default). Whether the entity is enabled or disabled when spawning. | |
| Inputs | Type | Description | Notes | 
| Enable | void | Enables an entity. | This entity state system is something new and has nothing to do with the deprecated "Start Disabled". For now, this only works with entities that have been reworked. [Todo] ☐ Figure out if this “Read-only” is worth it, or is it better to disable any I/O interaction when the entity is disabled. | 
| Toggle | void | Toggles the state of an entity between enabled and disabled. | |
| Disable | void | Disables an entity. When an entity is disabled, it becomes “Read-only”. | |
| SetTeamSetGroup | integer | Sets the group for the entity. By default, all entities are in group 0. | |
| FireUser1FireCustom1 | void | Fires the OnCustom1event if the entity is enabled. | |
| FireUser2FireCustom2 | void | Fires the OnCustom2event if the entity is enabled. | |
| FireUser3FireCustom3 | void | Fires the OnCustom3event if the entity is enabled. | |
| FireUser4FireCustom4 | void | Fires the OnCustom4event if the entity is enabled. | |
| Outputs | Type | Description | Notes | 
| OnSpawn | void | Fired when the entity spawns. | [Todo] ☐ Make sure this event happens at the right time. | 
| OnKilled | void | Fired when the entity has been deleted. | |
| OnUser1OnCustom1 | void | Fires in response to FireCustom1input. | |
| OnUser2OnCustom2 | void | Fires in response to FireCustom2input. | |
| OnUser3OnCustom3 | void | Fires in response to FireCustom3input. | |
| OnUser4OnCustom4 | void | Fires in response to FireCustom4input. | 
Env Entities
env_sound
Old name: ambient_generic
 Note:Perhaps in the future it will be renamed to
Note:Perhaps in the future it will be renamed to point_sound.Todo: More documentation.
env_spark
Todo: More documentation.
Filter Entities
 Code Fix:Fixed a crash when the filters tries to check an already deleted entity. If the entity does not exist when checking, the comparison will be made with an empty value.
Code Fix:Fixed a crash when the filters tries to check an already deleted entity. If the entity does not exist when checking, the comparison will be made with an empty value.filter_class
Old name: filter_activator_class
filter_group
Old name: filter_activator_team
filter_name
Old name: filter_activator_name
| Parameters | Type | Description | Notes | 
|---|---|---|---|
| Filter | string | . | |
| Filtering Type | choice | . | |
| Inputs | Type | Description | Notes | 
| GetFilter | void | . | “Read-only” event. | 
| SetFilter | string | . | |
| FilterActivator | void | . | |
| FilterCaller | void | . | |
| Outputs | Type | Description | Notes | 
| OnGetFilter | string | . | “Read-only” event. | 
| OnFail | void | . | |
| OnPass | void | . | 
Logic Entities
 Note:The parameter storing the coordinates in all logical entities will be removed in order to reduce the amount of information stored in the map. Also, for building logic in the new Hammer there will be a separate window (something in the style of a logical tree from the unreal engine).
Note:The parameter storing the coordinates in all logical entities will be removed in order to reduce the amount of information stored in the map. Also, for building logic in the new Hammer there will be a separate window (something in the style of a logical tree from the unreal engine).
logic_auto
 Important:It was decided to remove this entity and transfer its functionality to the world itself (
Important:It was decided to remove this entity and transfer its functionality to the world itself (worldspawn). This is not currently implemented, so the entity still exists.logic_autosave
Todo: More documentation.
logic_branch
| Parameters | Type | Description | Notes | 
|---|---|---|---|
| Initial value | float | Initial branch value. All negative numbers are false; all positivetrue; 0 depending on settingTreat 0 as. | |
| Treat 0 as | choice | false(by default),indeterminate(for ternary mode) ortrue. | |
| Inputs | Type | Description | Notes | 
| GetValue | void | . | “Read-only” event. | 
| Test | void | . | |
| SetValue | void | . | |
| SetValueTest | void | . | |
| ToggleToggleValue | void | . | |
| ToggleTestToggleValueTest | void | . | |
| Outputs | Type | Description | Notes | 
| OnGetValue | float | . | “Read-only” event. | 
| OnFalse | void | . | |
| OnIndeterminate | void | . | |
| OnTrue | void | . | 
logic_branch_manager
Old name: logic_branch_listener.
 Code Fix:Fixed a bug that caused the deleted
Code Fix:Fixed a bug that caused the deleted logic_branch to be treated as false instead of removing it from the list.Todo: More documentation.
logic_case
Todo: More documentation.
logic_compare
| Parameters | Type | Description | Notes | 
|---|---|---|---|
| Initial valueFirst value | string | Initial first value. | |
| Compare valueSecond value | string | The value to compare against. | |
| Inputs | Type | Description | Notes | 
| GetFirstValue | void | . | “Read-only” event. | 
| GetSecondValue | void | . | “Read-only” event. | 
| SetValueSetFirstValue | string | . | |
| SetCompareValueSetSecondValue | string | . | |
| CompareInt | void | . | |
| CompareCompareFloat | void | . | |
| CompareString | void | . | |
| Outputs | Type | Description | Notes | 
| OnGetFirstValue | string | . | “Read-only” event. | 
| OnGetSecondValue | string | . | “Read-only” event. | 
| OnEqual | void | . | |
| OnNotEqual | void | . | |
| OnLess | void | . | |
| OnGreater | void | . | |
| OnLessOrEqual | void | . | |
| OnGreaterOrEqual | void | . | 
logic_console
New entity.
Todo: More documentation.
logic_relay
| Inputs | Type | Description | Notes | 
|---|---|---|---|
| TriggerTrigger1 | void | Fires the OnTrigger1event. | |
| Trigger2 | void | Fires the OnTrigger2event. | |
| Trigger3 | void | Fires the OnTrigger3event. | |
| Trigger4 | void | Fires the OnTrigger4event. | |
| Outputs | Type | Description | Notes | 
| OnTriggerOnTrigger1 | void | Fires in response to Trigger1input. | |
| OnTrigger2 | void | Fires in response to Trigger2input. | |
| OnTrigger3 | void | Fires in response to Trigger3input. | |
| OnTrigger4 | void | Fires in response to Trigger3input. | 
logic_string
New entity.
Todo: More documentation.
logic_timer
Todo: More documentation.
Math Entities
math_calculator
New entity.
| Inputs | Type | Description | Notes | 
|---|---|---|---|
| GetValue | void | Get calculator value. Fires the OnGetValueevent. | “Read-only” event. | 
| GetParity | void | Get the parity of a calculator value. Fires OnValueEvenif the number is even andOnValueOddif it is odd. If the value is afloat, the non-integer part of the value will be ignored. | “Read-only” event. | 
| RoundValue | integer or void | Rounds calculator value: 0.3 = 0,0.8 = 1. You can also specify a number that will determine at what level to round the number. For example, if the calculator number is 256 and the input value is 2 (comparable to the number of zeros), then the number will be rounded up to 300. This also works with negative numbers: if your number is 0.18, and the input value is -1, then the result will be 0.2. | |
| SetValue | string, float or void | Sets the value of the calculator. | (See Note after this table.) | 
| Add | string, float or void | Adds the entered value to the calculator. | (See Note after this table.) | 
| Subtract | string, float or void | Subtracts the entered value from the calculator value. | (See Note after this table.) | 
| Multiply | string, float or void | Multiplies the calculator value by the entered value. | (See Note after this table.) | 
| Divide | string, float or void | Divides the calculator value by the entered value. Completely ignores the value 0. | (See Note after this table.) | 
| Power | string, float or void | Raises the calculator value to the entered power. | (See Note after this table.) | 
| Modulo | string, float or void | Calculates the remainder of dividing the entered number by the current calculator value. Completely ignores the value 0. | (See Note after this table.) | 
| Outputs | Type | Description | Notes | 
| OnValueChanged | float | Fires when the calculator value has been changed. | |
| OnValueNotChanged | float | Fires when the calculator value has not been changed. This only happens if one of the Inputs that interacts with the calculator value has been used. Therefore, the GetValueandGetParityevents do not fire this Output. | |
| OnGetValue | float | Fires in response to GetValueinput. | “Read-only” event. | 
| OnValueEven | float | Fires in response to GetParityinput if the value is even. | “Read-only” event. | 
| OnValueOdd | float | Fires in response to GetParityinput if the value is odd. | “Read-only” event. | 
 Note:These Inputs support constants. For example, to set the value of the calculator to π (3.14159…), you can use
Note:These Inputs support constants. For example, to set the value of the calculator to π (3.14159…), you can use SetValue pi, or if you want to subtract e (2.71828…) from the calculator value, you can use Subtract e.| Constant | Description | Value | 
|---|---|---|
| e | e | 2.71828182845904523536 | 
| log2e | log2(e) | 1.44269504088896340736 | 
| log10e | log10(e) | 0.434294481903251827651 | 
| ln2 | ln(2) | 0.693147180559945309417 | 
| ln10 | ln(10) | 2.30258509299404568402 | 
| pi | π | 3.14159265358979323846 | 
| pi2 | π/2 | 1.57079632679489661923 | 
| pi4 | π/4 | 0.785398163397448309616 | 
| 1pi | 1/π | 0.318309886183790671538 | 
| 2pi | 2/π | 0.636619772367581343076 | 
| 2sqrtpi | 2/√π | 1.12837916709551257390 | 
| sqrt2 | √2 | 1.41421356237309504880 | 
| 1sqrt2 | 1/√2 | 0.707106781186547524401 | 
math_color
New entity. Also combines the capabilities of math_colorblend.
Color constructor. Allows you to make color32 from separate integers. This color32 can be used as a whole or separately.
Todo: More documentation.
math_counter
 Note:The entity now uses a new optimization system. Since this system is not fully implemented, the entity is partially broken, for now.
Note:The entity now uses a new optimization system. Since this system is not fully implemented, the entity is partially broken, for now.Todo: More documentation.
math_remap
Todo: More documentation.
Deleted entities
- env_beverage
- filter_base
- filter_multi
- game_end
- game_player_equip
- game_player_team
- item_sodacan
- logic_active_autosave
- logic_lineto
- logic_multicompare
- math_colorblend
- multisource
- point_clientcommand
- point_servercommand
- trigger_once
- info_player_start
Other
- Minor optimization to reduce entdata usage.
- Added more support for converting from one value format to another.
- New Hammer (in development).
- Trying to make engine code more readable.
- Replaced allstrcmp,stricmp,_stricmp,Q_strcmp,V_strcmp,Q_stricmp,V_stricmp,FStrEq,V_strlen,Q_strlenV_strlen,Q_strcasecmp,Q_strncasecmp,V_strncasecmp,V_strcasecmp
 with more understandable and optimalStringEmpty,StringsEqual,StringsEqualCaseless,StringsPartsEqual,StringsCompare,StringsCompareCaselessandStringLength.
 
- Replaced all
- The Worldspawnentity has been renamed toWorldand will now be used as a full-fledged entity.
- The Playerentity will be editable while the map is being created (as with theWorldentity). Also, theinfo_player_startfunctionality will be transferred to Player.