Commit Graph

8758 Commits (3760363a3be0828f12ca3dfe0bd2cb3c0642ac30)
 

Author SHA1 Message Date
Günther Brammer 3760363a3b Script: Add GetPrototype and SetPrototype functions
This should eventually replace the Prototype property, so that proplists
can be used as a key-value-storage without any hidden gotchas.

The Prototype is such a magical property that any code dealing with all
properties has to special-case it anyway, and isn't even returned by
GetProperties().
2016-04-28 02:59:11 +02:00
Günther Brammer 525cdc11a3 Deduplicate calculation of the relative stack position of local variables 2016-04-28 02:59:11 +02:00
Günther Brammer 071feaa78f Deduplicate loop control handling in the script parser 2016-04-28 02:59:11 +02:00
Günther Brammer d8e8d25ab4 Aul tests: CreateEffect 2016-04-28 02:59:11 +02:00
Günther Brammer efd4724084 Script: Add Scenario effects
These work just like global effects, except that effects from CreateEffect
get the scenario as target parameter in the callbacks.
2016-04-28 02:53:21 +02:00
Günther Brammer 97406d24d2 Script: Add Construction and Destruction effect callbacks 2016-04-28 01:08:04 +02:00
Günther Brammer 50378ffda0 Script: CreateEffect starts effects that receive callbacks themselves 2016-04-28 01:08:04 +02:00
Günther Brammer c167e990a5 Add GetName function to Actions 2016-04-24 19:40:29 +02:00
Günther Brammer e5cfb1858f Script: GetName() can return the property a proplist was defined in
This means that the ActMaps do not need to repeat their name anymore,
provided that all Scripts use GetName() instead of directly accessing .Name.
2016-04-24 19:40:29 +02:00
Günther Brammer 5a470f51f8 Move Effect functions to C4Script.cpp 2016-04-24 19:40:29 +02:00
Günther Brammer 2cdf553953 Change effect list getting function parameter type to C4PropList*
This makes it possible to move the effect functions to C4Script.cpp.
2016-04-24 19:40:29 +02:00
Günther Brammer e8811a7b21 Move global effects from ::Game to ::ScriptEngine
This even enables some simplification in the CompileFuncs, since the global
effects were already put in the same section as the other ScriptEngine
parts. The callback for updates due to relinks also fits nicely.

