Commit graph

480 commits

Author SHA1 Message Date
Jeff Hutchinson 8f2beb3219 Fix edgecase where empty string was not being explicitly set to 0 in torquescript when used as integers/floats/bools.
We found this in the setInventory standard module. in setInventory, %max was being set to empty string, but being compared to 0 during TorqueScript comparison ops. I knew to look in ConsoleValue's type conversion functions, as the interpreter internally uses ConsoleValues when working with torquescript variables under the hood. ConsoleValue is responsible for handling all type conversions on the fly as needed inside of the core interpreter logic.
2022-05-23 20:25:32 -04:00
Jeff Hutchinson 3988e7baee Better allocator for TorqueScript temp conversions used during interpretation
instead of using a Vector<> that never frees and grows for torquescript temporaries created when doing type conversions)
2022-05-21 21:55:44 -04:00
Jeff Hutchinson 59125c85eb Fix weird ternary operator in torquescript regression
With a test!
2022-04-27 21:02:55 -04:00
JeffR 5c8d8fab00 Changes behavior with suffix appending of asset importer so it doesn't contaminate the original "clean" name, which is used for setting the mapTo value of material definitions
Also adds a sanity check when applying the type suffix to see if it's already there to avoid needless doubleups
Fixes offsetting/positioning behavior on icon buttons to actually respect the icon position variable
Adds sanity checks to ensure we're not trying to utilize a in-process-of-deleting decoy dummy
Fixes handling of sliders in option menus to properly store and test unapplied values
Fixes handling of display device setting to properly store and test unapplied values
Adds additional logic to creation of shape and material asset previews to attempt to force-load dependencies to improve likelihood that they'll actually be loaded when we go to generate the preview.
Temp disables creating cubemap 'assets' via the RMB context menu in the AB
2022-04-10 01:40:15 -05:00
JeffR bfe3d4d02b Shifts handling of forest brush and item elements into standard simsets for consistency
Updates the forest editor tooling to utilize the new sets, and adjusts the creation of new Brushes in the forest editor to have user select a target module first.
This ensures all a module's brushes are grouped into the new ForestBrushGroup class which auto-registers into the ForestBrushSet, thus allowing modules to have their own sets of brushes that automatically hook into the editor workflow.
2022-04-07 18:19:13 -05:00
AzaezelX d883575d0f fix compilation flaws 2022-03-17 17:38:41 -05:00
Brian Roberts 3411dab754
Merge pull request #742 from Areloch/invisibleFileFix
Tweaks handling of "invisible" files
2022-03-16 03:30:45 -05:00
JeffR b36776d567 Tweaks handling of "invisible" files, files which start with a ., effectively making them have no filename and only an extension.
This allows the engine to actually process and work with such files.
2022-03-15 21:17:37 -05:00
JeffR 1496ffac6e Adds a systemCommand console utility function, which invokes the standard system() function call, and also has an optional callback return parameter. 2022-03-15 21:10:55 -05:00
JeffR a0f8b29da7 Improves logical checks for the default value so it's more sane and stable
Allows creation of polyhedrons via constructor with a origin and vector format, allowing to have default polyhedron values on triggers and physical zones
2022-02-14 01:07:39 -06:00
JeffR 696c2e2eec Add sanity check for default value results checking when filtering out default values
Add additional utility functions for updating parsed object data in the project importer
Adds logic to find and associate FX materials to their terrainMaterials and adding them to the terrian material asset if found on project importer
2022-02-02 01:11:33 -06:00
JeffR b4e346aa3f Adjustments to save out code when writing fields such that if the TAML writer is marked as not writing defaults, it doesn't. And makes the regular simobject save out not write default values as the default behavior 2022-01-31 20:57:57 -06:00
JeffR 630285def6 Shifts handling of material and terrain material definitions to be written into the asset definition taml file instead of having an extra loose file
Also updates importers to correctly handle this change
Adds ability for taml XML serialization to properly assign array'd fields
Adds 'inheritFrom' field to simobjects for when objects with parent objects are serialized
AssetBase how inherits from SimGroup so it can have objects like material definitions embedded in them for save/load in the taml definition file
Updated loading/handling logic in terrain material asset to be more similar to regular material assets
2022-01-30 11:50:16 -06:00
JeffR ed13bdfdd2 Changes the -> syntax check from exclusively checking simgroups to checking simsets, allowing both to be used 2022-01-21 16:01:44 -06:00
Jeff Hutchinson 73b023a4b7 Fix console warning when calling void functions in console
Forgot to add this check when rewriting the interpreter.
2021-12-08 21:00:50 -05:00
Robert MacGregor 5fa7c62ba9 * BugFix: Don't use the register keyword in the console grammar files. 2021-12-03 20:33:02 -05:00
Jeff Hutchinson 7ac62f42a3 Fixed a leak with console stack in the interpreter.
Issue was pushing a new frame in the global scope. Everytime a global scope was called, 1 ConsoleValue got allocated that was never freed. After 4096 'global scope' function calls, the engine would blow. Also cleans up an extra rogue usage of push/pop with the saver helper.
2021-11-20 19:08:02 -05:00
Jeff Hutchinson 2e03108856 Optionally allow to treat script assert as warning
This commit allows us to treat variable use before assign errors and local variables inside of the global scope as warnings instead of asserts. This will allow for easier porting of legacy scripts. It is highly recommended use this as an aid to port scripts, but can be used in production if needbe.
2021-11-17 18:01:35 -05:00
Jeff Hutchinson 949813956d Add Object Inheritence Acceptance Test 2021-11-11 22:57:09 -05:00
Brian Roberts e4428cf75a
Merge pull request #657 from Areloch/SeparateImporterLogFile
Updates asset importer and project importer to output to separate log files into tools/logs
2021-11-03 21:15:51 -05:00
JeffR fda722e355 Updates asset importer and project importer to output to separate log files into tools/logs
Add utility console function for getting current datetime
2021-11-03 00:13:00 -05:00
Robert MacGregor 2b53c065ce * BugFix: Correct an invalid memory access error caused by the tab autocomplete in the console when attempting to tab complete at the start of the input while there is text to the right. 2021-11-02 13:55:57 -04:00
Areloch 0fab2ebf54 Added fallback handling to MaterialAssets if the asset was found but the matDef was not
Added import config handling for prepending Directory to asset name
Added handling for import config of appending a sound suffix
Integrated handling of directory prepend and asset type suffix to rename issue resolution of asset importing
Corrected miswording of warn message for duplicate object names
Correct GUI issues with verve tools
Convert verve tools to utilize assets for their GUI elements
Fix window binding/naming issue depending on window mode for verve
Fix popup menus formatting for verve
WIP fix for material swap in Material editor. Corrects crash, but swap action is unreliable depending on object type
Fix display issue with mission area editor toolbar button image
Fix tooltip display of SFXEmitters in editor tree to correctly show the bound asset
Changed network graph accelerator keybind from just N to Ctrl N to avoid keybind issues when typing
Fixed Create New Emitter button in particle emitter that was showing as no texture
2021-10-28 23:52:58 -05:00
Jeff Hutchinson 4af4d90f4a Get rid of setLocalVariable entirely. 2021-10-19 20:38:13 -04:00
Jeff Hutchinson 4293aef858 This one slipped through - nextToken can't use local variable for its token variable. This was stated as one of the breaking changes in the origional PR. 2021-10-19 20:34:57 -04:00
Robert MacGregor aba091a97a Merge remote-tracking branch 'main/Preview4_0' into bugfix-msvc-compiler-warnings 2021-10-11 19:36:52 -04:00
Jeff Hutchinson 0429b5afa5 Added more tests for torquescript 2021-10-09 18:47:12 -04:00
Robert MacGregor 5d26dba7da * BugFix: Clear some MSVC compiler warnings. 2021-10-07 00:27:39 -04:00
Robert MacGregor 1b6b803a20 * BugFix: Clear a lot of warnings and correct a few actual programming errors along the way. 2021-10-04 20:04:21 -04:00
Jeff Hutchinson 755bbacaa0 Fix specific usage of Con::executef where it was not being assigned to a ConsoleValue before getting it's data out of it. 2021-09-24 19:32:57 -04:00
Jeff Hutchinson 2d50f52cf1 Allow local variables to be used in eval. 2021-09-20 21:00:33 -04:00
Robert MacGregor f9b78597f7 * BugFix: Correct an error that causes the engine to crash when calling non-namespaced engine functions incorrectly. 2021-09-16 21:21:04 -04:00
Jeff Hutchinson a7db690b59 Reimplement object copy failures. 2021-09-13 19:46:21 -04:00
Jeff Hutchinson 7f59bc6350 Forgot to null out the datablock after being deleted when it fails to preload. 2021-09-11 15:16:36 -04:00
Jeff Hutchinson 35b33f1864 various fixes and memory corruption bug. 2021-09-09 19:30:32 -04:00
Jeff Hutchinson 27a4868b6e Fix buffer corruption. 2021-09-07 21:52:36 -04:00
Jeff Hutchinson 6d93e96dc3 NULL out an object variable if it fails to register. 2021-09-07 21:03:57 -04:00
Jeff Hutchinson 55c0a748b4 Don't generate op_inc whenever its used as an expression. 2021-09-07 19:43:39 -04:00
Jeff Hutchinson 9b2f4976c9 small regression fix. 2021-09-04 22:00:32 -04:00
Jeff Hutchinson c16b88d709 Fix temporary buffer for scripting conversions. 2021-09-04 21:25:11 -04:00
Jeff Hutchinson 478a04bea8 Fix DSOs and bump version! 2021-09-04 16:37:59 -04:00
Jeff Hutchinson 278bef8d1a Fix if to else if regression. 2021-09-04 16:23:20 -04:00
Jeff Hutchinson 313c069ecb Fix xyz again by reverting previous commit and fixing the local variables from not resetting the object states. 2021-09-03 23:27:39 -04:00
Robert MacGregor 5cce344bb1 * BugFix: Fix a missing <vector> include for GCC.
* BugFix: Correct some globally used local variables in the editor code.
2021-09-03 00:26:48 -04:00
Jeff Hutchinson 7efe72aced More fixes with xyz lookup, and some cleanup and test cases. 2021-09-02 22:21:00 -04:00
Jeff Hutchinson 8d75d60f91 Write out variable mapping table to DSO stream, and fix .dump() 2021-09-01 22:15:37 -04:00
Jeff Hutchinson 9448256422 Fix console garbage error when evaluating strings. 2021-09-01 20:16:08 -04:00
Jeff Hutchinson f04aca9def Fix string stack issue returning from a foreach statement. 2021-08-31 22:18:08 -04:00
Jeff Hutchinson 6e072dbf91 Merge branch 'Preview4_0_DevHead' into tsneo 2021-08-29 22:28:42 -04:00
Brian Roberts c04f3ae166
Merge pull request #533 from Ragora/bugfix-linux-release-builds
Bugfix linux release builds for Clang
2021-08-20 21:55:16 -05:00