Commit Graph

25 Commits (7b676b083c4cb5ab1685adbbd532f4c26980fadc)

Author SHA1 Message Date
Sven Eberhardt da4f49d7ca Add AI attack mode (weapon) to editor properties 2017-02-14 01:36:12 -05:00
Sven Eberhardt ad2a0a8955 Save scenario: Ignore objects contained in ignored objects
E.g. do not save tools carried by crew.
2016-12-28 08:53:58 -04:00
Maikel de Vries 89be9bd158 implement scenario saving for liquid tank, pump & pipe 2016-10-03 18:07:49 +02:00
Sven Eberhardt 117ddac8b4 Auto-unstick animals and objects on ground in saved scenarios 2016-09-05 01:59:59 -04:00
Sven Eberhardt 44022f840f Add CustomInitializationScript to all objects 2016-08-25 00:18:11 -04:00
Sven Eberhardt 4ce96cb892 Fix scenario saving of names when no name is assigned.
It created SetName("") entries because def->GetName() has a fallback to the internal name while obj->GetName() does not.

Just use .Name instead. Objects with custom naming (overloaded GetName()) need to overload name saving anyway.
2016-08-23 02:07:54 -04:00
Sven Eberhardt 4df8679be2 Simplify saving of scenario properties in saved scenarios.
Just need to set "Save" to an identifier now.
2016-08-20 01:55:21 -04:00
Sven Eberhardt e39b314239 Add property to auto-save EditorProps in scenarios 2016-08-06 14:49:48 -04:00
Sven Eberhardt 9bcef15b99 Add AddScenarioSaveDependency for scenario saving: Adds a dependency without forcing a name 2016-08-05 00:30:43 -04:00
Sven Eberhardt 8d6a7058c6 Fix possible user action sequence id conflict when saving scenario after testing a sequence 2016-07-13 17:39:36 -04:00
Sven Eberhardt 22328365fa Escape \ and " characters when scenario saving names and strings within proplists 2016-07-13 02:13:23 -04:00
Sven Eberhardt 279d89393c SaveScenario: Correctly save object pointers within proplist 2016-07-13 01:45:29 -04:00
Sven Eberhardt 44d94d5043 Improve editor duplicate function to duplicate properties and object connections.
It serializes objects using a selective SaveScenarioObjects script callback and then just executes the generated script. This automatically saves important properties, connects switches and doors, etc.

This change also solves the problem that duplicating an elevator plus case would create two elevator cases.

If execution fails (e.g. because of script errors or because a non-saveable object was duplicated), the method falls back to the legacy duplication method of creating objects with the same prototypes at the same position.
2016-06-20 01:45:26 -04:00
Sven Eberhardt 35fcc0ff51 Fix scenario saving of array-typed visibility. Fix ItemSpawn saving and spawn def re-setting. 2016-02-07 13:21:01 -05:00
Sven Eberhardt 7e45475cbe Scenario saving: Concatenate multiple equal calls to CreateContents. 2015-01-18 14:28:10 +01:00
Sven Eberhardt d33dfd6c55 Scenario Saving: Select between CreateObject/CreateObjectAbove and fix some unnecessery property saving issues.
* CreateObject for goals/rules/environment, rotated, contained and earth objects
* Allow properties to overwrite default behavior of CreateObject vs CreateObjectAbove
* Random initialization of seaweed phase instead of saving it
* Do not save color of ColorByOwner objects that have their owner color
* Fix block spacing between objects of same type if objects of different type occur inbetween but are not saved
2015-01-17 17:00:58 +01:00
Mark 850bf1b9d4 CreateObject/CreateObjectAbove (#1214)
Renamed CreateObject() to CreateObjectAbove() and replaced all occurrences in script files.
Added CreateObject(), the function may need a rewrite though, see comment in code.
Updated documentation
2015-01-11 19:02:03 +01:00
Nicolas Hake 6c2995fe41 Squelch varargs warnings in System.ocg
The engine (extra)warns whenever you use Par() or ... inside of a
function that is not declared as taking a variable number of arguments.
Change the declaration of all System.ocg varargs functions so it is
immediately obvious.
2014-12-12 23:27:17 +01:00
Sven Eberhardt b899e8944c Base variable naming in scenario saving on saved object count of same type name instead of object number.
This should yield shorter, more predictable names reducing changeset size when an Objects.c file is updated.
2014-09-22 19:21:25 +02:00
Sven Eberhardt cbb321307f Scenario saving fixes: Layers, fishes, sproutberries.
Do not save sprout berries that are still attached to sprouts. Omit some unnecessary properties for fishes.
2014-08-14 17:18:26 +02:00
Sven Eberhardt 50a5862b7a Store modified mesh material assignments in saved scenarios. 2014-04-18 14:20:10 +02:00
Sven Eberhardt 55083802b5 Updated SaveScenarioValueToString to recurse into arrays and allow custom save names for defs/proplists 2014-01-22 20:28:41 +01:00
Sven Eberhardt 21c132d2cb Fix StaticSaveVar saving to save string, not object pointer. 2013-12-30 12:24:41 +01:00
Sven Eberhardt 0db19586c8 Save StaticSaveVar as property in Objects.c
Otherwise, you'd have to re-set it every time you edit objects files in the editor.
2013-12-30 03:09:13 +01:00
Sven Eberhardt 5094cc5c1b Reworked "Save as scenario" option in editor to write a script file instead of Game.txt. 2013-12-27 17:10:09 +01:00