Commit Graph

5372 Commits (console-destruction)

Author SHA1 Message Date
Maikel de Vries 32f5b1cb25 add keypad to decoration objects
This can control lots of things and triggers on entering the correct code.
2016-09-26 17:15:37 +02:00
Lukas Werling 10622a9b61 Add generic A* implementation for path finding in graphs 2016-09-26 16:30:47 +02:00
Maikel de Vries 0e76c85531 make line overlap check a global function
This avoids code duplication and really is a Math.c function.
2016-09-24 17:30:19 +02:00
Maikel de Vries fb38acb946 allow setting plr view/zoom at player start object 2016-09-23 20:21:34 +02:00
Maikel de Vries 18424aaaa7 add rule to control pump speed 2016-09-23 09:26:06 +02:00
Maikel de Vries 4c7d27ec64 bats require less space on placement 2016-09-23 09:18:57 +02:00
Maikel de Vries 3df960851c _inherited() for trees to access library functionality 2016-09-20 15:11:32 +02:00
Maikel de Vries 823b13d764 add simple string to integer conversion function
Just a basic one in C4Script for now.
2016-09-18 11:30:35 +02:00
Lukas Werling db12ed7c99 Remove FindSubstring as it's really really slow
Use RegexSearch() instead, which is 100 times faster for large strings
(see benchmark results below).

Example benchmark:

    global func TestFindSubstring(int iterations)
    {
    	var result;
    	for (var i = 0; i < iterations; i++)
    	{
    		result = FindSubstring(hamlet, "and");
    	}
    	return result;
    }

    global func TestRegexSearch(int iterations)
    {
    	var result;
    	for (var i = 0; i < iterations; i++)
    	{
    		result = RegexSearch(hamlet, "and");
    	}
    	return result;
    }

    global func RunBenchmark(int iterations)
    {
    	StartScriptProfiler();
    	Log("FindSubstring: %d iterations", iterations);
    	var substr = TestFindSubstring(iterations);
    	Log("RegexSearch: %d iterations", iterations);
    	var regex = TestRegexSearch(iterations);
    	StopScriptProfiler();

    	if (!DeepEqual(regex, substr))
    		Log("Results differ: %v vs %v", substr, regex);
    }

Results:

    FindSubstring: 100 iterations
    RegexSearch: 100 iterations
    Profiler statistics:
    ==============================
    48903ms      Global.FindSubstring
    48903ms      Global.TestFindSubstring
    47979ms      Global.TakeString
    00504ms      Global.TestRegexSearch
    00016ms      Global.PushBack
    ==============================