The reset in C4Game::Default was redundant with C4Game::Clear already.
2016-04-24 19:40:28 +02:00
Günther Brammer e2c6c2a841 Do not use C4Object in C4Effect
Instead, the pointer to the effect list is passed to the functions that
previously used the object to determine it.
2016-04-24 19:40:28 +02:00
Günther Brammer c89e73608b Unite getting the effects list from a C4Object pointer into a function
This way, that function can be re-implemented in standalone c4script.
2016-04-24 19:40:28 +02:00
Günther Brammer 42a15e3be9 Convert C4Effect parameters that do not need to be C4Object* to C4PropList* 2016-04-24 19:40:28 +02:00
Günther Brammer bfb9b6b1fd Drop the roundtrip through C4ID for the effect C4Def command target
Unfortunately, this complicates the C4Effect::CompileFunc to stay
compatible.
2016-04-24 19:40:27 +02:00
Günther Brammer 632c5cbd0f Refactor effect callbacks into helper functions 2016-04-24 19:40:27 +02:00
Günther Brammer e22ca51f72 Don't leak references to Strings on script errors (#583) 2016-04-24 19:40:27 +02:00
Günther Brammer 5fbac346d3 Incompatible type warnings work for parameters with type declarations 2016-04-24 19:40:27 +02:00
Günther Brammer 55572720bc Make the C4ScriptHost a ComponentHost again 2016-04-24 19:40:27 +02:00
Günther Brammer fb76308812 Make C4ValueConv::Type a constexpr variable instead of an inline function 2016-04-24 19:40:26 +02:00
Günther Brammer b54ddc7663 Merge branch script 2016-03-01 03:04:17 +01:00
Nicolas Hake fe91cec2b7 Merge remote-tracking branch 'github/pull/14' 2016-02-29 14:05:45 +01:00
David Dormagen 85fad425e2 updated docs for PV_Random and PV_Cos 2016-02-27 12:39:18 +01:00
David Dormagen 3d71dfbfa9 Particles: added a "seed" parameter to PV_Random (#1198) 2016-02-27 12:24:15 +01:00
David Dormagen bc5fededaf particles: added PV_Cos 2016-02-27 11:45:13 +01:00
David Dormagen 4c6d347c4d C4ValueArraySortStringscomp: silenced string-to-bool-conversion warning
VisualStudio gave a "performance warning" about this implicit cast. I actually don't know why, but this change makes the intention clearer anyway (since we are not returning the string contents but just whether they exist). So it's probably not bad regardless of whether the warning is weird.

http://stackoverflow.com/questions/1847860/why-is-there-a-performance-warning-on-cast-pointer-to-bool
2016-02-27 11:42:37 +01:00
Nicolas Hake 48ccc5f983 Render objects in front of landscape only once
The plane limits in C4ObjectList::Draw were not properly checked,
leading to objects in front of the landscape being drawn twice (once
before the landscape was rendered, and once after).
2016-02-25 01:09:48 +01:00
Nicolas Hake bfd9989fc6 Landscape Renderer: Create and bind 1D mat map texture before using
The landscape renderer used to store texture data into the default 1D
texture, which works but is a bad idea for several reasons (and would
have broken if we had a reason to use another 1D texture anywhere else).
2016-02-24 19:18:27 +01:00
Nicolas Hake f64f131f1b StdMesh*: Explicitly delete copy ctors/assignment ops 2016-02-24 01:46:58 +01:00
Nicolas Hake 72dc205582 GL: Add an object label to mesh IBOs 2016-02-24 01:46:58 +01:00
David Dormagen b69a304493 Fx*Damage reference: added "by_player" parameter; do not imply boolean return value
'whether' implies 'yes' or 'no'. That's wrong in this case.
2016-02-23 19:48:15 +01:00
Sven Eberhardt 65d6dd76a3 Meltign Castle: Fix item spawn after 4 minutes; add restart rule. 2016-02-21 17:36:29 -05:00
Sven Eberhardt 5963b9aed3 ItemSpawn: Add reset function to enable re-collection of item. 2016-02-21 16:56:19 -05:00
Sven Eberhardt e87ad1ecc1 MeltingCastle: Rebalance for slightly less rushing. 2016-02-21 16:31:20 -05:00
David Dormagen 63655f2763 global func Decay: some cleanups & added 'delay' parameter for decay speed 2016-02-20 17:57:55 +01:00
Armin Schäfer 9dca94a6b8 New Title image overlay. 2016-02-20 17:26:43 +01:00
Armin Schäfer 40016ae586 Replace old Decay methods in some animals.
# Conflicts:
#	planet/Objects.ocd/Animals.ocd/Bat.ocd/Script.c
2016-02-20 17:25:48 +01:00
Armin Schäfer 2893b22551 Add Decay function to Objects.ocg\System.ocg 2016-02-20 17:22:51 +01:00
Armin Schäfer 1ab375488f Fix AppendCommand(Jump) without target. 2016-02-20 17:21:31 +01:00
Maikel de Vries 4be356f4d9 diamonds: add option to place them not in groups 2016-02-19 22:13:09 +01:00
Maikel de Vries 46e18f5f9f kill tracing: add test for bomb arrow tumble kill 2016-02-19 22:13:09 +01:00
Maikel de Vries a0a5d98700 teleglove: add callback to reject control 2016-02-19 22:13:09 +01:00
Maikel de Vries 9266157a1e clonk: don't play doubt sound when exit command fails 2016-02-19 22:13:09 +01:00
David Dormagen 3227a43b17 HUD progress bar: fixed type of GUI positioning "Top" property
The method returns an int and we need a string. It's correct in all other places.
2016-02-16 19:01:03 +01:00
Julius Michaelis 68851106b4 Add a bit of documentation for the half-sold mask stuff. 2016-02-14 22:32:49 +01:00
Julius Michaelis c6a6b71c3a Specifically run python2 instead of python from the docs Makefile.
If this breaks anywhere, please revert this commit.
2016-02-14 22:32:29 +01:00
Maikel de Vries 1b94d0fcc8 reduce javelin damage
This way it really does what was promised in the last commit (ac8d5934), and not kill someone with 2 good throws.
2016-02-14 18:31:39 +01:00
Nicolas Hake 25deef7857 Merge fix for AnimationNode deserialization crash 2016-02-13 23:28:09 +01:00
Nicolas Hake ad01c2e48f Fix NULL deref when deserializing CustomNode AnimationNodes (GH #13) 2016-02-13 23:22:21 +01:00