2016-09-17 20:08:43 +02:00
Maikel de Vries 4b54b86d30 add function to find substrings 2016-09-16 17:25:22 +02:00
Mark ae1de739b0 Wooden Bridge: Return other bridge in CombineWith()
Apparently the return value is not used anywhere; the change allows chaining multiple bridges in a comfortable call.
2016-09-15 19:25:16 +02:00
Mark 58d42b8fd8 Library Lamp: Extracted functions.
Did this change a long time ago, probably for re-using functions in a derived object.
2016-09-15 19:17:17 +02:00
Sven Eberhardt 0cdad64934 Fix goal and rule displays (#1811) 2016-09-14 21:46:16 -04:00
Sven Eberhardt 22af9f0e8c Fix landscape placement functions (#1820, #1821) 2016-09-14 21:30:57 -04:00
Sven Eberhardt 61b1ab08ad Editor: More shortcuts; show helper shortcuts in tools menu 2016-09-10 01:17:40 -04:00
Sven Eberhardt d3d7256fec Fix missing achievement in Krakatoa's Krach (#1819) 2016-09-10 01:17:39 -04:00
Sven Eberhardt 53b365a6d2 Editor: Add shortcuts, menu items, tooltips 2016-09-08 01:56:01 -04:00
Sven Eberhardt b95d1387a4 Editor: Add "reset to saved scenario" command 2016-09-07 01:53:54 -04:00
Maikel de Vries f76e056cea add new items to knowledge in worlds 2016-09-06 17:06:05 +02:00
Maikel de Vries 17f98bd235 add helper functions chars 2016-09-06 17:06:05 +02:00
Sven Eberhardt 282a561462 Add editor props and user actions for boiling lava and acid
Also optimize the timer
2016-09-06 00:06:37 -04:00
Sven Eberhardt 6aeeff0545 Add Library_Stackable editor props 2016-09-05 20:19:25 -04:00
Sven Eberhardt db986e3dd7 Allow repeated ejection of infinite material stack counts in bucket and barrel 2016-09-05 20:08:30 -04:00
Sven Eberhardt 3330c592e3 Improve PlayerStart initial material setting to allow specification of weapon ammo, stackable stack count and liquid contents 2016-09-05 20:01:47 -04:00
Sven Eberhardt 34058e13f9 Fix default assignment of selected object in user action filtered object evaluators 2016-09-05 02:00:00 -04:00
Sven Eberhardt 117ddac8b4 Auto-unstick animals and objects on ground in saved scenarios 2016-09-05 01:59:59 -04:00
Sven Eberhardt 31ead2507a Add Unstick() script function
Also add a position parameter to Stuck() script function.
2016-09-05 01:59:58 -04:00
Sven Eberhardt 6a78a9facb Fix scenario saving of some animal and plant properties 2016-09-04 02:52:03 -04:00
Sven Eberhardt ebfebca87b Sequence: "Start Game" trigger uses first player as triggering player 2016-09-04 02:15:09 -04:00
Sven Eberhardt dc77020586 Add user actions: Invincibility and invisibility 2016-09-03 22:07:10 -04:00
Sven Eberhardt 692ff39c0e Add invisibility EditorProp to all object
Also localize some property names.
2016-09-03 22:07:10 -04:00
Sven Eberhardt 392dc7b49e Fix portrait reset when switching skin to non-extended decoration skin in editor while decoration definition is loaded 2016-09-03 22:07:08 -04:00
Sven Eberhardt bae26bb0d7 Add user action: Set clonk direction 2016-09-03 22:07:08 -04:00
Maikel de Vries 8e75b8fed9 allow branch placement in alternative materials 2016-09-03 19:38:52 +02:00
Maikel de Vries 914d0f4f8e fix scenario saving of waterfall 2016-09-03 19:37:39 +02:00
David Dormagen 4dd9be0e46 chippies: fix unintended growth through animal library
Inclusion of the library buffed the damage wild chippies do by 100%. This is unintended. Chippies grow (and get stronger) through sucking blood.
A commit that changes this behavior should address this directly. (This commit also makes chippies gain size a bit faster - as a compromise.)

The additional check in StartGrowth reduces overhead in the animals (and possibly plants) library. It is kept in this commit to give reviewers an example case for the check.
2016-09-02 09:34:19 +02:00
Sven Eberhardt bdbce1c4c9 Fixes and EditorProps for plant reproduction 2016-09-01 23:54:27 -04:00
Sven Eberhardt 31121d682c Rename option default value function property to DefaultValueFunction
It was "Get" and later "Set", which was always a bit confusing.
2016-09-01 18:32:24 -04:00
Sven Eberhardt 3b7e36abd8 Adjust chippie to use animal library for reproduction
(It still reproduces independently after sucking out a clonk)
2016-09-01 02:24:43 -04:00
Sven Eberhardt 9cec9b5071 Make animal library properties editor-adjustable
Allows e.g. placement of animals that do not reproduce.
2016-09-01 02:23:42 -04:00
Sven Eberhardt cd4e419aef Disallow interaction menu on hostile and neutral clonks
Stealing items in melees or taking quest items from NPCs is a bit odd.
2016-08-30 19:54:58 -04:00
Sven Eberhardt 4c56b41de0 Fix color group in "any" value evaluator of user actions 2016-08-30 19:42:31 -04:00
Sven Eberhardt c487c530e4 Fix respawn at flagpole position 2016-08-30 14:45:41 -04:00
Sven Eberhardt f3f475e38a Fix Time default initialization and add editor props 2016-08-30 02:00:02 -04:00
Sven Eberhardt e7c11cf590 Add user action evaluators: Enter+Exit object 2016-08-30 01:40:18 -04:00
Sven Eberhardt 76227e4e6c Add user action color evaluators: Player color, random color, RGB 2016-08-30 00:30:22 -04:00
Sven Eberhardt 48d8ad8de9 Add UserAction evaluators: for integer/player/object in list 2016-08-29 15:18:21 -04:00
Sven Eberhardt c72135db1f Add user action comment 2016-08-29 00:41:48 -04:00
Sven Eberhardt cc2f626063 Add UserAction conditional value evaluator
i.e. operator ? :
2016-08-29 00:32:52 -04:00
Sven Eberhardt bda3cb5640 Add UserActions to deactivate/reactivate player control 2016-08-28 22:18:58 -04:00