Compare commits

...

2660 Commits

Author SHA1 Message Date
gitMarky 4a2048575f Refactor movement code (#87)
Improve readability by adding appropriate parentheses and braces, and fixing misleading/confusing whitespace. Extract SolidMask removal to a function since it's used in several places.
2019-03-05 21:15:39 +01:00
David Dormagen 765d9a24e9
Merge pull request #86 from fohly/master
better confetti for Boomshire
2019-03-02 10:19:55 +01:00
Philip Holzmann a844b6fe5b better confetti for Boomshire 2019-03-02 09:29:30 +01:00
Lukas Werling c9ee2c3eab Fix "no matching sound" error spam
Previously, the error message was only silenced for openclonk-server,
but appeared for openclonk if compiled without sounds.

Possible side effect: no local sounds will play if the global Sound.ocg
cannot be loaded. I don't think this is something we should support.
2019-02-20 09:36:35 +01:00
Lukas Werling 319dc87eea Remove #undef new/delete before Qt includes
This has not been necessary anymore since a1885006 ("Remove MS CRT
memory management debugging").
2019-02-19 15:35:00 +01:00
Lukas Werling 60841c1d96 Write text files with unix file endings
The old LineFeed constant caused problems with Qt. Using \n directly is
easier and I don't think there's a reason left to use \r\n anyways.
We've always converted the files in the repository. Nowadays, even
notepad.exe works with unix file endings.
2019-02-19 15:28:12 +01:00
isilkor a00566ca9e
Merge pull request #85 from isilkor/better-warning-pragma-parsing
Better warning pragma parsing
2019-02-17 14:04:00 +01:00
Nicolas Hake a0c9bfd931 Aul: Correctly check for enable/disable keywords in warning pragma
The parser was only checking that the passed setting matched the
beginning of the expected keyword, instead of checking for the full
length. This way, users could write "#warning e" instead of the
expected "#warning enable" and still have it work.
2019-02-17 11:58:03 +01:00
Nicolas Hake c8d22e321b Aul: Throw correct exception on parameter-less warning pragma
When no parameter followed the "#warning" pragma, because the end
iterator would be located before the begin iterator, basic_string's
constructor would throw std::length_error. Check for this case
beforehand so we can throw the expected C4ParseError instead.
2019-02-17 11:58:03 +01:00
Lukas Werling 918c4139e8 Add Flintbrawl by Zapper 2019-02-03 19:14:53 +01:00
Lukas Werling ee35d256aa Add basic character classes to WildcardMatch() 2019-02-03 19:14:53 +01:00
Lukas Werling 75d4ac2512 Fix team count inconsistency with random teams (#2051)
Switching to random teams would remove all teams but the first two on
the host, but not on the clients. With this fix, the extra teams are
removed on the clients as well. This fixes a desync when using
GetTeamCount() in a sync-relevant way.
2019-02-02 00:27:36 +01:00
Lukas Werling f6fba582f3 Fix star placement on full map screenshots (#1454) 2019-01-30 22:50:23 +01:00
Linus Heckemann c7550bd43c openclonk-server: install 2019-01-20 12:49:39 +01:00
Linus Heckemann 69fd50bee1 nix expression: fix build
Now that openclonk gets installed to bin, we don't need to (and
can't!) create the symlink anymore.
2019-01-20 12:38:54 +01:00
isilkor ad2eddcd63
Merge pull request #80 from isilkor/check-setlength-parameter-for-nil
Script: Test SetLength parameter 0 for nil (GH #79)
2019-01-05 19:47:38 +01:00
Nicolas Hake 486619b653 Script: Test SetLength parameter 0 for nil (GH #79)
SetLength didn't check whether its first parameter was valid, and
attempted to dereference a NULL pointer when passed nil.
2019-01-05 19:25:35 +01:00
Lukas Werling 3a59c15250 Add openclonk:// protocol handler (#1657) 2019-01-02 17:16:09 +01:00
Nicolas Hake d7ea9acfea C4Property: Don't use operator void* in tests anymore either 2019-01-01 22:20:04 +01:00
Nicolas Hake 5cf852d8ab C4Property: Add missing template<> specifier
MSVC doesn't care, apparently.
2019-01-01 21:55:42 +01:00
Nicolas Hake 0a81206b7e C4Property: Remove raw operator void*
operator void* is a quick and dirty workaround for the lack of
explicit operator bool in old C++ standards. Since we can use
explicit operator bool now, we don't need the operator void*
anymore.

Incidentally, that operator also allowed C4Set to equality compare
C4Property entries, which is unintuitive. Replace it with an
explicit specialization of C4Set::Equals.
2019-01-01 21:35:08 +01:00
Nicolas Hake 31c7805f10 C4Set: Replace elements with zero-initialized ones on clear
C4Set used to set its removed elements to nullptr. This requires
some special handling from non-pointer entries like C4Property.
Overwriting the element with a zero-initialized one removes this
requirement, leading to improved type safety on the part of
C4Property.
2019-01-01 21:35:08 +01:00
Nicolas Hake 15ad4fb690 MSVC: Disable incremental linking
LTCG doesn't work with incremental linking, but unless we explicitly
disable incremental linking, CMake tells the linker to attempt it.
2019-01-01 21:26:30 +01:00
Nicolas Hake 3a8830af6e C4Effect: Remove obsolete fire effect constants
These constants aren't used anywhere inside the engine anymore and
should therefore be removed.
2019-01-01 20:52:38 +01:00
Nicolas Hake 1b2f2889ad Old CMake: Correctly handle try_compile with language standard flags
CMake before 3.7 didn't properly pass the standard selection flags
to try_compile. Wrap try_compile on old CMake versions so that the
flag gets passed.
2018-12-31 17:34:34 +01:00
Nicolas Hake bc88820d57 Travis: Use CMake 3 on Ubuntu Trusty 2018-12-31 14:53:07 +01:00
Nicolas Hake 3edc6d9ead Fix misleading indentation on several controlled statements
The C++ standard doesn't require us to stuff multiple statements
onto the same line, so we should avoid this for readability reasons.
This is especially true if one of the statements is controlled and
others aren't.
2018-12-31 14:27:14 +01:00
Nicolas Hake dca6d2caaf C4Landscape: Correct really badly misleading indentation
Some code here was indented like it still belonged to the loop
above, but never did, and was never intended to. This is an
excellent argument for why braces are good, especially for
statements which span more than one line.
2018-12-31 14:17:23 +01:00
Nicolas Hake 7cd79b1eaa CMake: Use native Qt5 config instead of bad reimplementation
Qt5 already ships CMake configuration files with proper dependencies
so there's no need to build our own broken test for it.
2018-12-31 12:48:19 +01:00
Nicolas Hake 3b0891ba89 CMake: Remove #define for standard C++ features
We don't need to have a macro that just tells us that we're in fact
using standard C++. Especially if it isn't used anywhere.
2018-12-31 12:37:34 +01:00
Nicolas Hake b012189af4 CMake: Remove <stdint.h>, <inttypes.h> tests
<stdint.h> and <inttypes.h> are part of the C standard and available
on every platform with a conforming compiler.
2018-12-31 12:33:49 +01:00
Nicolas Hake c638647227 CMake: Remove <locale.h> test
We're not using the <locale.h> header anywhere besides including it
for no purpose, so we can drop the test (and the inclusion).
Additionally, the header is part of standard C++.
2018-12-31 12:30:06 +01:00
Nicolas Hake 8298813a90 CMake: Remove <direct.h> test
We're not using the <direct.h> header anywhere besides including it
for no purpose, so we can drop the test (and the inclusion).
2018-12-31 12:20:39 +01:00
Nicolas Hake 15f4a06cd4 CMake: Require C++14 support
CMake now supports compiler features (including language level), so
we can directly require C++14 instead of testing for compiler-
specific flags.
2018-12-31 12:15:49 +01:00
Nicolas Hake b702f1583c CMake: Update requirements to 3.5.1
CMake 3.5.1 is the version that ships with Ubuntu 16.04 LTS. Ubuntu
14.04 LTS was already unsupported by our build, so we don't need to
worry about that.
2018-12-31 11:51:21 +01:00
Nicolas Hake 606ad23e02 CMake: Deprecate CMAKE_ADDITIONAL_DEPS_PATH
The variable completely duplicates a different one and also intrudes
on CMake's own namespace. It should therefore be removed when
possible.
2018-12-31 11:34:18 +01:00
Mark a29d6f005c Added method for getting the connected object 2018-12-28 00:34:57 +01:00
Mark cd38671f61 Pipe control: Begin integrating limits into the library
Not sure about air pipes yet, those should theoretically be either
source or drain, instead of a separate connection category?

See also:
https://bugs.openclonk.org/view.php?id=1871
2018-12-28 00:14:54 +01:00
Mark 2a045a097b Renamed folder 2018-12-27 21:33:45 +01:00
Mark a8c475d212 Renamed pipe control internals 2018-12-27 21:31:36 +01:00
Mark 00b1b37787 Renamed Library_Tank to Library_PipeControl
The library did not depend on the Library_LiquidContainer script at all,
removed that include and added it to the previous includers.
Removed the IsLiquidTank() identifier, because it was unused.
2018-12-27 21:21:53 +01:00
Mark 94e200f201 Fix smoke and gravity issue
Smoke used to fly higher with gravity 40 than with gravity 10. Fixed
this by using a start value. At default gravity, light smoke will fly
rise a little higher now, and heavy smoke behaves the same.
With higher gravity the smoke may fall to the ground now.
2018-12-27 20:30:58 +01:00
Mark d0756e3b1c Producer: Allow overloading where the producer takes components from 2018-12-27 19:51:19 +01:00
Mark 68bb07f162 Allow more options for customization in the resource selection icons 2018-12-27 17:45:32 +01:00
Mark 3f2ee5080d Limit liquid input to the maximum available amount 2018-12-25 16:53:47 +01:00
Mark 1c9164b4be Collect cut pipes to Clonk inventory, if possible 2018-12-25 15:53:51 +01:00
Mark f5b1279cce Formatted code 2018-12-25 15:16:38 +01:00
Mark 431456d1fa Use new library in pump 2018-12-25 11:13:01 +01:00
Mark 8a26454f3c Library: Resource selection
The resource/material selection from the pump was practical, maybe even
applicable for cable cars and the like. Extracted a separate library for
that.
2018-12-25 11:11:44 +01:00
Mark bab1b7ee90 Extracted actual producer logic||Certain external projects have different systems and want to just use the logic on their own, without copy & paste of the file contents. 2018-12-21 21:29:45 +01:00
Mark 286d4d6a5b Added version info to the docu 2018-12-21 21:15:11 +01:00
Mark cf7469043d Simplified logic for substitutes
The production cost method returns an array of material cost arrays, but
their format has changed. Instead of
  [<default resource>, <cost>, <substitute(s)>]
it now returns an array of proplists
  [{Resource = optionA, Amount = costA}, {Resource = optionB, Amount =
costB}]
so that there are fewer cases to keep in mind: No "are there
substitutes?", but you can simply check all variants and pick the best.
This also allows different substitutions, for example "2 earth or 3
sand" is now possible.
2018-12-21 16:54:43 +01:00
Mark 36dbbd27e1 Formatted code 2018-12-21 14:26:24 +01:00
Mark c6254c2512 Added more producer tests 2018-12-21 14:05:30 +01:00
Mark 2ed69b96a5 Added producer test for substitute components 2018-12-21 11:57:39 +01:00
Mark b73169616b Fix producer test
Updating the values for substitutions was forgotten in 808e7fa, leading
to a failing test 5.
2018-12-21 11:49:56 +01:00
Mark 6bdb4275f7 Formatted code, no change in functionality
Brackets, protected/private func => func, whitespaces
2018-12-21 11:25:19 +01:00
Mark d9bc1d9142 Added callback for production progress 2018-12-21 11:08:10 +01:00
Mark 9deab8e6a9 Fix the logic again
Otherwise you can exit containers without an entrance area.
2018-12-21 09:56:19 +01:00
Mark b35a58a7fc Removed unused constants
This was a weird menu thing that I added about 2 years ago, and it is
not very useable, and not used :)
2018-12-21 09:10:33 +01:00
Mark ed514b7716 Added option for ignoring contents in the interaction menu
Also ignore Clonks as "inventory items" if they are contained.
2018-12-21 09:01:20 +01:00
Mark fcf2af1937 Fix not being able to exit a structure
It seems that the default structures have the entrance close to the
offset, so that there is an overlap and can_be_entered is true even
inside the structure.

In my case the structure offset and entrance area do not overlap, so you
could unfortunately not leave the structure.
2018-12-20 23:49:39 +01:00
Mark 6351fe7a66 GetEnergy() offers exact energy value optionally (Bug #2043) 2018-12-20 08:40:04 +01:00
Nicolas Hake 11cfcdd910 Appveyor: Stop depending on specific Qt build for building too 2018-11-18 10:15:28 +01:00
Nicolas Hake 5808ca8047 Appveyor: Stop depending on specific Qt build
AppVeyor occasionally updates platform images without really
versioning them, so in order to have a higher chance of not being
broken by those, we'll just use 5.11 instead of specifying 5.11.1
explicitly.
2018-11-18 10:02:11 +01:00
Nicolas Hake f90e424f4a Appveyor: Bundle C4Group
Users have requested that C4Group is bundled with the snapshots, and
the file itself is fairly small, so it should be fine to ship it as
well.
2018-11-14 20:03:52 +01:00
Lukas Werling 34d89adf47 Fix build on gcc 4.x 2018-10-15 21:01:15 +02:00
Clonkonaut c6d5c5044f Rework interaction menu into a new style. Also, style overloads are easily possible.
Because I did this in the test scenario first, it wasn't really possible to encapsulate different steps, sorry!
2018-10-15 17:38:22 +02:00
Lukas Werling 952cfef497 Add missing C4Include include in C4ConsoleQtShapes
Qt's moc generates another source file that includes this header without
including C4Include.h first. The generates source file thus doesn't
compile. It is unclear to me why this isn't an issue with our current
build setup (it is an issue with a meson-based build).
2018-10-14 23:19:32 +02:00
Lukas Werling a73e5fc871 undef "s" macro in C4Config
Necessary for unity builds, but also has a high conflict probability in
general.
2018-10-14 23:16:59 +02:00
Lukas Werling ca11d86893 Add missing include guards
These are necessary for unity builds.
2018-10-14 23:15:01 +02:00
Lukas Werling 7273b87b01 StdAdaptors: Replace array size macros with templates 2018-10-14 23:07:23 +02:00
Clonkonaut 2d3914b33b Fresh repository, fresh build on Windows, VS created these folders. Hope it's cool to put them on ignore. 2018-10-10 01:43:58 +02:00
Nicolas Hake a65dd5874f Appveyor: Fix library bundling path 2018-10-08 20:57:39 +02:00
Nicolas Hake ca2ba96969 Appveyor: Generate package and upload it if credentials are set 2018-10-07 20:21:17 +02:00
Nicolas Hake 6dcaaa7af5 Appveyor: Inject Google Test location 2018-10-07 20:21:17 +02:00
Nicolas Hake 9691c1e41a Appveyor: Build on Visual Studio 2017 x64 only
There is no pre-built binary package of Qt for 32 bit Visual Studio
2017, so we'll drop it for now.
2018-10-07 20:21:17 +02:00
Nicolas Hake 354b6be1c6 CI: Use AppVeyor to build MSVC binaries 2018-10-07 20:21:17 +02:00
Julius Michaelis 0d7738dce5 Drop broken GCC precompiled header support 2018-10-04 08:33:31 +02:00
Lukas Werling 04535b5438 Travis: Add update information for AppImage snapshots 2018-10-03 23:45:45 +02:00
Lukas Werling 55c34ecbd7 Add git branch to C4Version.h
The branch information is necessary for upcoming automatically-updating
snapshots. For Travis, cmake will also pick up the branch name from the
C4REVISION_BRANCH environment variable.
2018-10-03 23:44:35 +02:00
Lukas Werling 7616fa81be Travis: Update dependencies for AppImage snapshot 2018-09-25 20:02:51 +02:00
Lukas Werling 950ad4cf2f Fix C4ScriptLibrary destruction
C4PropListStaticMember must be deleted manually.
2018-09-25 20:02:51 +02:00
Lukas Werling 05e3648495 Travis: Skip TCP bind test because of missing IPv6 support 2018-09-25 20:02:51 +02:00
Lukas Werling 82feac4ccb Remove broken assert() 2018-09-25 20:02:51 +02:00
Lukas Werling 8aeef938fc Travis: Build and upload AppImage snapshot 2018-09-25 20:01:16 +02:00
Lukas Werling 8df71d3f32 Prevent parallel groups packing with ninja
For some reason, generating the groups in parallel fails frequently.
2018-09-24 19:22:32 +02:00
Lukas Werling 5395a8dc84 Add WITH_APPDIR_INSTALLATION configuration option
With this option enabled, `make install` will install the files in an
AppDir-compatible directory structure suitable for creating an AppImage.
2018-09-24 19:22:32 +02:00
Lukas Werling d8add861fe Fix LTO ar wrappers for versioned gcc executables
Debian packages older/newer gcc versions with executables named like
gcc-5, gcc-ar-5. The previous implementation did not handle this
correctly, breaking LTO-enabled linking.
2018-09-24 17:43:27 +02:00
Lukas Werling 2fb14b026d Script: Remove effect after error in Timer
As the timer tends to run more than once, you'd also very likely get the
error more than once. The timer also often determines the effect
lifetime, making a broken effect live forever.

This was especially annoying with one-off Schedule() invokations
that wouldn't even stop throwing errors after finishing the
designated number of repeats. Although fixing just that script
function would have been possible, I believe that a more general
solution for all effects is useful.
2018-08-26 23:15:05 +02:00
Nicolas Hake f5988085a7 Figure out whether a warning/error was #include'd or #appendto'd
We already notified the user on warning/error that the mistake
happened in a different script than the one we were currently
compiing. It's not too difficult to figure out whether that other
script was added due to an #include or an #appendto directive, so we
can just show the user which one it is.

We also don't show warnings in #include'd scripts anymore, since
they get compiled individually anyway and all warnings will show up
there. This way we don't duplicate warnings several times.
2018-07-24 14:35:12 +02:00
Nicolas Hake 829bb8cb28 Script functions: remove all BCCs at once instead of individually 2018-07-24 14:24:19 +02:00
Nicolas Hake 1cd3534740 C4KeyboardInput: Replace std::bind2nd &c by lambda
std::ptr_fun and std::bind_2nd have been deprecated since C++11, and
are no longer part of the standard since C++17.
2018-07-24 14:21:42 +02:00
Nicolas Hake 907c701fc6 Save scenario: Disable all warnings in auto-generated file 2018-07-24 14:20:09 +02:00
Nicolas Hake 4c5dfac952 Remove or use unused variables in Objects, System 2018-07-24 14:19:26 +02:00
Nicolas Hake 5ef52f2450 Fix variable_out_of_scope warnings in Worlds 2018-07-23 12:30:23 +02:00
Nicolas Hake 14ed608941 Fix variable_out_of_scope warnings in Missions 2018-07-23 12:30:23 +02:00
Nicolas Hake 7fb098c4df Fix variable_out_of_scope warnings in Defense 2018-07-23 12:30:23 +02:00
Nicolas Hake 1ef6b7a7fc Fix variable_out_of_scope warnings in Arena 2018-07-23 12:30:23 +02:00
Nicolas Hake 1bb728b047 Fix variable_out_of_scope warnings in Objects 2018-07-23 12:12:23 +02:00
Nicolas Hake 4c43ebf58c Warn when using variables outside of their block
When we introduce block scoping, using variables declared in a more
narrow scope from a block with wider scope will fail. Warn about
these so people can avoid it and fix their code.
2018-07-23 12:12:23 +02:00
Nicolas Hake b82cd52765 HotIce: Add closing brace omitted in c3ef039 2018-07-23 12:10:02 +02:00
Nicolas Hake a73c1998e4 Fix suspicious_assignment warnings in World 2018-07-23 10:45:52 +02:00
Nicolas Hake c4f47a6329 Fix suspicious_assignment warnings in Parkour 2018-07-23 10:45:52 +02:00
Nicolas Hake c3ef039872 Fix suspicious_assignment warnings in Arena 2018-07-23 10:45:52 +02:00
Nicolas Hake 8950db9cb4 Fix incorrect assignment instead of comparison in TutorialGuide 2018-07-23 10:45:52 +02:00
Nicolas Hake 30aa6abb55 Move PlaceBatches into System.ocg 2018-07-23 10:45:52 +02:00
Nicolas Hake 05ca450111 Fix suspicious_assignment warnings in Missions 2018-07-23 10:45:52 +02:00
Nicolas Hake 806357e283 Fix suspicious_assignment warnings in Defense 2018-07-23 10:45:52 +02:00
Nicolas Hake 808a90e5af Fix suspicious_assignment warnings in Decoration 2018-07-23 10:45:52 +02:00
Nicolas Hake e024bef54b Fix suspicious_assignment warnings in Objects, System 2018-07-23 10:45:52 +02:00
Nicolas Hake 81dff1b92a Disable suspicious_assigment warning in for conditions
While I do not agree with the idea of using straight assignments in
the condition of a for loop, people are divided on the argument and
lots of old code uses it.
2018-07-23 08:29:46 +02:00
Maikel de Vries ddc68d7ad3 column: proper rotation and allow smaller sizes 2018-07-04 08:30:53 +02:00
Maikel de Vries c3b114042d melt snow and ice much faster while submerged in lava 2018-07-04 08:17:11 +02:00
Maikel de Vries c47b790468 remove recently introduced debug logs 2018-06-25 08:49:10 +02:00
Maikel de Vries 7a933e81b7 windbag: scenario save full load to prevent air intake at scenario start 2018-06-23 15:36:20 +02:00
Maikel de Vries 5bb9fa228a ladder: climb up and down smoothly when grabbing ladder
I don't know the reason for not having this, but now we mimic normal wall climbing behaviour which is much smoother and leads to faster game play.
2018-06-23 10:05:45 +02:00
Maikel de Vries b11a25db4b fire: only reduce own fire strength if incineration of nearby object was successful 2018-06-23 10:05:45 +02:00
Maikel de Vries 446564f703 implement eternal flame saving 2018-06-23 10:05:45 +02:00
Lukas Werling f8c0fe6f82 Fix fallthrough in command line parsing 2018-04-23 12:12:32 +02:00
Lukas Werling 6d5dc2b92e c4group -l: Print both file and contents CRC
The contents CRC is the number that actually counts for group equality,
whereas the file CRC may differ, for example because of different
compression.
2018-04-21 21:41:28 +02:00
Martin Strohmeier a51560ce4f Add Nautilus to music folder 2018-04-21 15:13:32 +02:00
Romain Naour 4ae0a92d39 CMake: add C4GROUP_TOOL_ONLY
When cross-compiling c4group should be build for the host
machine before building OpenClonk for the target.

Without C4GROUP_TOOL_ONLY option, we have to build OpenClonk
for the host.

C4GROUP_TOOL_ONLY allow to build only c4group tool for the
host.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
With this patch I can build OpenClonk with Buildroot.
2018-04-21 10:58:31 +02:00
Romain Naour 87b60e99f6 CMake: use FIND_PROGRAM
While cross-compiling, it is easier to find a binary
from the patch using FIND_PROGRAM instead of using
a cmake file.

Try to find c4group native tool with FIND_PROGRAM and
fallback to the cmake file if c4group is not found.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2018-04-21 10:18:50 +02:00
Romain Naour 48c38c91dc CMake: build libmisc and libc4script statically
As reported by [1], some distributions use shared libraries as
default preset in CMake.

Without explicitely linking statically libmisc and libc4script,
we have the following link issue:

[...]/host/bin/x86_64-linux-g++ --sysroot=[...]sysroot
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os
-std=gnu++14 -Wall -Wextra -Wredundant-decls -Wendif-labels
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self
-Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor
-Woverloaded-virtual  -DNDEBUG
-rdynamic CMakeFiles/c4group.dir/src/c4group/C4GroupMain.cpp.o
-o c4group
-Wl,-rpath,[...]/build/openclonk-7.0:
liblibmisc.so -lz -lpthread -lrt
liblibmisc.so : référence indéfinie vers « C4LangStringTable::Translate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const »
liblibmisc.so : référence indéfinie vers « C4LangStringTable::system_string_table »

[1] https://github.com/openclonk/openclonk/pull/26

While at it, build libopenclonk statically since libopenclonk is not
installed by the CMake build system.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2018-04-21 10:18:50 +02:00
Lukas Werling 9fed69f3fa Add resolution uniform for sprite and mesh shaders (#2031)
The landscape shader already has such a uniform.
2018-04-18 12:02:43 +02:00
Lukas Werling 9a6772c27e Fix phase by xdir for DFA_Push (#2030) 2018-04-18 11:35:28 +02:00
Maikel de Vries 899fbaa867 cable cars: let sawmill send empty hoist to pickup trees 2018-04-16 11:13:32 +02:00
Maikel de Vries a4d20d79d5 cable cars: extend order interface and let producer order more components at a time 2018-04-16 11:13:32 +02:00
Mark 75a82e172a Added a generic ambient sound object
Is more versatile than Ambience_Zicadas. Could need some editor
functions. Backported from OC Classic.
2018-04-14 14:12:52 +02:00
Mark 25d008e99d FatalError: Allow formatting the message directly
FatalError(Format(...)) was necessary previously. Actually it seems not
like a huge thing, but being able to format the string directly in
FatalError is a lot more convenient.
2018-04-12 21:39:06 +02:00
Maikel de Vries 1e060d6124 cable cars: improve deliveries and producer requests fuel 2018-04-12 09:21:00 +02:00
Maikel de Vries 618b4039b3 cable cars: fix finding crossing for power supply when previous fails 2018-04-12 09:21:00 +02:00
Maikel de Vries 051863db5f make cable crossing structure flippable
This makes it easier for now to go around cliffs, a better solution where crossings can be rotated needs more work in the hammer script.
2018-04-12 09:21:00 +02:00
Maikel de Vries f4991f9705 remove base respawn rule
Is deprecated in 8.0 and can be removed now, all functionality is implemented in the relaunch rule.
2018-04-12 09:21:00 +02:00
Julius Michaelis 5e60579bd2 Document the zoom factor in Graphics.8.png in sdk/definition/index 2018-04-12 01:41:32 +02:00
Maikel de Vries c00a8cf3c3 fix a bunch of suspicious assignment warnings 2018-04-09 11:53:55 +02:00
Lukas Werling d9f9a2a9a3 Find_Property: Implement searching for specific value (#2021) 2018-04-08 15:00:27 +02:00
Mark 5dc4282b56 Replaced old calls to GainMissionAccess 2018-04-05 19:36:50 +02:00
Mark 4212310a9f Renamed *MissionAccess functions
Added legacy wrappers and updated the documentation.
2018-04-05 19:34:16 +02:00
Sven Eberhardt 065c8b7d96 Fix zoom setting by PlayerStart object 2018-04-04 19:59:32 -07:00
Mark a987f87181 Add version parameter to legacy warning 2018-04-04 21:49:39 +02:00
Nicolas Hake 704994f1b9 Remove warning on assignment in while() conditions (for now) 2018-04-04 21:42:24 +02:00
Mark 75bfef6b06 Use SetNextScenario() in the scenarios 2018-04-04 21:22:04 +02:00
Mark 1682f62df8 Function: SetNextScenario
Renamed and documented the former function SetNextMission. Added a script wrapper for the old function that issues a warning. Renaming is based on the fact that the docu speaks of scenarios, and other functions, such as GainScenarioAchievement already use this terminology
2018-04-04 21:17:16 +02:00
Maikel de Vries 82e674ddb8 cable cars: make crossing proper structure and resource chute upgrade 2018-04-02 16:03:52 +02:00
Maikel de Vries a70ab8b843 cable cars: let steam engine request coal when needed 2018-04-01 20:54:12 +02:00
Maikel de Vries 7178cf6a0a cable cars: improve hoist destination selection 2018-04-01 20:54:12 +02:00
Maikel de Vries 42a62aa730 cable car: make car a power consumer via crossings 2018-04-01 20:54:12 +02:00
Maikel de Vries 3085bfd264 power system: add functions to check if production and consumption is registered 2018-04-01 20:54:12 +02:00
Mark b12e54ef21 New coal texture 2018-04-01 20:29:54 +02:00
Lukas Werling 1382478774 Extract Goal_MultiRoundMelee from HotIce
There are currently multiple multi-round scenarios in development that
all copy most of HotIce's >500-line scenario script for the multi-round
logic. This commit isolates that logic in a goal with an easy-to-use
interface.
2018-03-31 16:08:29 +02:00
Maikel de Vries 07e66279be cable cars: scenario saving for cable car 2018-03-31 11:33:08 +02:00
Maikel de Vries 816754a3de cable cars: improve tests and script clean up 2018-03-31 11:32:42 +02:00
Maikel de Vries c629661af2 cable reel: fix connecting, max cable length, ensure straight cables 2018-03-31 10:44:36 +02:00
Maikel de Vries a28b3b9ca1 cable cars: fix network recreation when cable has broken 2018-03-30 10:54:41 +02:00
Maikel de Vries d8736a56ac cable cars: improve network deletion and recreation + clean up
This is a rather chaotic commit and does not solve all problems of network creation yet, but is an improvement over the old system where deletion of a cable line would fail the network. However, we probably need a cleaner method to construct a network properly.
2018-03-29 21:28:07 +02:00
Maikel de Vries 49d03e52c6 improve cable car test scenario 2018-03-29 21:28:07 +02:00
Maikel de Vries 2b9c96de30 make hoist target move more fluently 2018-03-29 21:28:07 +02:00
Maikel de Vries ff21dc3cfa improve destination selection menu a bit 2018-03-29 21:28:07 +02:00
Maikel de Vries 330e275b3d cable hoist: new type effect, prevent interactions when attached, complete menu texts 2018-03-29 21:28:07 +02:00
Maikel de Vries 85f1c714f7 add material costs to cable car components 2018-03-29 21:28:07 +02:00
Maikel de Vries 7768e6c992 fix script error when accessing non-initialized cable request queue 2018-03-29 21:28:07 +02:00
Maikel de Vries abfeb86e30 add cable cars test scenario 2018-03-29 21:28:07 +02:00
Maikel de Vries d7e3a4acd6 cable car: not ready for a new delivery if currently doing one 2018-03-29 21:28:07 +02:00
Maikel de Vries b1d1079d88 prevent script error in cable station if other station could not be found 2018-03-29 21:28:07 +02:00
Maikel de Vries e603bce240 add interaction menu tooltip and description for disengaging a cable car 2018-03-29 21:28:07 +02:00
Maikel de Vries 2a344b4543 fix hide in editor for cable car objects 2018-03-29 21:28:07 +02:00
Nicolas Hake 18b23d3d1e Merge pull request from ckanibal:slashfix
Slashfix (GH-68)
2018-03-29 14:48:45 +02:00
Nicolas Hake b0336bc1a6 Merge pull request from ronnystandtke:patch-1
Update openclonk.desktop (GH-67)
2018-03-29 14:46:35 +02:00
Lukas Werling 8d6090e607 Fix documentation of OverlayType
Bit 3 (C4MatOv_Monochrome) was removed in fc5c38468 ("Material: Remove
color field, use textures as is", 2009), but was still mentioned in the
documentation.
2018-03-27 19:20:21 +02:00
Nicolas Hake c73b8b3ece Warn on assignments where an expression is expected
This introduces a new diagnostic (suspicious_assignment) which
issues when an the compiler finds an assignment either where a
condition is expected or as the parameter to return.
2018-03-27 08:12:21 +02:00
Lukas Werling 99c14b5547 docs: Drop major version part from <version>s
The actual release names dropped the 5.x.x scheme long ago, so there is
no reason to keep it in the docs. It's extra confusing there because the
version is given as a two-part version (e.g. 5.1) most of the time, so
it looks like everything happened in OC 5.x, even though the change was
actually in OC x.0.
2018-03-24 23:13:08 +01:00
Lukas Werling 8e17d7fd7b docs: Fix case-sensitivity in search 2018-03-24 22:19:58 +01:00
Lukas Werling f4c854b651 docs: Implement client-side search
Search is now performed with a pre-computed index file. This commit
removes the old PHP-based search.
2018-03-23 21:23:38 +01:00
Mark 6aa72c1bdd Fix axe 2018-03-22 22:12:00 +01:00
Nicolas Hake b12792dddb Merge branch 'blake2-no-sse2' 2018-03-21 13:04:15 +01:00
Nicolas Hake e0850947bf BLAKE2: Fall back to plain C implementation on non-amd64 platforms
While amd64 always supports the SSE2 instruction set extension,
other architectures don't (including 32 bit x86). For the platforms
that don't, we'll use the reference C implementation by default, but
allow users to override it with the BLAKE2_USE_SSE2 option.
2018-03-21 13:00:40 +01:00
Nicolas Hake 570ba7a8ad Merge branch 'blake2-no-sse2'
This adds the BLAKE2 reference C implementation as a fallback for
architectures that don't guarantee SSE2 support out of the box.

Closes GH-69.
2018-03-21 07:58:56 +01:00
Nicolas Hake 1dd7cbb04a BLAKE2: Fall back to plain C implementation on non-amd64 platforms
While amd64 always supports the SSE2 instruction set extension,
other architectures don't (including 32 bit x86). For the platforms
that don't, we'll use the reference C implementation by default, but
allow users to override it with the BLAKE2_USE_SSE2 option.
2018-03-21 07:51:52 +01:00
Lukas Werling 69a08605cb docs: Change http:// links to https 2018-03-20 21:59:47 +01:00
Mark 21102bb4ef Melee Weapons: Code formatted for remaining melee weapons
No actual changes, just added spaces and brackets for improved readability
2018-03-20 21:13:45 +01:00
Mark 69d6b2e8d2 Melee Weapons: Code formatted
No actual changes, just added spaces and brackets for improved readability
2018-03-19 20:51:29 +01:00
Nicolas Hake 288e9f339b Merge commit '9493ed1277ef924c3005a9ff51f194d1cda87947' as 'thirdparty/blake2' 2018-03-19 13:50:17 +01:00
Nicolas Hake c39d1b8679 Merge commit '9493ed1277ef924c3005a9ff51f194d1cda87947' as 'thirdparty/blake2' 2018-03-19 13:50:17 +01:00
Nicolas Hake 9493ed1277 Squashed 'thirdparty/blake2/' content from commit beb75f451
git-subtree-dir: thirdparty/blake2
git-subtree-split: beb75f4512223e6a3a03a48992345256c5ef393a
2018-03-19 13:50:17 +01:00
Nicolas Hake ae0baf587d Remove BLAKE2b implementation requiring SSE2 2018-03-19 13:47:01 +01:00
Mark aea27f8758 Construction site: Take missing materials as interaction 2018-03-18 19:53:57 +01:00
Clonkonaut 4199a4060e Documentation: fixed example for GetRGBaValue(). 2018-03-18 13:41:23 +01:00
Clonkonaut 6f521a0805 Tutorial 8: fix in German language dialogue (#2009). 2018-03-17 17:21:18 +01:00
Clonkonaut 80b3a08770 Removed my stupid debug log. 2018-03-17 16:41:27 +01:00
Clonkonaut 4b0bca3c0d Tutorial 2: Tell the player about Roger a bit earlier (when entering the junction), so you do not miss him and mess up the scenario. 2018-03-17 16:31:43 +01:00
Maikel de Vries 52d8fdbafd warn about deprecated use of base respawn rule 2018-03-16 18:16:05 +01:00
Maikel de Vries 81b060ffb3 fix king of the hill graphics in editor mode 2018-03-16 14:00:04 +01:00
Maikel de Vries ffbda90130 convert paths to backslashes for Scenario.txt Definition entries 2018-03-16 13:54:52 +01:00
Kanibal f24d685a47 win32: fix handling of forward slashes 2018-03-15 23:49:00 +01:00
Maikel de Vries 3da209462e moving brick: fix movement graph saving
Did not test all corner cases but this improves the situation for sure.
2018-03-14 17:54:25 +01:00
Maikel de Vries 6efb292fa7 flame: option to make eternal for editor mode 2018-03-14 16:50:57 +01:00
Maikel de Vries f81d41ba84 correctly update active fire effect when NoBurnDecay changes 2018-03-14 16:38:33 +01:00
Maikel de Vries 017960cbc2 do not show compensator burning battery in editor creation list 2018-03-14 16:35:11 +01:00
Maikel de Vries 9ffab151c6 remove duplicate cloud effect object
The particle had the same graphics as the real Cloud object and the script does not seem to have any uses. Also unused for more than 4 years.
2018-03-14 11:49:02 +01:00
Maikel de Vries 3808c22df4 make time object more editor friendly 2018-03-13 22:32:03 +01:00
Maikel de Vries e084947bcd fix meteor graphics 2018-03-13 20:40:33 +01:00
Maikel de Vries d01aaa20bd waterfall: implement editor interface 2018-03-13 20:37:46 +01:00
Maikel de Vries b534bbb5f9 hide some more objects in editor creation list
The burned object may be creatable, but must then be moved such that the libraries parent folder remains invisble in the editor.
2018-03-12 22:30:02 +01:00
Maikel de Vries e7b4ce7bf2 relaunch rule: fix scoreboard updating and scenario overloading 2018-03-11 17:06:02 +01:00
Maikel de Vries 9fc94509c4 remove playground scenario
Sandbox is the new playground.
2018-03-11 17:06:02 +01:00
Maikel de Vries 0e535f880e sandbox: more scenario options and better map generation 2018-03-11 17:06:02 +01:00
David Dormagen 29a1a21526 club respects Rule_NoFriendFire and IsProjectileTarget (#1993)
Not recommended for 8.1, because there are semantic changes: The club can now also hit targets (IsProjectileTarget) while before it could only hit OCF_Alive and C4D_Object. It's similar to the sword now.
Oh, and before it could also not hit livings that were stuck.
2018-03-11 15:04:59 +01:00
Lukas Werling 99ef4ce853 Implement TCP Simultaneous Open for IPv6 2018-03-09 23:20:00 +01:00
Lukas Werling 9a5103d02c Don't link openclonk-server with SDL and audio libraries
Seems to build fine without, which apparently wasn't always the case.
2018-03-09 23:10:11 +01:00
Lukas Werling ee34ac1b06 Add C4NetIOTCP::Bind() for binding without connect 2018-03-07 17:30:58 +01:00
Lukas Werling 82a43b7cd9 Disable broken console input on Windows
C4StdInProc blocks on read() on Windows, stopping everything.
2018-03-07 15:27:51 +01:00
Maikel de Vries 1748797172 treasure hunt: fix wrong dialogue translation of Dagobert to Scrooge 2018-03-05 10:40:14 +01:00
Maikel de Vries 2d0221b8d0 add wooden sign object
Graphics made by Foaly.
2018-03-04 09:43:44 +01:00
Maikel de Vries 478a4e7f85 signpost and stone sign: clean up scripts and lessen code duplication 2018-03-04 09:37:20 +01:00
Maikel de Vries 03d0bb49dc c4script: some fixes for style guidelines and typos 2018-03-03 12:27:34 +01:00
Maikel de Vries e9f87ca028 add stone sign object
Graphics made by Foaly.
2018-03-03 12:22:19 +01:00
Maikel de Vries 65daa55156 fix guide post pictures and interaction icons 2018-03-03 12:19:03 +01:00
Maikel de Vries a2d7374302 prevent floor switch from making object stuck while moving 2018-02-28 10:35:17 +01:00
Maikel de Vries a023b63fda item spawn: prevent pickung up two carry heavy objects 2018-02-26 12:25:00 +01:00
Maikel de Vries f199169c8f item spawn: instantly pick carry heavy items 2018-02-25 21:32:27 +01:00
Nicolas Hake 701adc2eae Enable SSE2 for BLAKE2 library 2018-02-25 12:50:08 +01:00
Maikel de Vries 0c12b02727 keypad: save code hashed, so that they can't be read off in editor mode 2018-02-25 11:31:39 +01:00
Nicolas Hake e3de9f1003 Add BLAKE2 library and expose its a CS hash algorithm to script
The crypto "library" only consists of a single function at the
moment because that's all that users have asked for so far. It is
also highly experimental. We will make an attempt to keep the public
interface (i.e. the interface provided by Library_Crypto.c) stable,
but it might still change if necessary. The internal interface
(provided via the global _Crypto proplist) is not for public
consumption and will probably change at some point.
2018-02-25 10:23:30 +01:00
Nicolas Hake 8e57c0a9f4 Make cross-compiling work with GCC 6+
GCC6 doesn't like getting some of its default include search paths
passed with the -isystem flag, and the devs seem unlikely to change
whatever they did back to before they broke it. Work around CMake
not dealing with it well either by figuring out the paths at
configure time and telling CMake about them so it can avoid adding
them superfluously.
2018-02-25 01:11:53 +01:00
Maikel de Vries 3224e2c5cd fix dialogue image size for use as icon 2018-02-21 17:15:41 +01:00
Maikel de Vries 1f1149861a add star icon 2018-02-21 15:30:48 +01:00
Lukas Werling 4a3c9f2fc2 Add EvaluateOnAbort scenario flag for Tower of Despair
In Tower of Despair, the scenario saves per-room progress in the
player files. Players win individual rooms, but never the whole
scenario. Consequently, they currently have to give up to make sure
they don't lose their progress. This is not intuitive at all. With the
new flag enabled, players will be saved even if the scenario is aborted.
2018-02-18 21:46:56 +01:00
Lukas Werling fa3e8c2a50 Fix editor keyboard input on FreeBSD (hopefully)
Assuming keyboard scancodes on FreeBSD are the same as on Linux.
2018-02-18 01:05:28 +01:00
Lukas Werling c0375bba72 Fix IPv4 address serialization on FreeBSD (hopefully) 2018-02-18 00:42:17 +01:00
Lukas Werling 5b21505efd Editor join: Serialize reference as INI
On FreeBSD, the binary serialization doesn't work for IPv4 addresses,
and we never serialize game references as binary anywhere else.
2018-02-18 00:30:08 +01:00
Lukas Werling 55a81ea76a Launch editor via argv[0] on Unix systems without /proc/self/exe (#1999) 2018-02-17 12:57:43 +01:00
Lukas Werling 9855f9355e Autodetect "/proc/self/exe"-equivalent on FreeBSD (#1999) 2018-02-17 12:41:16 +01:00
Lukas Werling 334c57f296 Disable -Wformat-security in parts of C4AulCompiler (#1992, GH-64) 2018-02-17 12:12:16 +01:00
Kevin Zheng 0c8371f113 Fix networking on FreeBSD (#1998) 2018-02-17 11:59:24 +01:00
Lukas Werling e3017ba4ac Credits: Fix Kevin Zheng's name 2018-02-17 11:56:57 +01:00
Sven Eberhardt 9c32ee0336 Make QT library deployment optional via CMake option DEPLOY_QT_LIBRARIES (default off) 2018-02-15 21:40:25 -08:00
Sven Eberhardt b95dd50564 Simplify DeployQt to work with CMake<3.2 (hopefully). 2018-02-14 21:33:06 -08:00
Mark b0a790c747 Volcano: Fix copy & paste error 2018-02-13 23:28:38 +01:00
Mark c792833d98 Volcano: Additional script possibilities
Added settings for minimal and maximal strength, reset to defaults if passing nil as a parameter, possibility to overload chunk effects on eruption
2018-02-13 23:23:00 +01:00
Mark f62050cf5b Docu: Volcano strength 2018-02-13 23:03:11 +01:00
Sven Eberhardt 8a050c1ff9 Disable Qt library deployment for mac.
Doesn't seem to work on the autobuild server.
2018-02-12 21:51:50 -08:00
Sven Eberhardt 9df7a193e4 Deploy Qt libraries; fix platforms NSIS installer include 2018-02-12 21:44:18 -08:00
Armin Burgmeier ef1e348442 Install platforms/ folder in windows installer 2018-02-12 19:58:03 +01:00
ronnystandtke 26af088548
Update openclonk.desktop
- added a German translation of the GenericName field
- left out the "multiplayer" part, because OpenClonk is also a very fine single player game but this would make the German translation much too long...
2018-02-12 16:08:47 +01:00
Julius Michaelis a130f59f54 Fix mac build likely broken in 13f082e8c8. (Attempt 1) 2018-02-12 11:28:14 +01:00
Misty De Meo b492ae456f osx_bundle_libs: skip system libraries 2018-02-12 02:57:05 +01:00
Maikel de Vries f9e7a983f2 docs: removed obsolote Components entry and add IsEditor function 2018-02-11 10:33:58 +01:00
Maikel de Vries 18dce041e1 floor switch: improve object detection and save switch mass 2018-02-09 11:30:58 +01:00
Lukas Werling 08edf3bb58 Enable -Wformat-security for gcc and fix one warning (GH-64)
Fedora has -Werror=format-security enabled per default, so enabling and
fixing these warnings is a good idea.
2018-02-06 23:31:50 +01:00
Maikel de Vries 3ad91ee02b add stalactites to hot ice as decoration (#1564) 2018-02-05 16:54:02 +01:00
Maikel de Vries 42310548d8 stalactite: fix raindrop, allow placing in sky, fix stalagmite, clean up 2018-02-05 16:53:07 +01:00
Maikel de Vries e94a0b3c36 molten monarch: fix fire particles and fade out gravestones (#1560) 2018-02-05 15:04:46 +01:00
Maikel de Vries 81abbce77a flammable library: burned object copies motion from inflamed object 2018-02-04 21:20:39 +01:00
Lukas Werling cd2b8370da Fix warnings in DirectExec crashing (#1990) 2018-02-04 12:33:58 +01:00
Maikel de Vries 369e2d0b0c sandbox: remove god mode objects on departure
This ensures that their too large graphics do not appear for the player, the only departure is when the clonk dies or is removed.
2018-02-03 09:34:45 +01:00
Maikel de Vries 1113761679 sandbox: use spraycan and overload functionality 2018-02-01 21:38:24 +01:00
Maikel de Vries 3a866caa73 maze: fix warning for declaration of variables and move spray can to Decoration.ocd 2018-02-01 21:23:14 +01:00
Maikel de Vries 22ca0513cc remove strange pixel artefacts from signpost graphics 2018-02-01 20:58:13 +01:00
Maikel de Vries d65dd96851 sandbox: add english translations and clean up scripts 2018-02-01 20:55:24 +01:00
Lukas Werling 8f285299d1 Fix Mortimer missing in Credits 2018-01-31 21:18:27 +01:00
Lukas Werling 1f94d66000 Bump version to 9.0 alpha 2018-01-31 21:08:32 +01:00
Lukas Werling 13f082e8c8 Implement Credits.txt export from StartupAboutDlg
Pressing Ctrl+S while on the Credits screen will save everything to
Credits.txt in the current working directory. This is only meant for
developers modifying the credits; the shortcut isn't mentioned anywhere.
2018-01-31 21:07:09 +01:00
Maikel de Vries 9e01a861ce fix some more structure vertices, also for asymmetric ones when flipped (#1979) 2018-01-31 19:59:41 +01:00
Maikel de Vries 18bb8371d3 ... and remove log used to find the problem 2018-01-30 21:29:45 +01:00
Maikel de Vries 041597971f fix typo in ladder library that adds an infinite amount of effects to the clonk over time 2018-01-30 21:28:30 +01:00
Maikel de Vries 8889a68127 horrid highway: fade out trains if they are taking too long 2018-01-29 10:16:14 +01:00
Lukas Werling 53f29ccb96 Update remaining Version entries from 7 to 8,0
Maikel missed some in aa89217 ("update version to 8.0 in DefCore.txt,
Scenario.txt and Version.txt").
2018-01-28 23:09:06 +01:00
Lukas Werling 44172576af Add NativeException to credits 2018-01-28 21:16:14 +01:00
Arne Schauf 8ad13a4d51
Fix german description typo 2018-01-28 17:54:47 +01:00
Lukas Werling 0f78e63f02 Add warning for broken runtime join (#1109)
This also fixes the "no runtime join" error appearing for pre-lobby
games, where joining usually works anyways.
2018-01-28 17:34:45 +01:00
Lukas Werling 223ab6f77b Add warning about unfinished gamepad controls 2018-01-28 17:18:20 +01:00
Julius Michaelis 56cac7a4e2 Set C4VERSIONEXTRA to rc1 2018-01-28 14:02:38 +01:00
Maikel de Vries aa892171fb update version to 8.0 in DefCore.txt, Scenario.txt and Version.txt 2018-01-28 13:18:46 +01:00
Julius Michaelis f39ce4f25c Make arrows burn (#1983) 2018-01-28 12:51:14 +01:00
Kanibal 4dd97d266e C4LoaderScreen: use const string reference
C4LoaderScreen: compare file extension case-insensitive
2018-01-28 11:07:05 +01:00
Kanibal 384472f183 Modernize loader loading code (#1748) 2018-01-28 11:07:05 +01:00
Julius Michaelis 1a5a60c39e Move warning about #1965 to a better place (see d175f776a) 2018-01-28 01:14:25 +01:00
Julius Michaelis d175f776ad Warning about #1965 so if we release 8.0 without fixing that bug, hopefully nobody will stumble over it. 2018-01-27 22:21:18 +01:00
Maikel de Vries 41cecc6a6f liquid tank: show to which object the pipe is connected in interaction menu 2018-01-25 13:44:57 +01:00
Maikel de Vries 0b42dc8e20 fix implicit_range_loop_var_decl in Ambience object script 2018-01-24 19:50:35 +01:00
Maikel de Vries ea72e2e542 clean up library vendor script
Also set up buy all available on shift + click for testing
2018-01-24 17:44:42 +01:00
Maikel de Vries a13b7c48ab AI: put on wearables if in inventory 2018-01-24 17:41:07 +01:00
Maikel de Vries 73dbc72f34 make friendly fire rule also work for lightning strikes and punches 2018-01-24 11:42:19 +01:00
Maikel de Vries 65c279233e improve enemy finding for defense AI
The path finder seems quite slow if a lot of AI enemies are around and can't find a path...
2018-01-23 11:35:47 +01:00
Maikel de Vries 26fe0d089a fix possible script error in destructible library 2018-01-23 11:34:13 +01:00
Maikel de Vries 29aedb36f2 fix scenario saving of hand items for golden statue 2018-01-22 21:00:13 +01:00
Sven Eberhardt bb7afe5850 Missions/Raid+TreasureHunt: Oil barrels are actually filled with oil and don't empty. 2018-01-21 21:53:01 -08:00
Sven Eberhardt ceab026780 Missions/Raid: Fix Pyrit hat and activity 2018-01-21 21:40:25 -08:00
Sven Eberhardt 88d1136215 Missions/Raids: Add signpost texts 2018-01-21 21:36:44 -08:00
Maikel de Vries d411f07fda carry heavy: add option for scripters to skip pick up animation
This is probably not the cleanest solution but I needed one and could not think of a better option.
2018-01-21 09:44:48 +01:00
Maikel de Vries 2b4e40e589 improve AI for defense rounds (boom attack path finding) 2018-01-21 09:44:48 +01:00
David Dormagen 3acd4a22f2 take 'left' and 'player' (and more) out of global namespace
The values from the enums are converted to numbers a lot, so using an enum class would be counter-productive.
Having 'left' in the global namespace appeared to be an actual problem with some Qt headers, according to Fulgen.
2018-01-20 18:20:51 +01:00
Julius Michaelis 735a29103f Suggestion for #1765/Acid Drilling: Add a statue that requests an acid bath. 2018-01-20 00:09:06 +01:00
David Dormagen fda3eecd84 made structures either flippable or prevent it completely (#1980)
Foundry is now flippable. SteamEngine is not yet flippable due to collection zone (could use similar solution as foundry).
Pump is not yet flippable, because I don't want to test the bazillion combinations of states of the pump now - maybe after a release.
2018-01-19 17:16:10 +01:00
Maikel de Vries e7354ac4b1 defense enemy: add bomber plane
This is a first attempt at an AI flying an airplane and is still very basic.
2018-01-19 14:37:21 +01:00
Maikel de Vries 0bac4579ef fix other script usages of SimFlight 2018-01-19 14:37:21 +01:00
Maikel de Vries 92aba45914 fix diving animation prediction for clonk
And no! randomly multiplying by 2 is not a solution...
2018-01-19 14:37:21 +01:00
Maikel de Vries dc7734e223 FnSimFlight: fix precision of velocity if not provided 2018-01-19 14:37:21 +01:00
Maikel de Vries 0086f236c1 defense goal: improve scoreboard, description and enemies 2018-01-19 14:37:21 +01:00
Maikel de Vries f3626469b2 ensure proper saving of pipe lines to prevent line breaks 2018-01-19 14:37:20 +01:00
Maikel de Vries f815892b19 fix and unify message showing for goals and rules in F menu 2018-01-19 14:37:20 +01:00
Julius Michaelis 9d61cc9bc9 Fix Mac build broken in b11564168, attempt 2 2018-01-19 13:01:26 +01:00
Julius Michaelis 914d3798a4 Addedum to the control fixes in b11564168 (#1693, #1982):
- Allow configuring keyboard keys with modifier keys
 - Allow using Alt as a key in game on linux
   (I'm still puzzled why only Ctrl and Shift where implemented in so many places)
 - Adjust the deserializer and PlayerControls.txt to match the serializer for mouse keys
 - Refactor C4PlayerControl::DoMouseInput a little bit
 - Try to fix the Mac build (attempt 1)
 - Fix a bug in C4KeyCodeEx::CompileFunc where it set an incorrect KeyComboItem::sKeyName
 - Fix(?) StdCompilerConfigRead not doing anything on NoSeparator
2018-01-19 11:23:51 +01:00
Clonkonaut 9eef4e2a9f Make various vertices more symmetrically laid out and more fitting to the shape (#1979). 2018-01-18 02:32:54 +01:00
Lukas Werling ad66ba3145 Krakatoa: Fix spawn position of rejoining players 2018-01-17 00:09:27 +01:00
Lukas Werling 04ee087e7d Krakatoa: Don't reduce flag radius (#1981)
The scenario doesn't have an expansion goal anymore, so I don't see why
we'd want to restrict the radius - especially when that doesn't work
properly.
2018-01-17 00:09:27 +01:00
Mark 4db6300789 Test #1974: Improved test
The test can now actually reproduce the bug before it was fixed, and proves that it does not appear anymore now that it is fixed.
2018-01-15 22:19:05 +01:00
Maikel de Vries 601ca111c9 AI: pass effect to ExecuteJump() to prevent script error 2018-01-15 18:42:31 +01:00
Maikel de Vries 4aa0801762 speed up ladder search by clonks using Find_Property 2018-01-15 17:32:48 +01:00
Julius Michaelis b115641685 Allow using mouse keys and key combinations from the control assignment configuration dialogue (#1693, #1692) 2018-01-15 00:28:13 +01:00
Lukas Werling 417d10ed97 HotIce: Fix EciToh lava with Sky background 2018-01-14 21:27:28 +01:00
Maikel de Vries 42dfc79359 ranged AI: aim at bottom of structures to trigger explosions on basements or solid ground 2018-01-14 15:27:11 +01:00
Maikel de Vries 3c9dc104b3 defense boom attack: fix destruction tracking 2018-01-14 15:26:27 +01:00
Clonkonaut 16adcfff73 Detach any visible objects upon Death (#1974). 2018-01-14 14:48:03 +01:00
Maikel de Vries 07ea7f2791 (#1969): improve situation for structures that want to accept vehicles to be entered 2018-01-14 14:45:48 +01:00
Maikel de Vries 705ab86078 defense: improve goal info and script, king of the hill scenario 2018-01-14 14:42:16 +01:00
Maikel de Vries b5152e1215 do not show trajectory for script players to prevent lag 2018-01-14 14:42:16 +01:00
Mark 7b13b3455c Fix #1969: Prevent pushing vehicles into buildings where they are irretrievable 2018-01-14 14:34:27 +01:00
Mark 88aac09064 Test for #1974
The test cannot reproduce the bug at the moment, so consider it a prototype.
2018-01-14 13:34:27 +01:00
Lukas Werling 5944146f2b Fix more broken entries in Scenario.txt (#1910) 2018-01-13 18:57:32 +01:00
Maikel de Vries d2a8f2503c GILD: replace dynamite box with lantern (#1808) 2018-01-13 18:35:15 +01:00
Maikel de Vries 05268d140b GIDL: do not make stone doors static back 2018-01-13 18:26:20 +01:00
Maikel de Vries 187b887cdf ensure license abidance for liquid tank placeholder image 2018-01-13 18:11:14 +01:00
David Dormagen 825ad64afd AimManager: fixed incorrect use of PauseUse leading to aiming without holding CON_Use (#1691)
PauseUse can be called between ControlUseStart and ControlUseStop/Cancel. In this case ControlUseStop set aim_stop=1 but didn't actually stop reloading (which is somewhat fine). However, this led to PauseUse being called when e.g. tumbling or climbing.
And this again would lead to CON_Use being reissued even though the mouse button was not held down, leading to the Clonk being in aim mode.

The functional change here is that you will not continue reloading after tumbling/climbing when you are not holding down CON_Use anymore, which is consistent with other stuff.
2018-01-13 16:05:46 +01:00
Maikel de Vries c3dfdc5894 fix connecting multiple pipes to the refinery drain 2018-01-13 15:28:41 +01:00
David Dormagen 6b797e300e inventory bar: stack count always falls back to contained object count
Related to #1970 and 5fc07df757
This replaces the very hacky implementation just for the dynamite with a more general solution (and e.g. also works with the grenade launcher).
2018-01-13 15:24:08 +01:00
David Dormagen 12da14d603 structures: made very low damage repairable
When the damage times the total component value was much lower compared to the total HitPoints (e.g. with basements), the damage could sometimes not be repaired.
This is fixed now.
2018-01-13 15:04:15 +01:00
David Dormagen 38d937fa58 GetProperties: fixed returning of duplicated property names & too high repair costs
var a = {B=1}; var b = new a {B=1}; would include "B" twice in the list of properties.
This lead to an actual issue when calculating component value for repairing buildings
2018-01-13 15:02:19 +01:00
Julius Michaelis f286682e3b Revert assert from 0027666c4 2018-01-13 13:54:38 +01:00
Julius Michaelis 0027666c4e Fix for #1813 / #1956 2018-01-13 12:29:27 +01:00
Maikel de Vries 4a3173da36 move liquid tank to Experimental.ocd
This should not appear anywhere in the release (also not editor), unless explicitly included.
2018-01-13 12:14:41 +01:00
Maikel de Vries eb24079b2f pump: add interaction menu entries for air pipes 2018-01-13 12:09:59 +01:00
Maikel de Vries dc541620b5 add new liquid tank structure (graphics needed) 2018-01-13 11:06:35 +01:00
Maikel de Vries 3255b02728 pipes: fix attaching, cutting, swapping, messaging, and interface 2018-01-13 11:06:35 +01:00
Maikel de Vries 84ad52251f liquid library: fixes and typos 2018-01-13 11:06:35 +01:00
Mark 78060d59e2 Fix #1976: Prevent GIDL from moving
The GIDL is now C4D_Living and C4D_StaticBack, preventing it from moving. At first I thought that adding an underground vertex would be sufficient, but that still made the idol move/shake when hit.
2018-01-13 09:50:17 +01:00
Julius Michaelis 24cf662cbd Rust script to iterate over all scenarios with openclonk-server and look for script errors 2018-01-12 23:15:29 +01:00
Lukas Werling 54e5c6de38 Fix Sky definition not working (#1910) 2018-01-11 22:44:33 +01:00
Lukas Werling 09458901bb Improve Acid Drilling map a bit (#1766)
- Some gem material for the teleglove
 - Some mushrooms in the cave
 - Some animals
 - Chests!
2018-01-11 22:24:41 +01:00
Maikel de Vries cb8eb3a4d5 fulfill defense goal if last active player is removed 2018-01-11 20:24:16 +01:00
Sven Eberhardt b15a8234b1 TreasureHunt: Improve game end check and some map simplifications 2018-01-10 21:30:15 -08:00
Sven Eberhardt 5fc07df757 Fix dynamite stick display count within dynamite box in interaction menu. 2018-01-09 18:00:35 -08:00
Sven Eberhardt ebd2eeae4b Don't burn objects inside the Clonk when submerged in Lava 2018-01-09 18:00:35 -08:00
Julius Michaelis 2931886438 Limit the number of times Cloud->Place retries.
Initialization did not terminate in planet/System.ocg/Template.ocg/DefaultWorld.ocs/.
2018-01-08 23:12:52 +01:00
Lukas Werling 6e52963828 Fix tools attached to Clonks after their deaths (#1974) 2018-01-08 19:42:59 +01:00
Lukas Werling e200aa58b3 Add CrushedIceCocktail by K-Pone for Miami Ice 2018-01-08 17:04:29 +01:00
Lukas Werling 9cbf1947ad HotIce: Change default spawn type back to island spawn
The HotIce games in #openclonk pretty much never use balloon spawn.
2018-01-08 17:04:29 +01:00
Lukas Werling c01cae990e HotIce: Add Eci Toh and Miami Ice themes
Thanks to K-Pone and KKenny!
2018-01-08 17:04:29 +01:00
Maikel de Vries 5e69a753ad improve tutorial 08 end sequence checks and dialogue 2018-01-08 11:12:21 +01:00
Lukas Werling 08393d2300 Credits: Batman is Foaly 2018-01-07 19:02:38 +01:00
David Dormagen 1d93216f33 powder keg: drop icon overlay in favor of custom menu overlay (#1972)
The old icon overlay was behind the numbers in the inventory menu anyway. Now the object uses a bar similar to loam. And it also updates its description.
When turning empty, the (new) barrel is also no longer play-colored inside.

The powder barrel could of course just use actual gunpowder and be an extra-slot item (like the bow / dynamite box / etc.).
2018-01-07 18:23:14 +01:00
Lukas Werling 64aabefe2d Credits: Add contributors who didn't commit themselves
Powered by `git log --pretty=oneline v7.0.. | grep -w by` - I hope this
covers everyone!
2018-01-07 18:11:10 +01:00
David Dormagen 0f049800c5 Revert "Object Interation Menu: Request displayed amount from objects" (#1970)
This reverts commit 8698aa25cf.

Tackling #1970. The implementation in the reverted commit was incorrect (i.e. only one out of two "GetStackCount" were replaced with GetInteractionMenuAmount, leading to weird behaviour). If you want to replace it, please do it in a way that no call to IsInfiniteStack will be required. And this hack would probably require so much more bloat code that nothing would be gained (i.e. what happens when you put two infinite arrow stacks in one container?).
The bug report complains about the "display stopping at 999" *in some situations*, which was due to Stackable_Max_Display_Count. It's gone now. And that it was not limited to 999 in all situations (like the code would have suggested) is probably due to the things I described above.

# Conflicts:
#	planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c
#	planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c
2018-01-07 17:42:27 +01:00
Mark 0d38a3fb33 Fix #1973: Gems do not grow on wooden bridges anymore
Gems should not be near material vehicle now. This does still not prevent them from growing on things that the player built with concrete.
2018-01-07 16:14:54 +01:00
Mark 8bf90871e1 Fix error when AI equips a shield and has a ranged weapon
The shield and bow both use fx.aim_weapon, but the ranged weapons AI thinks that a shield works the same way as a bow and tries to fire it - in order to prevent this, the AI now also checks whether the equipped item is a IsRangedWeapon. This _could_ have an impact on the vehicle AI, but the unit test worked fine.
2018-01-07 14:39:07 +01:00
Lukas Werling dd86c05b9f Fix some � U+FFFD REPLACEMENT CHARACTER instead of umlauts 2018-01-07 00:50:43 +01:00
Lukas Werling 4325de2084 Fix MCHalfVehic pixels in saved landscape
While saving the landscape, solid masks are temporarily removed. This
did not work for half solid masks, resulting in permanent solid masks
after restoring the save game.
2018-01-05 22:53:41 +01:00
Lukas Werling 22c84edea7 Save HalfVehicleSolidMask object state
After saving and restoring an object with a half vehicle solid mask, the
solid mask was fully solid.
2018-01-05 22:41:14 +01:00
Lukas Werling 058e9addb4 Skylands: Don't use half solid mask on vertical scaffold wall 2018-01-05 22:11:16 +01:00
Lukas Werling da63092ee1 Skylands: Fix "free wood" appearing in front of Sawmill 2018-01-05 22:11:16 +01:00
Mark 66adf0f72c Fix #1969: Lorry does not eject contents by default
Instead, the lorry asks a container whether it should eject its contents. This is done via the callback LorryEjectionOnEntrance(object lorry) in the object that is being entered.
The old callback NoLorryEjection(object lorry) is obsolete.
2017-12-31 16:14:04 +01:00
Mark ee0917d7e8 Fix #1951: Disabled putting water in airplane and lorry
Removing liquid collection from the lorry is a side effect, but it is not bad. The lorry behavior was weird anyway, because you could for example put lava and wood in it, without the wood burning etc.
2017-12-29 12:59:36 +01:00
Mark 5aea227504 Improved unit test
The unit test does not really pass for now (it never did before, because it is not finished yet and used for testing the different transfer function behavior only)
2017-12-29 12:34:00 +01:00
Mark 67ee58d4d7 Fix unit test: Forgot adding materials for TeleGlove 2017-12-29 12:09:01 +01:00
David Dormagen 9214257424 fixed non-moving, high-velocity coconuts (#1627)
Coconuts were C4D_Object AND C4D_StaticBack. That meant that they would save speed (e.g. by explosions?) and could hit Clonks that passed by them.
2017-12-29 09:55:11 +01:00
Lukas Werling 91ff13b81f Clamp y coordinate when looking up Left/RightColPix, part 2 2017-12-28 23:20:56 +01:00
Lukas Werling 2b3863a12c Show warning when attempting to load an old savegame (#1941) 2017-12-28 21:45:20 +01:00
Lukas Werling df979bb537 Fix restoring single-digit scancodes (#1944)
Most scancodes are two hex digits long, e.g. "$24" (J). However, there
are also a couple keys like Backspace ("$e") and Escape ("$1") with a
single-digit scancode. These previously weren't restored correctly.
2017-12-28 20:50:03 +01:00
Lukas Werling 86926377a5 Show error dialog if OpenGL initialization fails (#1890) 2017-12-28 17:32:59 +01:00
Mark c3122b4890 Fix unit test
The test was not broken, but I added ending conditions to tests 4 and 5
2017-12-27 21:56:56 +01:00
Mark fc6c48078f Fix unit test: Liquid container
Adjusted some return values - it turned out that the test was actually wrong in these cases
2017-12-27 20:32:45 +01:00
David Dormagen ca16ffdd20 LaunchLightning: fixed GetType check
The comparison with C4D_Object was taken from the original PR (github #61). C4D_Object is the category, though.
2017-12-27 16:10:56 +01:00
David Dormagen d108cdd6aa inventory menu: be more lenient when it comes to finding matches between updates (#1964)
The matching had a few issues:
Items with the same symbol were supposed to be stacked, but the "symbol" changed from ID to object at some point. So same-type objects were no longer correctly matched.
Items with different text (e.g. amount) but everything else the same should be stacked. But simple proplist equality is obviously not sufficient to determine whether the contents of the proplist changed.

The order of the items is generally more stable now. I hope this doesn't introduce other issues.
2017-12-27 15:42:38 +01:00
David Dormagen 11ec98a195 removed "RaindropSmall" particle
It was no longer used. It's also just a stretched dot. Consider using an actual stretched dot instead (i.e. round GFX and Stretch = XYZ).
The sprite was also a little unclean.
2017-12-27 14:51:07 +01:00
David Dormagen f10b0854e8 fixed slow-mo rain (#1958)
Yes, someone just had the "slow-mo" switch on. I also replaced the usage of the "RaindropSmall" particle (which was a stretched dot) with an actual stretched dot.
2017-12-27 14:41:38 +01:00
David Dormagen ca0e99e3ce C4FO_Exclude: explictly ignore non-valid objects
This does not change behavior at all, as nil-objects were later ignored in the check. Now the check is not even executed.
This does make it more likely that refactoring will keep the ignoring behaviour in place, though.

Loosely related to PR #61 - has nothing to do with the solution, though.
2017-12-27 14:00:43 +01:00
David Dormagen de2b44c126 LaunchLightning: don't set launcher when called from effect/proplist to prevent syntax error (related to PR #61)
Setting the launcher to a non-object would throw an error later when being passed to Find_Exclude.
2017-12-27 14:00:43 +01:00
Mark 993d8c4565 #1249 Fix barrel fuse effect
Improved the barrel fuse effect in two ways:
1) The fuse is not at the center of the poweder keg anymore, making it more prominent
2) When carried by a clonk the effect is at the keg instead of the clonk center
2017-12-27 13:51:33 +01:00
Lukas Werling ea009cad76 Skylands: Enable half solid masks for scaffolds
We found these scaffolds to be rather infuriating to use, maybe this
will make it a bit better.
2017-12-27 13:17:24 +01:00
Lukas Werling 4b0ab0b8b1 Skylands: Fix script error
OnPlaneFinished deletes the calling object.

ERROR: can't access local variables without this
 by: SetProgress(5) (Missions.ocf/Skylands.ocs/Plane.ocd/Script.c:37)
 by: AddPart() (Missions.ocf/Skylands.ocs/Plane.ocd/Script.c:57)
 by: Timer() (Missions.ocf/Skylands.ocs/Plane.ocd/Script.c:47)
 by: FxIntScheduleCallTimer(0,effect {Function = "Timer", Name = "IntScheduleCall", NoStop = true, Pars = [], Repeats = -10794}) (System.ocg/Schedule.c:95)
2017-12-27 12:59:11 +01:00
Lukas Werling 3583bfcbb6 Prevent script error in buy menu
ERROR: '->': invalid target type nil, expected proplist
 by: Object(9419)->GetBuyValue() (Objects.ocd/Libraries.ocd/Structures.ocd/Vendor.ocd/Script.c:23)
 by: Object(9419)->DoBuy(0,0,0,Object(270),0,true) (Objects.ocd/Libraries.ocd/Structures.ocd/Vendor.ocd/Script.c:77)
 by: Object(9419)->OnBuyMenuSelection(0,0,Object(270)) (Objects.ocd/Libraries.ocd/Structures.ocd/Vendor.ocd/Script.c:269)
 by: Object(60927)->OnMenuEntrySelected({index = 2, slot = 1},10) (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:880)
 by: Object(60940)->DoCall(10,0,Object(60927)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:166)
 by: Object(60940)->OnClick(0,0,6090,10,Object(60940)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:175)
2017-12-27 12:54:50 +01:00
Lukas Werling d43051b180 Prevent script error in ObjectInteractionMenu
ERROR: proplist access: proplist expected, got nil
 by: Object(18501)->OnContentsSelection() (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:887)
 by: Object(18501)->OnMenuEntrySelected({index = 0, slot = 0},2,1) (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:880)
 by: Object(18911)->DoCall(2,0,Object(18501),0,1) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:166)
 by: Object(18911)->OnClick(0,1,948,2,Object(18911)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:175)
2017-12-27 12:50:56 +01:00
Lukas Werling 0c848be4df Prevent script error in ladder
ERROR: '->': invalid target type nil, expected proplist
 by: Object(11586)->IsBlockedLadder(Object(13439)) (Objects.ocd/Libraries.ocd/LadderClimb.ocd/Script.c:123)
 by: Object(11586)->FxIntSearchLadderTimer() (Objects.ocd/Libraries.ocd/LadderClimb.ocd/Script.c:90)
 by: Object(11586)->AddSearchLadderEffect() (Objects.ocd/Libraries.ocd/LadderClimb.ocd/Script.c:67)
 by: Object(11586)->FxIntScheduleCallTimer(Object(11586),effect {Function = Clonk.AddSearchLadderEffect, Name = "IntScheduleCall", Pars = [nil, nil, nil, nil, nil], Repeats = 0}) (System.ocg/Schedule.c:95)
2017-12-27 12:47:08 +01:00
Lukas Werling 0167463c33 Change type of AutoScanSideOpen to int
This makes AutoScanSideOpen=2 actually possible.
2017-12-27 01:34:36 +01:00
Lukas Werling 75bd202ca9 Fix warnings in C4Landscape 2017-12-26 22:03:44 +01:00
Lukas Werling a4f25ecd4c Don't accidentally reattach coconuts (#1858)
I'm not sure how exactly that issue happens, but in the attached video
it looks like C4D_StaticBack was accidentally set again. As the XOR
operation can do that, I'm changing it to always set the C4D_StaticBack
bit to 0.
2017-12-26 20:00:32 +01:00
Lukas Werling 31fee7a46d Pickaxe: Check material in a cone (#1606)
This makes digging away single pixels easier.
2017-12-26 19:37:09 +01:00
Lukas Werling 2d7d7b86ae Clamp y coordinate when looking up Left/RightColPix 2017-12-26 14:31:43 +01:00
Lukas Werling 6fc5c76a2c Rewrite Cloud positioning
The old code did some obviously wrong things like calling functions
expecting relative coordinates with GetX()/GetY(). It also sometimes ran
into an infinite loop in Cloud->Place(). I fixed those issues and
cleaned up the rest to be nicer, hopefully without changing
functionality.
2017-12-26 14:14:17 +01:00
Lukas Werling 486c85ea76 Fix Left/RightColPix lookup 2017-12-26 14:14:17 +01:00
Lukas Werling 2ab1408e41 Fix Boomshire spawn position (#1943) 2017-12-26 14:14:17 +01:00
Lukas Werling c964fa1c84 /screenshot: Add error message when in editor (#1137) 2017-12-23 12:11:28 +01:00
Lukas Werling 7ff92179d5 /screenshot: Default to zoom = 2
Before, it would silently fail. As we already have a default for
Ctrl+F9, we can just use that instead.
2017-12-23 12:05:13 +01:00
Lukas Werling ec77fe8744 Rock Bottom: Always start with a sword (#1556) 2017-12-23 11:46:08 +01:00
Lukas Werling d42e23a503 Change AutoScanSideOpen to check fg as well per default
The previous behaviour of only checking the background broke existing
maps and triggered some (performance?) bug in the mass mover. It is
still available by setting AutoScanSideOpen=2, for symmetry with
Top/BottomOpen.
2017-12-22 23:14:54 +01:00
Lukas Werling 2c4f1a0b6d DeepSeaMining: Fix grammar in goal 2017-12-22 21:59:41 +01:00
Lukas Werling 10dbc470df Fix infinite loop when encountering invalid <tags> 2017-12-22 21:44:22 +01:00
Lukas Werling 9970b24375 Forgot to initialize RightColPix 2017-12-22 21:06:30 +01:00
Lukas Werling 8e2327326b FloodedVeins: Use AutoScanSideOpen
It does exactly what's needed here now!
2017-12-22 20:53:11 +01:00
Lukas Werling 8838d8c6ce AcidGoldMine: Draw acid lake with tunnel background (#1652)
The new AutoScanSideOpen won't close the border otherwise.
Additionally, this makes clear where to pump acid.
2017-12-22 20:50:28 +01:00
Lukas Werling fa8f868ffb Change AutoScanSideOpen to be like Top/BottomOpen=2 (#1652) 2017-12-22 20:40:03 +01:00
marsmoon 1f2e34c42d Docs: add an example for appendto
Close GH-59
2017-12-22 19:31:22 +01:00
Lukas Werling 3f48488fef Add Fulgen's real name to credits 2017-12-22 18:08:25 +01:00
Lukas Werling 585eb7db6d Fix C4LogBuf breaking lines within markup
In a text line containing <c ff0000>markup</c>, C4LogBuf would
occasionally split the line after <c, producing broken markup.
Additonally, markup spanning multiple lines would always stop at the end
of the first line.

With this commit, lines are never broken within tags and any unclosed
tags are repeated on the following line.
2017-12-21 22:57:52 +01:00
Lukas Werling e83ca471c0 Render (updated) credits with C4GUI 2017-12-21 22:57:37 +01:00
Lukas Werling 3b358e0a98 Fix condition in font loading code
This was inherited from CR.
2017-12-21 22:57:37 +01:00
Julius Michaelis 99fe7a1a2c Use Reloc.Open for Origin entries in Scenario.txt (#1966) 2017-12-21 16:39:15 +01:00
Lukas Werling 0ae6383937 Fix German translation of Goal_Expansion (#1967)
Not sure why the US format string worked before, but not the DE one.
2017-12-19 21:15:09 +01:00
Lukas Werling 298feab441 Change netpuncher protocol to be more extensible
- Each packet has a version field.

 - Clients connecting to the netpuncher always send a request packet.
   This allows the netpuncher to react differently depending on the
   client's version.

 - Encode packets as binary instead of ASCII. This allows adding fields
   while maintaining compatibility.
2017-12-14 17:22:38 +01:00
Lukas Werling 3476d76e61 C4NetIOUDP: Fix sending data before ConnOK
With my fix from 9eb2478b2 ("C4NetIOUDP: Fix timeout during non-MC
connection"), C4NetIOUDP would send data packets to the master server
before the ConnOK packet. The server would then discard these data
packets, resulting in a one-second delay until retransmission.
2017-12-14 14:35:07 +01:00
Julius Michaelis e324289f8d Do not pack music on installation (#1671) 2017-12-12 10:18:15 +01:00
Julius Michaelis be10e95698 Prevent SEGV on duplicate material names with different case (#1359) 2017-12-10 15:09:51 +01:00
Julius Michaelis d94dcc8267 Fix iLevel parameter of SoundAt (#1681) 2017-12-05 16:57:14 +01:00
Julius Michaelis 1ca46c80ad Poll for stdin close in C4StdInProc 2017-12-05 04:13:28 +01:00
Maikel de Vries 956108b415 fix scoreboard kills, deaths, etc.
This is better done through the clonk death callback such that all deaths and not just last clonk deaths are registered.
2017-12-03 20:56:51 +01:00
Maikel de Vries 752f086a0c fix dark mine relaunching for deathmatch mode (#1962) 2017-12-03 20:01:09 +01:00
Maikel de Vries 4abac1c6d6 interactions: do not show cycle message for interactions with a single object 2017-12-03 19:17:41 +01:00
Lukas Werling 9eb2478b2c C4NetIOUDP: Fix timeout during non-MC connection
The "normal" connection process is a three-way handshake (Conn->,
<-Conn, ConnOK->). When establishing a multicast connection, this
handshake is repeated via the MC address. However, the code always
expected that second handshake to happen and thus ran into a timeout on
the client in the non-MC case, repeating the handshake a second time. In
the end, it usually still worked as the server supports reconnecting,
but packets may be lost in the process.
2017-12-02 18:52:10 +01:00
Lukas Werling 2d4934e4dd Fix C4NETIO_DEBUG 2017-12-02 18:52:10 +01:00
Maikel de Vries 72093ffa7f fix switch target in horrid highway goal (#1960) 2017-11-30 18:54:46 +01:00
Maikel de Vries 7f0743a7b9 remove vehicle rotation alignment library
This did not do anything and the functionality does not seem to be needed.
2017-11-29 21:49:36 +01:00
Maikel de Vries 477bde5c88 airplane and airship use destructible library 2017-11-28 22:09:52 +01:00
Maikel de Vries 4b4e4a5522 structure library: fix for invincible objects and make health bar symmetric 2017-11-28 19:34:56 +01:00
Maikel de Vries 332016e6cc fix entry callback target for destructible library 2017-11-28 16:21:25 +01:00
Maikel de Vries 723a7767f6 add damage indication in interaction menu for destructible library 2017-11-28 15:20:39 +01:00
Mark 58b8a97734 For testing: Initial digging boost
The shovel initially has a little more speed, making the overhead dig less fiddly
2017-11-27 22:28:55 +01:00
Mark c7bb0785b6 For testing: Dive Jump 2017-11-27 21:57:17 +01:00
Clonkonaut 799bf97304 Forget this in my cable lorries work safe. 2017-11-27 00:46:30 +01:00
Clonkonaut e144bfd91f Clonk walk animations: smoother blending.
This was a very old script todo. I don't really know if I made it better (but I think so).
2017-11-26 14:28:04 +01:00
Mark f9cd3aa77e SwitchTarget: Single callback 2017-11-25 23:31:05 +01:00
Mark 43636c4941 Replace windows line endings 2017-11-25 22:55:53 +01:00
Mark 41d45db9c2 Library: Switch, SwitchTarget
Standardized behavior for switches
2017-11-25 22:16:47 +01:00
Maikel de Vries c50d3b84a2 fix missing construction site material info after loading game (#1740) 2017-11-25 16:52:15 +01:00
Lukas Werling 3d1caffcf6 Convert CRLF line endings to LF
Now all files are LF again.
2017-11-24 14:23:33 +01:00
Mark 06cd643d15 Clonk: Adjust mesh position while diving
This matches the vertex position better
2017-11-23 21:16:12 +01:00
Mark f8f9a38ee3 Clonk: Constants for SetMeshTransformation layers 2017-11-23 20:38:11 +01:00
Maikel de Vries e228d84670 make airship IsProjectileTarget failsafe as well 2017-11-22 17:18:41 +01:00
Maikel de Vries 5c11b703a9 Horrid Highway: add diamonds and remove debug log 2017-11-22 17:18:41 +01:00
Maikel de Vries 5bf83b7d3f IsProjectileTarget: make failsafe if projectile is nil and clean up 2017-11-22 17:18:41 +01:00
Mark 3e5de9eea9 For testing: More fluid hangling motion
Removed the dead stop between hangling strokes/swings. Instead, the
Clonk keeps moving with half speed.
2017-11-21 20:56:35 +01:00
Mark fd7eeecf2c For testing: Hangling with immediate stop
Instead of continuing to swing forward the Clonk stops immediately while
hangling. Additionally the hangle animation keeps on playing with a
short delay before it changes to the hanging animation, so that the
motion looks nice if you move a short distance only.
2017-11-21 20:49:41 +01:00
Clonkonaut 8cb3c6f6b3 New property, set for all buildings: FireproofContainer.
A fireproof container shields all contents from incendiary material (lava mainly). Structures can now be submerged in lava and the contents will not burn up.
2017-11-21 18:16:45 +01:00
Mark 5794e1bfb4 Removed ancient comments from the weapon code 2017-11-21 18:01:25 +01:00
Mark 877d5fc62a For testing: Constant digging speed
As discussed on the forum.
2017-11-20 20:42:59 +01:00
Maikel de Vries 7ba158521f fix invisible dynamite box igniter (#1955) 2017-11-17 11:24:26 +01:00
Maikel de Vries 7184109808 detach dynamite igniter only if fused 2017-11-17 09:58:55 +01:00
Maikel de Vries f6b15a9051 cancel current use action if pilot is removed (#1954) 2017-11-17 09:22:48 +01:00
Maikel de Vries bc3d0bb29d make bats not attack prey in containers 2017-11-16 12:47:39 +01:00
Maikel de Vries 0e6f1599c6 fix airplane control use coordinate forwarding 2017-11-15 20:30:14 +01:00
Maikel de Vries 3a47802702 airplane: add afterburner mode
This reqruired some movement code clean up, replaced old effects with new effects.
2017-11-15 18:49:47 +01:00
Lukas Werling 4278626b9f docs: Highlight the keyword "new" 2017-11-12 22:02:34 +01:00
Lukas Werling be9d3032e2 Add ExecutePXS script function
Before commit 5a652f23e ("Fix missing C4PXSSystem::Clear
implementation"), ChristmasIce would keep all snow PXS between scenario
section changes. That looked pretty neat, so I'm introducing this script
function to allow properly implementing it.
2017-11-12 22:00:52 +01:00
Lukas Werling 5a652f23ef Fix missing C4PXSSystem::Clear implementation
On scenario section change, the old PXS would continue to exist.
2017-11-12 11:57:41 +01:00
Maikel de Vries 101dc5055d add Op parameter to turbulence map script algorithm (#1948) 2017-11-11 10:49:42 +01:00
Maikel de Vries 181cfdfd6b fix flammable library now that (#1950) is fixed 2017-11-11 09:57:22 +01:00
Maikel de Vries 963285eee5 NoBurnDecay is a boolean 2017-11-11 09:49:52 +01:00
Maikel de Vries a9675eafa3 perform callbacks when moving contents when container is removed (#1950) 2017-11-11 09:12:46 +01:00
Maikel de Vries 2429ee6722 fix switching dynamite igniter while switching inventory (#1913) 2017-11-10 17:10:31 +01:00
Maikel de Vries ed41426ef8 fix line endings of some files in planet 2017-11-10 10:21:09 +01:00
Lukas Werling 3cce9f44c7 Fix another preprocessor conditional for MinGW 2017-11-09 09:33:29 +01:00
Lukas Werling 022ca2b364 Fix Nix expression for current nixpkgs unstable 2017-11-09 09:28:11 +01:00
Lukas Werling cfee39bbe5 Fix preprocessor conditional for Windows(/MinGW) 2017-11-08 22:29:38 +01:00
Lukas Werling 739de3f6c8 Fix log file permissions on Linux 2017-11-08 20:21:25 +01:00
Lukas Werling 587f5b5f0e Simplify C4PXSSystem
The old system allocated chunks of PXS on demand. I can't think of a
good reason to do this.

The savegame format changes slightly to not require saving full chunks,
however old savegames will still load fine (invalid PXS within chunks
are moved out during the next Execute() call).
2017-11-08 17:33:35 +01:00
Lukas Werling 607e8873e5 Fix landscape diff application (GH-58)
Savegames with a foreground material diff but no background material
diff would not apply the foreground diff at all. As the background
material rarely changes, this broke runtime joining for most scenarios.
2017-11-08 11:34:58 +01:00
Lukas Werling 1182e5ebd5 Don't truncate the log file while checking flock 2017-11-08 00:23:44 +01:00
Lukas Werling 60692c793d Fix assertion failure when joining with openclonk-server 2017-11-05 22:23:38 +01:00
Lukas Werling c0047bdc53 Fix a desync during runtime join (GH-58)
This is a workaround for a more complex engine-side issue. See #1953
2017-11-05 13:56:21 +01:00
Lukas Werling fb87db1579 Fix umlauts in engine strings 2017-11-05 13:56:21 +01:00
Mark 9cea6ed03c Fix documentation comment. 2017-11-04 11:40:13 +01:00
Mark ac0cf07e31 New assertion: Not empty 2017-11-04 11:31:12 +01:00
Mark 26e72eb489 AStar: Clarify the "todo" error 2017-11-02 17:36:31 +01:00
Mark aaed0b4d54 Fix the typo again 2017-11-02 17:29:43 +01:00
Clonkonaut b1902355f9 Cannon, Catapult, Lorry: use Library_Destructible (cannons and catapults are now destructible!). 2017-11-01 01:27:48 +01:00
Clonkonaut 5193f99d6c Library_Destructible: for destructible objects, mainly vehicles.
Objects will be destroyed after local HitPoints has been reached in damage taken. Objects will explode into little burning bits, just like it is with lorries.
2017-11-01 01:20:41 +01:00
Clonkonaut f6af52711a Catapult texture: removed some dark pixels around the draw wheel which showed because of stretching. 2017-11-01 00:56:14 +01:00
Clonkonaut 6acea8930b Various objects: include library flammable
Increased burn time (140 frames) for: axe, bucket, grapple bow, hammer, pickaxe, shovel, sickle. So useful items will burn a little bit longer.
Coal will burn for 245 frames and then just burst into ashes and not change into a Burned Object.
2017-11-01 00:54:24 +01:00
Clonkonaut cc163b21b0 New engine recognised property: MaterialIncinerate.
Objects will be incinerated by incendiary material (which before was only possible by using ContactIncinerate).
local MaterialIncinerate = true; - object will burn in lava not from other burning objects.
2017-11-01 00:49:26 +01:00
Clonkonaut 41676186a1 Library_Flammable: Logic for flammable objects / items.
When ignited, the object will burn for a fixed time (BurnTime property, default is 70 frames) with no detriment to its function.
After that time, the object will change to a 'Burned Object', no longer useful for anything.
2017-11-01 00:46:38 +01:00
Clonkonaut 5c45d7a08e Fix a script comment that Luchs complained about. 2017-10-29 11:39:07 +01:00
Clonkonaut 3084edcab7 Boomshire: fix arg_count_mismatch warning. 2017-10-29 11:34:53 +01:00
Martin Strohmeier 4d1a000ed8 Fix #1906: Rule_Relaunch is saved properly in Objects.c by using GetRelaunchRule() instead of CreateObject() 2017-10-27 18:51:14 +02:00
Clonkonaut 2c4aba74f0 Teleglove production: needs any one gem (diamond, ruby, amethyst) to produce (as discussed in #1505). 2017-10-27 13:25:34 +02:00
Clonkonaut fceda32505 Loam production: substitute sand for earth (#1148). 2017-10-27 13:22:37 +02:00
Clonkonaut 808e7fa866 Producer: allow construction material substitution for products via script.
All item can now define substitute components like this:
public func GetSubstituteComponent(id component)
{
	if (component == Rock) // Rock is in the regular components
		return Metal; // Rock can be replaced by Metal, amount is the same

	if (component == Wood) // Wood is in the regular components
		return [Cloth, Wipf]; // Wood can be replaced by either Cloth or Wipf, amount is the same
}
2017-10-27 13:19:59 +02:00
Clonkonaut 9d3e61e483 Nugget: more reddish colour, to fit the material (#1588). 2017-10-26 16:36:12 +02:00
Clonkonaut a3b387dc30 Treasure Hunt: fix goal description (Dagobert -> Scrooge) (#1912). 2017-10-26 01:20:03 +02:00
Fulgen301 ab3b6cc682 Treasure Hunt: NPC fixes * Make all NPCs except the AI invincible * Modify Jane's dialogue (before, the player clonk was amused about Tarzan's death ;) * AI clonk have now got names 2017-10-26 01:15:50 +02:00
Clonkonaut ea301d7289 Double elevator: transfer MoveTo calls to master case (#1708). 2017-10-26 01:05:37 +02:00
Clonkonaut df861d2654 Give visual feedback that loam is used (#1889). 2017-10-26 00:44:25 +02:00
Clonkonaut 646585a4c9 Fix links on 'Player Controls' page of documentation (#1686). 2017-10-25 15:38:47 +02:00
Fulgen301 05ad28c4f1 Hideout/PyreGem: Fix possible null pointer error The PyreGem calls thrower->GetOwner() in its Hit() function. However, if the gem hits something before setting a thrower (e.g. when falling), it throws a null pointer error. Note: This only concerns custom scenarios which include this gem. 2017-10-25 15:25:14 +02:00
Clonkonaut 232a7deb5b Deep Sea Mining: added Diving Helmet (#1939). 2017-10-25 15:21:30 +02:00
Clonkonaut 2ca557a09c inherited(...); to inherited(); in Initialize since Initialize doesn't have any parameters. 2017-10-25 15:01:19 +02:00
Clonkonaut cbe536711c Boomshire: making sure the airplane will always be upright when reset. 2017-10-25 15:00:38 +02:00
Lukas Werling afa348ab21 Add comment next to all documented functions in System.ocg
Many functions in System.ocg have proper documentation, but not next to
the code. When changing these functions, it is easy to forget updating
the docs. Nobody likes outdated documentation!
2017-10-21 00:10:42 +02:00
Lukas Werling 6605d390a9 Fix documentation of SplitRGBaValue 2017-10-20 23:36:02 +02:00
Martin Strohmeier a0b131cefd Fix scoreboard not updating relaunches #1947 2017-10-15 23:54:39 +02:00
Lukas Werling b94c3757a6 Fix water sliding on lava (#1946) 2017-10-14 17:46:04 +02:00
Clonkonaut 3c87d0f135 Work save regarding cable cars/lorries.
Started to work on a few station configuration options and combining these with producers for requesting materials (which now kind of works).
2017-10-04 01:19:46 +02:00
Julius Michaelis 3eb6dcbcd3 CMakeLists.txt: stop using add_backward and qt5_use_modules
(the former adds libraries multiple times, the latter is deprecated)
2017-09-23 16:52:33 +02:00
Lukas Werling 1541bf62c1 Fix buffer overrun in RealPath
This usually isn't an issue, but is caught by -fcheck-pointer-bounds.
2017-09-17 18:51:41 +02:00
Lukas Werling e92cff778c backward: remove reference to SIGUNUSED
glibc removed that definition in some recent version.
2017-09-17 18:30:17 +02:00
Mark 77bb9c91a6 Fix yet another typo 2017-09-10 20:07:38 +02:00
Mark 380d6202c7 Fixed typo 2017-09-10 19:34:29 +02:00
Mark 7f5ca45097 PowerSystem: Streamlined behavior of neutral network
The check for several neutral networks is more strict now, however. Did
not report an error in the unit test, so it *should* be OK.
2017-09-10 19:33:56 +02:00
Mark 6149f7de8a PowerSystem: Streamline method behaviour
Linked flag changing now always updates all networks (which is not very
hard on the performance), special treatment for neutral network will be
removed with the next commit.
2017-09-10 19:18:52 +02:00
Mark 0c148530a6 PowerSystem: Network creation as a function 2017-09-10 18:11:05 +02:00
Mark 28b22c6c62 PowerSystem: Use getter and setter internally 2017-09-10 15:43:19 +02:00
Mark cc21da2315 PowerSystem: Move network merging from flag to power library.
This is not totally finished yet, but this far it is mere refactoring
without changing the system itself.
2017-09-10 14:34:18 +02:00
Mark 4fab0cf47e PowerSystem: Make system overloadable
Replaced hardcoded method calls with a wrapper function
2017-09-10 12:54:11 +02:00
Mark 366ba86abc Fix #1940 All coconuts must be eaten! 2017-09-02 21:16:04 +02:00
Mark 4838093aaf Seed: Extract function for planting manually
Makes it possible to plant manually if some object overloads ControlUse
2017-09-02 21:15:38 +02:00
Julius Michaelis c4cd9dda63 Set VIS_Editor in Library_Goal to avoid forgetting it in future goals
Fixes #1932
2017-09-01 15:59:51 +02:00
Julius Michaelis 94394c2e2a Fix some valgrind warnings and a leak in openclonk-server 2017-09-01 15:59:46 +02:00
Mark 2db1ae5de2 ConstructionSite: Fix compiler warning 2017-08-27 21:05:07 +02:00
Mark 3917964bf2 ConstructionSite: Fix possible nil access
Code that works with that function expects an array to be returned.
2017-08-27 12:19:38 +02:00
Mark d1996e45df Structure: Improved SetBasement
The access to editor actions poses a problem sometime when deleting
basements.
2017-08-27 10:40:44 +02:00
Mark 3e26d4258a ConstructionSite: Overloadable function for construction site preview 2017-08-26 13:36:31 +02:00
Julius Michaelis 9c3c6d1079 Windmill: Syntax error fix 2017-08-26 12:16:32 +02:00
Julius Michaelis a630d2b94b Silence "Warning: could not find sound matching '...'" in openclonk-server 2017-08-26 10:56:14 +02:00
Julius Michaelis ef1c275227 Better error messages for non-constant expressions in 'static const' declarations
cf. #1922
2017-08-26 10:39:38 +02:00
Julius Michaelis e4adb0fd76 Fix StdCompilerINIWrite/19c1badfa 2017-08-25 15:10:28 +02:00
Mark 86154ddd40 ConstructionSite: Interface for custom implementation
Status update should be callable as such separately.
2017-08-24 22:24:03 +02:00
Mark d27223f960 ConstructionSite: Interface for custom implementation
Extracted some more functions to make overloading easier.
2017-08-24 21:49:40 +02:00
Mark 7067192c63 ConstructionSite: Interface for custom implementation 2017-08-24 21:08:27 +02:00
Mark 929b31c4a3 ConstructionSite: Cleaned script
I know that moving around functions is hell when merging, but I did it
anyway because the construction site is not being changed that often
anymore.
2017-08-24 20:58:29 +02:00
Mark 0a20608f60 ConstructionSite: Remove unused function
It did not really disallow taking stuff out, so I removed it.
2017-08-24 20:45:55 +02:00
Mark c25c63179f Gold idol: New graphics and script 2017-08-24 20:27:45 +02:00
Julius Michaelis 19c1badfa6 Fix StdCompilerINIWrite/08714a67f 2017-08-24 16:40:05 +02:00
Kanibal e727d35202 Share time information (frameCounter and realtime) with landscape shaders 2017-08-23 23:53:55 +02:00
Kanibal c1143a2e51 Add remaining glUniform-functions 2017-08-23 23:53:55 +02:00
Maikel de Vries fd42ddd823 add script option to block cutting of pipes
This allows scripters to place liquid containers with fixed pipes, so that players do not break scenarios.
2017-08-20 12:58:31 +02:00
Maikel de Vries cb1482d5a4 fix spamming balloons (#1709) 2017-08-19 16:11:04 +02:00
Maikel de Vries 2fa7aabcac prevent buildings from partially burning down (#1880) 2017-08-18 17:59:25 +02:00
David Dormagen 6fa13d8717 C4TimeMilliseconds: fixed comparison & stopped reloading shaders every frame
Imagine lhs being 0 and rhs being more than int32_t can handle. And then imagine subtracting them and casting them to int32_t.
That's what happened e.g. in void C4ShaderCall::Start() when ScriptShader.LastUpdate was 0. This caused the shaders to reload every frame;
at least when in the main menu. This lead to serious lagging (of the cursor) for me.

Note that the subtraction operator in C4TimeMilliseconds.cpp has a similar issue. This might need a fix or at least high awareness by users. Maybe an assert or something.

PS: Who thought that doing the comparison with a subtraction was a good idea? This is not assembler :I
2017-08-15 10:04:54 +02:00
David Dormagen 8d1aa0c0c2 DirectoryIterator: only append DirectorySeparator if necessary 2017-08-15 10:04:46 +02:00
Julius Michaelis 08714a67f8 Mess up StdCompilerINIWrite in an attempt to fix #1921 2017-08-15 05:50:38 +02:00
Fulgen301 56d1c689d8 The Raid: Correct string table entry Clonko3 2017-08-14 14:49:45 +02:00
Fulgen301 f80e9dbd1a Display carry heavy objects on the clonk's back while swimming (#1764) 2017-08-14 14:49:45 +02:00
Mark eb1657c3e3 Wearable: Attachment flags
Wearable items can have attachment flags, such as matching the target
skeleton
2017-08-13 23:41:04 +02:00
Maikel de Vries bbdd38830e show keys to cycle between interaction objects 2017-08-12 22:14:54 +02:00
Armin Burgmeier 02fa5abc66 Fix material/texture selection in landscape shader (#1841) 2017-08-12 17:01:52 +02:00
Lukas Werling e59205c2f3 Don't update MIME cache on install (#1618)
The install target is used both for manual installation and for
packaging. Updating the packager's MIME cache isn't very useful. Show a
message instead which reminds both packagers and regular users to run
the command.
2017-08-12 16:56:14 +02:00
Mark 5eaa5703a0 Golden statue: Getters for editor actions 2017-08-12 10:58:08 +02:00
Mark e4912b9fda Fight for Gidl: Statue uses a custom pose 2017-08-11 21:37:21 +02:00
Mark 22e05d7a8f Gold statue: Decorative items
Can place items in the gold statue hands. In the future, it might be
actual items that get displayed correctly in the hands by themselves
(maybe I have to tinker with the model here, unless we want to have
custom transformation callbacks for every item).
2017-08-11 21:29:52 +02:00
Mark daae41e61d Golden statue: Editor properties for pose 2017-08-11 15:34:36 +02:00
Mark 09eec4b53c MoltenMonarch: Moved materials to weapons
Weapon materials are now defined in the basic objects, so that other
scenarios can use the alternate skins, too.
2017-08-11 14:22:45 +02:00
Mark e0662bc206 Fight for Gidl: Adjust statue position
Made the statue not movable, so there is no need to make it stuck in the
ground.
Other scenarios do not need an adjustment, because they use
CreateObjectAbove(), so the positions will be OK (tested with 3
scenarios).
2017-08-10 22:43:09 +02:00
Mark be9f477a16 Gold statue: New graphics
Added a new mesh with 6 different poses for the gold statue.
2017-08-10 22:27:32 +02:00
Maikel de Vries 07a945ee8e playground: do not show plant library in spawn menu (#1911) 2017-08-05 16:17:28 +02:00
Maikel de Vries bb970f1d8c improve volcano escape atmosphere (#1566) 2017-08-05 10:49:54 +02:00
Mark e73c206bdd Constructor: Modular construction menu
Makes it easier to overload the individual parts
2017-07-28 23:01:19 +02:00
Mark f8e30e3a00 Animations: Parameter for rolling
Certain packs/objects may want to restrict your ability to roll. The
parameter that distinguishes between rolling from a fall and rolling
while running is helpful here.
2017-07-28 22:08:19 +02:00
Mark 349529fa02 ConstructionSite: Cleaned script
Made the script a little more readable in some places
2017-07-27 22:04:49 +02:00
Mark 3fcee70f60 Fix breathing sound 2017-07-27 21:51:07 +02:00
Mark 7f30f4d971 Fix #1930
Contained clonks can interact with their container now. Changed the
order of issued calls around a little, but it should not create unwanted
effects.
2017-07-23 20:37:53 +02:00
Maikel de Vries 81330d5b34 make lightning move to nearby lightning attractors 2017-07-23 10:47:16 +02:00
Fulgen301 d8579607ac Tutorial.ocf: Fix string tables 2017-07-23 10:00:22 +02:00
Fulgen301 69538d4962 Add rain drop effect and modify the stalactite in order to use this effect
Squashed three commits, see https://github.com/openclonk/openclonk/pull/47
2017-07-23 09:55:30 +02:00
Mark 62ff92aa97 Structure: Allow basement override
Structures created basements with ID Basement, now the basement type can
be defined with the callback GetBasementID (default value is Basement)
2017-07-22 23:47:16 +02:00
Mark ee4ac9e825 Structure: Callback for too much damage
Added callback OnNoHitPointsRemaining() that is called if whenever the
structure is about to be removed because it took too much damage. Should
the callback return true, then the damage counts as handled and the
structure will not be removed.
2017-07-22 23:47:15 +02:00
Maikel de Vries efe7dcf251 add Find_Cone to find objects in a cone
The reason for an engine function for this is speed, an implementation in script needs Find_Func and ensures slowness.
2017-07-19 22:04:43 +02:00
Maikel de Vries 0d58380dbf unify two implementations of Angle in the engine
There seems to be no reason to have two different implementation and the one in FnAngle seemed the most sane and complete one.
2017-07-19 22:04:43 +02:00
Nicolas Hake e5b15a494c Drop C4AulParSet defaulted ctor
Having the ctor defaulted confuses MSVC 2015 and makes it not use the
templated ctor below even for calls with a parameter list,
thus skipping required initialization.
2017-07-18 02:24:04 +02:00
Maikel de Vries f5f8b18204 remove unused AttractLightning defcore entry
Not used in either the engine or in script, script implementation of lightning can use a script defined property.
2017-07-15 14:00:19 +02:00
Maikel de Vries 4a093b747e remove unused FireTop defcore entry
This has been obsolete since fire is implemented in C4Script.
2017-07-15 13:40:37 +02:00
Mark 2da7768a8e Remove if-block in Eat()
The check should be made in the object that call Eat()
2017-07-13 21:49:07 +02:00
Mark e20d5e87ae Library: Edible items
All the functionality for food is bundled in one library now
2017-07-13 21:48:36 +02:00
Maikel de Vries 12e8ee6636 fix lightning striking certain objects and loosing strength 2017-07-12 22:37:03 +02:00
Sven Eberhardt 856dfc9aa9 Fix duplicate editor action buttons #1884 2017-07-11 21:25:08 -07:00
Sven Eberhardt 0c50e81413 Scenario list loader: Ignore .ocd and .ocg files when looking recursively for scenarios 2017-07-11 20:45:57 -07:00
Sven Eberhardt 17153c6fbe Show currently loaded item in gray while loading scenario list for scenario selection 2017-07-11 20:45:19 -07:00
Sven Eberhardt aa7c964fab Ignore main exe path for group loading when loading data from planet/ subfolder
This fixes a slowdown in scenario selection when some of the dependency folders (e.g. qt) are searched for scenarios.

Should also fix a bug where music is loaded from the exe path instead of planet/ if present
2017-07-11 20:43:21 -07:00
Sven Eberhardt 8dffeadc56 Fix slowdown during startup scenario list loading #1721
(the one that could be averted by wiggling the mouse)
2017-07-11 18:24:14 -07:00
Maikel de Vries 57c0aacbfa reduce lightning strength if an object is struck
This prevents lightning to be an infinite path of destruction.
2017-07-10 19:14:07 +02:00
Martin Strohmeier 2d0a178b87 HotIce: Fix Syntax error 2017-07-09 19:26:10 +02:00
Maikel de Vries 03b6024aca explode meteor when struck by projectile or lightning 2017-07-09 18:35:15 +02:00
Maikel de Vries cc92a58388 pass lightning object to OnLightningStrike for kill tracing 2017-07-09 18:35:15 +02:00
Maikel de Vries 906ccb6733 fix not playing thunder sound in lightning strikes when requested 2017-07-09 18:35:15 +02:00
David Dormagen c3fbdd538a coral: added comment
The intention of the underscore was not clear at a first glance. To avoid people thinking it's a bug and accidentally renaming it, it's commented now.
2017-07-09 17:56:12 +02:00
Maikel de Vries b1542a3338 horrid highway: resolve meteor spawn problem and adjust difficulty settings 2017-07-08 18:17:16 +02:00
Martin Strohmeier ea4aa3eae2 Hot Ice: Fix Clonks stuck in RelaunchContainer on classic spawn in first round 2017-07-08 15:06:47 +02:00
Clonkonaut c2f1d47f63 Added OnClonkEnteredRelaunch when the clonk enters the relaunch container (in accordance to OnClonkLeftRelaunch), request by the Knüppeln team.
I also use this commit to shamefully hide the bugfix of the bug I previously committed.
2017-07-07 00:52:23 +02:00
Clonkonaut 1144837e7e Make a positive return of the OnPlayerRelaunch game call suppress regular relaunch behavior.
I suspect this was intended all along (compare to line #223) but not implemented by mistake.
2017-07-07 00:27:08 +02:00
Maikel de Vries d34f0a689b add new world: horrid highway 2017-07-06 10:18:27 +02:00
Maikel de Vries d458b0a25a fix script error in relaunch rule when buying new clonk fails 2017-07-06 10:12:30 +02:00
Maikel de Vries f56e10c082 fix pump liquid selection menu entry for german language 2017-07-04 22:44:23 +02:00
Maikel de Vries b2a966150c pump: fix connecting already defined drain and source pipes 2017-07-04 15:19:31 +02:00
Maikel de Vries c20698060c airplane: allow changing direction while pushing, better landing, clean-up 2017-07-04 14:49:22 +02:00
Maikel de Vries 50221615b8 adapt clonkomotive scenario to new locomotive 2017-07-04 09:00:16 +02:00
Maikel de Vries 1775684038 locomotive: make liquid tank for easier use 2017-07-04 08:38:49 +02:00
Maikel de Vries 7d98d29b33 moved locomotive to main object folder
Now it can be used by other scenarios as well.
2017-07-03 16:05:58 +02:00
Martin Strohmeier a7c139bb68 Sandbox: Added object removing tool and feedback for invincibility tweak 2017-06-28 23:48:04 +02:00
Mark b7297c1358 Eat: Use existing function call instead of hardcoded comparison
Should the criteria for walking change then eating will still work
2017-06-28 19:36:39 +02:00
Mark 6208d99b98 Heal: Updated to new effect format, added variable interval
The healing interval defaults to the old fixed value.
2017-06-28 19:36:21 +02:00
David Dormagen 42b6e1f69c extra-slot display now shows object instead of definition (#1924)
Showing the definition means that objects can not modify their display in the extra-slot. E.g. the arrows would always show their "full" state. Now the arrow count is correctly displayed in the extra-slot.
2017-06-28 19:22:05 +02:00
Maikel de Vries 3a2c68dcc9 interaction menu: add callback target for menu entries
This allows to forward menus of one object to its parent properly. A specific usecase is cannons, which are soon to come (hopefully).
2017-06-26 17:28:40 +02:00
Maikel de Vries 0cd307a5f0 interaction menu: remove contents refresh effect if menu ordering has changed
This can happen if an objects updates the menus without any callback function [UpdateInteractionMenus(callbacks)].
2017-06-26 17:26:06 +02:00
Maikel de Vries a53bc7eb61 fix script error when fire arrow's incineration destroys an object 2017-06-26 17:20:22 +02:00
Maikel de Vries f98f12c863 defense boom attack: can be hit by more weapons 2017-06-26 17:19:13 +02:00
Mark 8720409fbf Colors: Breaking change - SplitRGBaValue
Changed the return value from array to proplist. The proplist contains the values R, G, B, Alpha.
2017-06-24 19:39:00 +02:00
Mark 56bf2eb06e Colors: Use constants where possible
Did not use constants for the HSL values, because it did not seem worth to introduce them.
2017-06-24 19:24:21 +02:00
Maikel de Vries ce0bb331f7 add function to set target to defense boom attack 2017-06-24 17:58:17 +02:00
Maikel de Vries 5d5cb709bc add functio to make cargo balloon floating 2017-06-24 17:58:17 +02:00
Mark 04b85e0719 More modular AI
The AI was split up into a basic controller object that contains just the AI control effect and basic logic. The other components should work individually, and the final implementation of the AI can import these components individually.

Fixed AI catapults, so that they now fire even if the clonk has no items in the inventory.

Merged from gitMarky/openclonk, branch ai_backport.
2017-06-24 12:00:22 +02:00
Mark fc4a1660da Debugging: Streamlined functions
Another possible option was a parameter for the log level, but I decided against it, because differently named functions feel better than a string constant as a parameter.. Removed some annoying log outputs that I added before.

 Any suggestions for the function names are welcome, because I am not quite happy with the names yet. The distinction between normal output and warning is maybe not even necessary.
2017-06-23 23:19:42 +02:00
Mark dddf5e223a Fix catapult not shooting
The problem was in AI_TargetFinding, line 18: The clonk that has a vehicle, but not any contents, will never find any attack targets. The vehicle is saved as fx.weapon, so if the clonk has a weapon it asks that weapon first whether it is suitable, and only if not it consults the inventory.
2017-06-23 22:32:17 +02:00
Mark fe9ef89cf4 Debugging: More log output
Will streamline the two different functions later on. The difference is, that one function issues a warning, while the other merely provides information. Logging calls in components have to be called failsafe, because the cannot rely on the actual AI implementation including AI_Debugging.

This helps me understand why the catapult in AI test #7 does not fire. The solution is very interesting: The AI executes the idle strategy as long as it has no contents. After giving contents to the AI it executes the catapult strategy.
2017-06-23 22:20:09 +02:00
Mark d9f7147dd3 Debugging: Use individual setting instead of definition setting
This helps when debugging a certain AI-controlled Clonk's behavior
2017-06-23 22:01:15 +02:00
Mark 6cb154fabd UseControl: Prevent possible call on null object
This usually happens in the following case from ClonkControl.ocd/Script.c:

// Release commands are always forwarded even if contents is 0, in case we
// need to cancel use of an object that left inventory
if (contents || (status == CONS_Up && GetUsedObject()))
{
	if (ControlUse2Script(ctrl, x, y, strength, repeat, status, contents))
		return true;
}

It could also be necessary that, instead of contents, either "this", or GetUsedObject() should be passed. Not sure which one was intended.
2017-06-21 00:06:12 +02:00
Mark 2553f5a388 Object: Variable placement for plants
RootSurface() does not yield good results for all objects, so I think the function should have a parameter for movement range. Re-declarated the variable "i" in the second if-block; I always thought we had scoped variables, it surprises me that the previous version worked.
2017-06-20 21:55:01 +02:00
Maikel de Vries 6b2cbf2ab2 add Place function to chippie 2017-06-20 18:25:27 +02:00
Maikel de Vries 30dd9c1d8f silence argument mismatch warning in rapid refining scenario 2017-06-20 18:24:41 +02:00
Maikel de Vries 968c5b9e68 clarify how to use hammer in tutorial 3 (#1888) 2017-06-17 21:16:38 +02:00
Maikel de Vries 48c17c1e54 clarify tutorial 2 loam message (#1887) 2017-06-17 21:08:45 +02:00
Maikel de Vries 6bfd967f40 add wealth display to tutorial 1 2017-06-17 20:56:03 +02:00
Nicolas Hake 8aea4cc360 Merge pull request GH-48 from Fulgen301/PR
- Remove StringToInteger function

Closes GH-48.
2017-06-14 21:13:21 +02:00
Fulgen301 73b52a15ce Remove StringToInteger function 2017-06-14 21:11:39 +02:00
Lukas Werling f44aaf6ff7 Merge pull request GH-45 2017-06-13 20:03:23 +02:00
Nicolas Hake 9020f3c0ec Merge parts of pull request GH-46 from tusharpm/cmake
- get year from CMake directly
2017-06-12 08:37:28 +02:00
Tushar Maheshwari 8fef67378d get year from CMake directly 2017-06-12 08:36:43 +02:00
Maikel de Vries bfe9449256 lava core: only have solid mask when frozen
This causes less lag.
2017-06-11 14:50:35 +02:00
Mark 16c2fd80d5 Animations: Rolling when hitting the landscape as a separate function
The logic for rolling can now be overloaded. Runtime overload is not intended yet.
2017-06-09 21:43:35 +02:00
Mark a4ad791969 Add help message to editor
Still no idea why it was added to the list twice.
2017-06-08 22:28:18 +02:00
Mark d252e839b5 Remove references to AI
the basic AI should not be referenced in its components, so that they are independent of each other
2017-06-08 21:58:37 +02:00
Mark df0a43a46b Stricter calls
This is completely optional, as the calls do now cause an error and not just log a warning
2017-06-08 21:44:32 +02:00
Mark c64670c7d5 Replace .control references
Same argument as renaming the control effect. Is optional, though
2017-06-08 21:35:04 +02:00
Mark 6440b16387 Minor script formatting 2017-06-08 21:25:11 +02:00
Mark a87eed5de1 Replace FxAI-references
The hardcoded references make renaming the effect later a huge problem.
2017-06-08 21:15:31 +02:00
Mark f204b959e7 Port from AI library project
It seems that the vehicle AI is broken.
2017-06-08 20:54:54 +02:00
Mark 8b149a5433 Preparation: Move files to a different folder 2017-06-08 20:32:36 +02:00
Maikel de Vries 7b4ba0245b fix script error on basement attachment to scaffold (#1917) 2017-06-03 15:41:03 +02:00
Maikel de Vries 2b88e77254 adapt System.ocg headers to style guidelines and small clean ups 2017-06-02 17:15:08 +02:00
Maikel de Vries f3cadedff1 add effects to block damage and fire 2017-06-02 17:15:08 +02:00
Mark b19e083495 Fixed a typo 2017-05-31 21:59:04 +02:00
Nicolas Hake 9d6d873156 Merge GH-43 from Fulgen301/OCMilestoneProject
Torch: Add new mesh
  Torch: Emits light when held, remove DoKneel() animation
2017-05-31 18:13:39 +02:00
Linus Heckemann 5e8ad9c8e6 nix expression: add readline 2017-05-30 09:02:43 +01:00
Linus Heckemann 03cb5f9881 nix expression: move pkgconfig to nativeBuildInputs 2017-05-30 09:02:43 +01:00
Linus Heckemann ef3e59890c Add expression for building with nix package manager 2017-05-30 09:02:43 +01:00
Mark 3f9687c1a0 Assert: New assertion for definition context 2017-05-29 21:56:06 +02:00
Sven Eberhardt 04ec41b54c Hide Wearable and RangedWeapon libraries in object creator 2017-05-27 16:34:33 +09:00
Sven Eberhardt 9c2fa297ca Move LavaChunk from volcano to items/resources
This simplifies editor placement
2017-05-27 16:33:22 +09:00
Sven Eberhardt a2d6b65668 Add Title.txt for group folders in Objects.ocd and Decoration.ocd 2017-05-27 16:31:46 +09:00
Sven Eberhardt a74dcc5450 Editor: Support localized definition group folder names (from Title.txt) 2017-05-27 16:30:59 +09:00
Sven Eberhardt cb86124d78 Ladder: Add editor handles to drag length 2017-05-22 12:15:45 -04:00
Nicolas Hake 233d7edba4 Merge PR GH-44 from tusharpm/clangtidy
Automatic fixes using clang-tidy for header files
2017-05-15 13:48:51 +02:00
Tushar Maheshwari a661eab867 Automatic fixes using clang-tidy for header files
A follow-up on a previous PR GH-41. The discussion in the forum can be
viewed at http://forum.openclonk.org/topic_show.pl?pid=33086.
Run clang-tidy (without auto, pass-by-value and using checks) to fix the
header files not modified in the previous PR.

Summary of the changes:

 - C++11 member initialization.
 - nullptr instead of 0 for pointers.
 - override for functions declared virtual in base class.
 - default trivial special member functions
2017-05-15 13:46:46 +02:00
Nicolas Hake 903be585c8 Merge PR GH-42 from tusharpm/includes
Consolidate the include statements scattered across the code in accordance
with this comment in C4Include.h. The advantages are listed in the same
comment.

Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).

Summarizing the changes:

 - Remove the files included in C4Include.h from all other files.
 - Reorder the include directives in the cpp files
   - C4Include.h
   - main module header
   - other headers (lexicographical order)
 - Remove repeated include statements (easy to spot after sorting)

Tested the local Windows build and Travis builds succeeded for Linux.

Note: this was not all automated, the manual steps may have introduced
some errors in sorting.
2017-05-15 13:26:26 +02:00
Tushar Maheshwari 3a4f49ad90 Revisit #includes
Consolidate the include statements scattered across the code in accordance
with the comment in C4Include.h. The advantages are listed in the same
comment.
Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).
2017-05-15 13:24:59 +02:00
Maikel de Vries 0ed4d484fc prevent kill logs rule from creating the relaunch rule 2017-05-15 12:17:17 +02:00
Maikel de Vries 9e9e664581 only show entering interaction if actually standing at the entrance of an object 2017-05-13 15:04:02 +02:00
Maikel de Vries 496c73a50f add a method to calculate the area to the shape library 2017-05-13 14:59:14 +02:00
Maikel de Vries fd734330d6 first try to enter pushed vehicle when entering objects
There was no possibility to enter vehicles into yet, so this would be my first attempt to solve this, we can evaluate this and improve if needed.
2017-05-12 14:38:36 +02:00
Mark 70a89ce4f8 GUI: More robust calculation 2017-05-11 21:52:20 +02:00
Mark 1362494790 Fixed accidental redeclaration existing constant 2017-05-11 21:19:47 +02:00
Sven Eberhardt 9abf0d156e Add editor drag handle to extend tunnel support decoration 2017-05-10 18:42:56 -04:00
Sven Eberhardt 041e562542 Add HorizontalFix and VerticalFix support for "point" editor property delegate 2017-05-10 18:42:56 -04:00
Lukas Werling 15e5857689 Change alut includes to <AL/alut.h>
Alut's pkg-config definition only adds the top-level include directory
containing the AL directory to the include paths. This works on most
platforms because OpenAL adds that AL directory. However, with nix,
these two directories are distinct and the build fails.
2017-05-10 23:23:09 +02:00
Mark 739ddc2be3 Additional GUI layout
I found it a lot easier to create GUIs with these functions, so I decided to add them. If something can be simplified, please tell me so.
2017-05-10 22:33:38 +02:00
Mark 631c239717 Merge function for proplists 2017-05-10 22:03:57 +02:00
Mark 03dc2cb84f Some common assertions
An attempt in reducing duplicate code :)
2017-05-10 21:52:54 +02:00
Sven Eberhardt 1b4fd9abe3 Editor: Add translation overview table (Tools menu) 2017-05-09 22:43:56 -04:00
Sven Eberhardt 3289068ee0 Move C4PropertyPath class into its own files 2017-05-09 22:43:06 -04:00
Sven Eberhardt 7d535ac6db Fix US name of Goal_RubyHunt 2017-05-07 15:29:42 -04:00
Sven Eberhardt fec7a7c084 Fix localized description display in script goal 2017-05-07 15:28:37 -04:00
Sven Eberhardt 94669cebe4 Merge branch 'master' of ssh://git.openclonk.org/openclonk
Conflicts:
	src/editor/C4ConsoleQtPropListViewer.cpp
2017-05-07 15:16:01 -04:00
Sven Eberhardt bc4425462c Add localization support for string evaluators, gravestone and signpost inscriptions and custom game goal texts 2017-05-07 15:03:11 -04:00
Sven Eberhardt 9eedfe268c Editor: Reduce size of string localization button 2017-05-07 15:02:09 -04:00
Sven Eberhardt 206451eb6b Add prototype in proplist string and JSON serialization 2017-05-07 14:27:19 -04:00
Sven Eberhardt 4fac960cf4 Editor: Add localized string support 2017-05-07 14:26:30 -04:00
Maikel de Vries 77dca569fe Switch: properly process and save editor actions 2017-05-06 18:55:27 +02:00
Fulgen301 2c15422c2e Torch: Add new mesh 2017-05-05 17:53:36 +02:00
Tushar Maheshwari e58a7884e4 Automatic fixes using clang-tidy
See http://forum.openclonk.org/topic_show.pl?tid=3376 for discussion.

Close GH-41
2017-05-03 20:30:45 +02:00
Clonkonaut d750a57410 Hatch: combine with basements even if the construction preview hasn't been properly combined.
The hatch will automatically attach itself onto basements it finds around its center after it has been built. This makes it easier to use since people probably tend to forget combining the construction preview. Especially since basements are very slim. The hatch will reposition itself in order to attach. This means it is not right where the player placed it. The alternative would be to move the basement and I guess that even more unwanted.
2017-05-03 09:42:25 +02:00
Clonkonaut fd55514279 Fixed shape of tunnel supports. 2017-05-02 23:48:50 +02:00
Clonkonaut 861b0bc08e Added a simple static ladder to be used by scenario designers.
This thing is a lot faster than the rope ladder.
2017-05-02 22:57:01 +02:00
Clonkonaut 649c61cd2a New decoration object: tunnel support (graphics by Ringwaul, from a long time ago).
Can be stretched using the Extend() function.
2017-05-02 22:53:49 +02:00
Clonkonaut ad6a986d10 Scripted the Hatch that Ringwaul made ages ago. Can be built on top of basements (or without) to make a vertical opening. 2017-05-02 22:50:32 +02:00
David Dormagen 0d32d924dc InteractionMenu: fix script error when custom entry extra_data contains something different from a proplist
The check was only meant for inventory menus (where extra_data always is a proplist); it was not in the right if-clause below, though.
2017-05-02 19:13:48 +02:00
Maikel de Vries 34f736081c fix relaunch time and unwanted initial relaunch 2017-05-02 14:50:27 +02:00
Maikel de Vries 3e0f18f4f3 reinstate relaunch container functionality
This has been used by external scenarios and there is no reason to put this into the relaunch rule script.
2017-05-01 21:26:01 +02:00
Fulgen301 1d92b47141 Torch: Emits light when held, remove DoKneel() animation 2017-05-01 15:38:35 +02:00
Maikel de Vries cc480be3eb relaunch rule: add option to prevent round start relaunch 2017-05-01 11:46:34 +02:00
Maikel de Vries f3291bb84f clean up and document relaunch rule
Also fix script errors in melting castle.
2017-05-01 11:00:51 +02:00
Maikel de Vries 18057587d6 fix relaunching in CTFs 2017-04-30 18:42:44 +02:00
Maikel de Vries 0fead04978 fix relaunching problems in missions 2017-04-30 16:13:57 +02:00
Nicolas Hake 33a0b41179 Trans_Rotate: disallow rotation around null vector (#1908)
Trans_Rotate will now raise at runtime if the user tries to generate a
rotation matrix around a null vector instead of crashing with #DE.
2017-04-29 14:45:10 +02:00
Maikel de Vries 3b1ebdcdb0 do not move seaweed by tele glove or windbag 2017-04-25 20:12:44 +02:00
Maikel de Vries 6f1470dbbd correctly update barrel graphics when emptied onto existing stack 2017-04-25 14:04:43 +02:00
Maikel de Vries afe4d5a91e fix overcast teleport scroll (#1909) 2017-04-25 11:52:50 +02:00
Maikel de Vries cb68f9b26b fix parkour in combination with new relaunch rule 2017-04-25 10:26:27 +02:00
Maikel de Vries a863845ed4 add missing variable to relaunch rule 2017-04-25 09:45:12 +02:00
Maikel de Vries 7ffbeac9a9 Merge branch 'master' into Rule_Relaunch 2017-04-24 21:46:05 +02:00
Mark 2b56f55da5 DarkCastle: Fix #1907
The name entries should be "Hörx" in German and "Harx" in English
2017-04-24 15:10:06 +02:00
Maikel de Vries 4c8b236ea4 fix relaunch finding no spawn
Use built-in FindLocation which works better and default to landscape center when really no place to spawn could be found.
2017-04-23 18:30:15 +02:00
Fulgen301 750d52e06d Fix Missions.ocf scenarios in order to work with Rule_Relaunch 2017-04-22 21:08:40 +02:00
Fulgen301 7fed3ea1c0 Rule_Relaunch: Fix positioning and inventory transfer; add option to prevent initial "relaunch"
# Conflicts:
#	planet/Objects.ocd/Rules.ocd/Relaunch.ocd/Script.c
2017-04-22 21:08:26 +02:00
Fulgen301 7064d4f6fb Rule_Relaunch: Fix return value in SetFreeCrew and SetInventoryTransfer 2017-04-22 21:06:08 +02:00
Fulgen301 38daafc99b Overcast: Fix script errors 2017-04-22 21:06:07 +02:00
Maikel de Vries 200780fba4 fix definition call to relaunch rule 2017-04-22 20:42:56 +02:00
Maikel de Vries c75ffe3978 improve lavacore solidmask
This allows to stand on it more easily and should lead to less frustration for the player.
2017-04-22 16:11:00 +02:00
Nicolas Hake 95c31df9e9 Fix assertion-enabled build 2017-04-19 10:32:34 +02:00
Nicolas Hake c41bd063bd Stop disabling debugrec code by preprocessor
The optimizer is going to remove dead code anyway, and has the
additional advantage of doing syntax checking, so the code won't
silently break when someone changes something.
2017-04-19 09:47:21 +02:00
Nicolas Hake 81e49fe0f5 Fix several broken conversions from C4Fixed->bool->int (#1904)
This is why non-explicit operator bool is bad.
2017-04-19 09:24:27 +02:00
Nicolas Hake fc1a7a59c8 Use C4Real instead of C4Fixed where representation is irrelevant
While C4Real is just a typedef for C4Fixed, it signifies more clearly
that we don't care about the memory representation at the point of use.
2017-04-19 09:14:39 +02:00
Fulgen301 b77e9a7755 RelaunchContainer: Fix using wrong locals due to 52bf2e65bbe497e7d897988765e031f56ce4a980 2017-04-17 17:18:17 +02:00
Fulgen301 85cfbc4065 DarkMine: Fix relaunch handling 2017-04-17 17:18:10 +02:00
Maikel de Vries 7c444e7f96 add lava core animal (made by Win)
Original by win, overhaul of script and behavior by Maikel.
2017-04-17 16:05:20 +02:00
Fulgen301 6030299201 ThunderousSkies: Fix wrong relaunch position and wrong default relaunches 2017-04-17 15:08:47 +02:00
Nicolas Hake 0df79f5ba3 Rule_Relaunch: use correct casing for translations 2017-04-13 19:06:36 +02:00
Nicolas Hake fee85b8ddb Merge pull request GH#38 from Fulgen301/Rule_Relaunch 2017-04-13 19:05:02 +02:00
Fulgen301 f1efb134aa Remove hungarian notation and fix some errors 2017-04-13 18:58:10 +02:00
Fulgen301 9154ebf79f CaptureTheFlag: Fix script errors 2017-04-13 18:35:50 +02:00
Fulgen301 8042861f0b Rule_Relaunch: Fix several script errors 2017-04-13 18:35:43 +02:00
Fulgen301 bf43302da2 Rule_Restart: Fix handling return values of OnPlayerRestart 2017-04-13 09:54:52 +02:00
Nicolas Hake 23f6c74c4b Merge pull request GH#37 from Fulgen301/Rule_Relaunch 2017-04-12 17:45:51 +02:00
Nicolas Hake bc5df7f35b CMake: Add date of commit to logfile
But only if the build is from a clean index. Otherwise, the logfile will
contain the date of build.
2017-04-12 12:34:36 +02:00
Nicolas Hake 94608179f3 CMake: Regenerate build when Git index changes 2017-04-12 11:56:18 +02:00
Nicolas Hake be2f079e2c Docs: Move ParseInt into Script/Strings category
It's not really Arithmetics.

Also change the parameter description to something that isn't a
copy/paste error.
2017-04-11 14:27:50 +02:00
Nicolas Hake b87f8e3f47 C4Script: Add ParseInt function
ParseInt() will take a string parameter and try to convert it into an
integer. If the conversion fails, it returns nil.
2017-04-11 14:21:25 +02:00
Nicolas Hake 1ee3081de2 Add tests for StdMeshQuaternion 2017-04-10 19:13:04 +02:00
Nicolas Hake 4d33df9dfe Add tests for StdMeshVector 2017-04-10 19:13:04 +02:00
Clonkonaut 06a1ebe255 Fix RemoveReproductionEffect() in Animal Library. 2017-04-10 17:24:20 +02:00
Lukas Werling 5719524241 Move C4AchievementGraphics to its own file
Scenario parameters are useful in a script-only context (such as the one
mape uses). C4AchievementGraphics introduces a dependency on C4Surface
which isn't available in that context.
2017-04-03 11:55:22 +02:00
Julius Michaelis 97bdddba24 Fix strict aliasing violation, make C4Real pass is_pod 2017-04-03 11:14:27 +02:00
Lukas Werling f03a1d618d Use average texture color for BMP palette
Previously, it would just use first pixel of the texture image. With our
current textures, this is a pretty bad approximation. For example,
firestone ends up yellow rather than red.

Additionally, this helps tools like mape/ocmapgen which do not load any
texture graphics but just set the texture's average color.

This also fixes the sky color which was previously overwritten.
2017-04-01 20:20:10 +02:00
Julius Michaelis b0a45e01ac Install c4groups even with HEADLESS_ONLY 2017-04-01 12:14:11 +02:00
Fulgen301 5cc3cf002a Fix Test.ocf/ColorfulLights.ocs 2017-03-30 20:55:08 +02:00
Fulgen301 25f77fd12c Remove Rule_Restart from Parkour.ocf 2017-03-30 20:55:08 +02:00
Fulgen301 22bf8ad1f7 Remove Rule_Restart from Goal_Parkour 2017-03-30 20:55:07 +02:00
Fulgen301 6405e50c80 Remove Rule_Restart from Defense.ocf 2017-03-30 20:55:07 +02:00
Fulgen301 d429e88dd2 Remove Rule_Restart from Arena.ocf (is replaced by Rule_Relaunch) 2017-03-30 20:55:07 +02:00
Fulgen301 00cc450331 Goal_Parkour: Fix searching Rule_Restart 2017-03-30 20:55:07 +02:00
Fulgen301 065655076e Modify Tutorials.ocf in order to work with Rule_Relaunch 2017-03-30 20:55:06 +02:00
Fulgen301 07005618aa Modify IAmRich in order to work with Rule_Relaunch 2017-03-30 20:55:06 +02:00
Fulgen301 69e4826a6f Rule_Relaunch: Modify DefaultRelaunchCount setting 2017-03-30 20:55:06 +02:00
Fulgen301 44ca079bf6 Modify Missions.ocf in order to work with Rule_Relaunch
- Crash
- DarkCastle
- DeepSeaMining
- Raid
- TreasureHunt
2017-03-30 20:55:05 +02:00
Fulgen301 b7108ff836 Modify Blunderbuss in order to work with Rule_Relaunch 2017-03-30 20:55:05 +02:00
Fulgen301 b76cedbe7e Modify Bow in order to work with Rule_Relaunch 2017-03-30 20:55:05 +02:00
Fulgen301 51d61d1b26 Modify GrenadeLauncher in order to work with Rule_Relaunch 2017-03-30 20:55:04 +02:00
Fulgen301 76d8df9676 Modify ThunderousSkies in order to work with Rule_Relaunch 2017-03-30 20:55:04 +02:00
Fulgen301 689e57d624 Modify ScorchedGardens in order to work with Rule_Relaunch 2017-03-30 20:55:04 +02:00
Fulgen301 6e88fe5d2f Modify Ruins in order to work with Rule_Relaunch 2017-03-30 20:55:04 +02:00
Fulgen301 c147781861 Modify RockBottom in order to work with Rule_Relaunch 2017-03-30 20:55:03 +02:00
Fulgen301 969cebd03a Modify Overcast in order to work with Rule_Relaunch 2017-03-30 20:55:03 +02:00
Fulgen301 f5e0aa4036 Modify MoltenMonarch in order to work with Rule_Relaunch 2017-03-30 20:55:03 +02:00
Fulgen301 b88137e97a Modify MeltingCastle in order to work with Rule_Relaunch 2017-03-30 20:55:03 +02:00
Fulgen301 8d69713ff2 Modify Hideout in order to work with Rule_Relaunch 2017-03-30 20:55:02 +02:00
Fulgen301 f14bfa418b Modify FrozenFortress in order to work with Rule_Relaunch 2017-03-30 20:55:02 +02:00
Fulgen301 568d04e7da Move RelaunchContainer 2017-03-30 20:55:02 +02:00
Fulgen301 d4b05c43ff RelaunchContainer: Rename folder 2017-03-30 20:55:02 +02:00
Fulgen301 b9f899a334 Move RelaunchContainer to Objects.ocd\Rules.ocd\Relaunch.ocd\Relaunch.ocd 2017-03-30 20:55:01 +02:00
Fulgen301 c1d998d93e RelaunchContainer: Modify OnPlayerLeftRelaunch() call 2017-03-30 20:55:01 +02:00
Fulgen301 9b04051e65 CaptureTheFlag: Fix wrong relaunch calls 2017-03-30 20:55:01 +02:00
Fulgen301 db6047c22a Remove Rule_Restart 2017-03-30 20:55:00 +02:00
Fulgen301 dcc240e01a Rule_Relaunch: Modify base respawn and add Rule_Restart functionality 2017-03-30 20:55:00 +02:00
Martin Strohmeier e62938b3e4 Add Sandbox to Tutorials.ocf 2017-03-28 16:09:35 +02:00
Sven Eberhardt 52caf696e6 Fix crash on network join in Win32 scheduler 2017-03-27 19:55:56 -04:00
Maikel de Vries 5f30a6b428 make lava/acid bubble visible in editor so that it can created in sequences 2017-03-27 09:44:28 +02:00
Maikel de Vries c64e9b3814 scenario saving: fix position after movement by setting con and rotating 2017-03-27 09:44:28 +02:00
Maikel de Vries 7b676b083c boiling acid/lava: replace helper objects by dummy object
This reduces the amount of unnecassary definitions we have ingame.
2017-03-27 09:44:28 +02:00
Maikel de Vries 78d4fa4042 animal library: allow overloading reproductionconditions 2017-03-27 09:44:28 +02:00
Maikel de Vries a435a6db1a lava and acid bubbles do not explode at animals which resist corrosion 2017-03-27 09:44:28 +02:00
Sven Eberhardt bcecff2811 Fix BOOL->bool conversion 2017-03-26 21:20:39 -04:00
Sven Eberhardt c300c79cc7 Fix Windows saving of keyboard config if custom assignments are deleted (hack) 2017-03-26 21:19:58 -04:00
Sven Eberhardt 66117de82f Fix Windows config writing of custom key overloads 2017-03-26 20:55:27 -04:00
Sven Eberhardt 83af5ad794 Fix a script reload bug
Thawing needs to catch some of the deeper nested proplists because they are modified in the EditorProp initialization Definition()-callbacks.
2017-03-26 13:31:55 -04:00
Fulgen301 731bf926c3 CaptureTheFlag: Use tabs for indentation 2017-03-25 14:34:43 +01:00
Fulgen301 f74ee93b5c DeathMatch: Use tabs for indentation 2017-03-25 14:34:32 +01:00
Fulgen301 294b393f7e RelaunchContainer: Use tabs for indentation 2017-03-25 14:34:23 +01:00
Fulgen301 13303c98af Add Rule_BaseRespawn which sets Rule_Relaunch to base respawn mode in order to prevent breaking scenarios 2017-03-25 14:34:11 +01:00
Fulgen301 a4eacd7937 Modify Rule_Killogs in order to work with Rule_Relaunch 2017-03-25 14:01:13 +01:00
Fulgen301 b0219b4614 Modify Scoreboard_Relaunch in order to work with Rule_Relaunch 2017-03-25 14:01:06 +01:00
Fulgen301 3de5261e8a LastManStanding: Remove relaunch functionality which is handled by Rule_Relaunch 2017-03-25 14:00:59 +01:00
Fulgen301 82f3883486 Modify RelaunchContainer in order to work with Rule_Relaunch 2017-03-25 14:00:05 +01:00
Fulgen301 b31355391b DeathMatch: Enable unlimited relaunches 2017-03-25 13:55:42 +01:00
Fulgen301 3a39ec9f94 CaptureTheFlag: Enable unlimited relaunches 2017-03-25 13:55:34 +01:00
Fulgen301 15cf813c1c Rename Rule_BaseRespawn to Rule_Relaunch and implement relaunch functionality 2017-03-25 13:55:21 +01:00
Nicolas Hake 48513291e7 C4ConsoleQtNewScenarioDlg: Avoid std::string conversion ambiguity 2017-03-24 09:08:47 +01:00
Nicolas Hake 9f7128a60e StdCompiler: Add override specifiers 2017-03-24 08:52:32 +01:00
Nicolas Hake b312ec96b4 StdCompiler: Add CompileFunc for std::string
Somehow, MSVC seems to synthesize a CompileFunc for std::string??
2017-03-23 22:31:40 +01:00
Nicolas Hake c56bc4193e Replace InterlockedFoo by std::atomic
Atomic increments/decrements are part of C++11, so we don't need to use
or implement InterlockedWhatever anymore.
2017-03-23 17:03:16 +01:00
Nicolas Hake 007a05468e C4Scenario: Remove fixed char buffers 2017-03-23 16:35:25 +01:00
Nicolas Hake 78b43e2182 StdCompiler: Add support for std::string 2017-03-23 16:35:25 +01:00
Lukas Werling b9a4345071 Backward: Also print stack trace to OpenClonk.log
People usually send the log file when something is wrong, so it's a good
thing to actually have relevant information about the crash there.
2017-03-21 20:18:00 +01:00
Lukas Werling 19b00b7862 Use backward-cpp on Linux for nicer stack traces 2017-03-21 20:17:55 +01:00
Lukas Werling 22161ae561 Client: Send netpuncher request as soon as possible
Previously, the SReq packet would only be sent after receiving an
ID from the netpuncher. Instead, we can send the request as soon as the
C4NetIOUDP connection setup finishes.
2017-03-21 17:14:33 +01:00
Lukas Werling d4bb760b17 Move OnPuncherConnect to C4Network2
All the other puncher handling functions are there as well.
2017-03-21 17:14:33 +01:00
Julius Michaelis 70ad55ddf1 Add Windmill to farming knowledge in the Worlds folder.
Semantically, that makes sense, but I haven't taken a look at all the maps.
2017-03-19 14:03:11 +01:00
Nicolas Hake 379c5a5746 Tests: Add missing C4Include reference to UnicodeHandlingTest
All of our headers are designed to be included *after* C4Include.h,
which UnicodeHandlingTest.cpp didn't do, resulting in an ill-formed
program on some implementations.
2017-03-19 11:28:51 +01:00
Lukas Werling 9b61ba468d Fix JSON serialization of proplists within arrays 2017-03-18 00:26:58 +01:00
Lukas Werling 8ca3801741 Do the initial client->host connection in stages
With the IPv6 support, hosts now often list around 20 addresses.
However, most of these are local only and thus rarely result in a
successful connection. With the introduction of address sorting in
7d5596220 ("Sort addresses used for initial host connection",
2017-02-26), the connection succeeds with the first few addresses most
of the time.

This commit changes the initial connection process to start with only
the first four addresses. After 100 ms, it proceeds with the next four
addresses and so on. This should reduce the packet volume significantly
as the connection should be established after only one or two steps.

We may want to tweak the parameters if this turns out to make joining
slower in practise. In a "normal" setup, the first four addresses should
be the IPv6 privacy and stable addresses, and the next four addresses
should include the IPv4 addresses from masterserver and netpuncher.
100 ms are long enough to get an answer from the host and short enough
to not bother the player too much.
2017-03-17 23:02:45 +01:00
Nicolas Hake 7f2cce6f79 Fix WITH_AUTOMATIC_UPDATE, non-Windows platforms 2017-03-16 23:18:38 +01:00
Nicolas Hake a151ac12de C4Application: Remove StdStrBuf 2017-03-16 19:13:06 +01:00
Nicolas Hake d6c9a11678 StdRegistry: Remove unused support for separated config values
The config read/write code never uses StdCompiler::Separator. Removing
support for it from StdRegistry makes the code simpler.
2017-03-16 18:51:16 +01:00
Nicolas Hake 22f42123e8 C4AbstractApp: Remove StdStrBuf 2017-03-16 18:51:16 +01:00
Nicolas Hake c5ed6e7dc8 Move strprintf to Standard
strprintf works like asprintf, except it returns a std::string.
2017-03-16 18:51:16 +01:00
Nicolas Hake f9d78b8629 Win32: Add LPCWSTR->std::string conversion helper 2017-03-16 18:51:16 +01:00
Nicolas Hake ca62ee82bf Test invalid_escape_sequence, invalid_hex_escape, arg_count_mismatch 2017-03-16 18:51:16 +01:00
Julius Michaelis 183c6e076f silence 'could not connect to' spam in lobby 2017-03-14 22:49:35 +01:00
Nicolas Hake ed193a0715 Aul: use %u instead of %zu for parameter indexes
MinGW uses an ancient version of the CRT, which doesn't support the z
modifier for integer types in printf. Use %u instead and cast to
unsigned.
2017-03-14 00:45:27 +01:00
Nicolas Hake dc6804c12d Aul: Fix invalid_escape_sequence warning message
The message used a %s where a %c was correct, and therefore tried to
access invalid memory.
2017-03-14 00:28:41 +01:00
David Dormagen a561e15288 object interaction menu: made some comments clearer
They were introduced in c37bc586e9
2017-03-13 14:56:45 +01:00
Maikel de Vries 4211751f2f reset shaders when ambience object is deleted 2017-03-12 14:31:07 +01:00
David Dormagen 599509295d fixed some typos in German string tables 2017-03-12 11:18:35 +01:00
Maikel de Vries a49c283d67 prevent division by zero in catapult AI by setting a minimum power 2017-03-11 22:45:49 +01:00
Sven Eberhardt be66da2c7b Fix editor network join on Windows 2017-03-11 15:10:25 -05:00
Sven Eberhardt 5dfd723708 New scenario dialogue: Redraw definition list after template changed 2017-03-11 14:30:46 -05:00
Nicolas Hake 41f4779d74 StdCompiler: Use terms "Serializer" and "Deserializer"
Instead of "Compiler" and "Decompiler", which make me look up what's
even going on each time I see them, use the standard terms "serializer"
and "deserializer".
2017-03-11 15:05:41 +01:00
Nicolas Hake e3d6486f2a Move GetRelativePath to C4Language
C4Language is the only consumer of GetRelativePath. It cannot handle
arbitrarily sized paths, so discourage new code from using it by moving
it to C4Language.cpp.

Also remove the buffer size parameter which was always defaulted anyway
and use template parameter deduction to always get the correct size.
2017-03-11 13:47:18 +01:00
Nicolas Hake 333cf9c4b6 Merge pull request GH #35 from Fulgen301:pullrequest 2017-03-11 12:31:39 +01:00
Nicolas Hake d9f9d9ba38 C4MapCreator: Remove unused optional parameter
No code called C4MapCreator::Create with the fLayers parameter omitted
or set to false, so we can just remove it.
2017-03-11 11:35:33 +01:00
Nicolas Hake 6386621a4a Mark an unchanged parameter as const
Fixes build on standards-compliant C++ compilers.
2017-03-11 11:35:32 +01:00
Sven Eberhardt a73cc5c948 Add missing DoorUnlock sound 2017-03-11 00:13:50 -05:00
Sven Eberhardt 6937969175 Force pre-select definitions specified in [Definitions] section of editor template c4s (#1898) 2017-03-11 00:13:49 -05:00
Lukas Werling 2c3a770415 Fix crash on invalid Editor.geometry (#1897) 2017-03-10 22:02:32 +01:00
Sven Eberhardt 10ab981b6f Add ambience editor props, user actions and scenario saving 2017-03-09 21:42:39 -05:00
Sven Eberhardt 3b90a0bf10 RoomDoor: Add editor props, user actions and scenario saving 2017-03-07 22:43:27 -05:00
Sven Eberhardt 7ffc1c5ffb Fix scenario saving of spawn action property in enemy spawns 2017-03-07 22:43:26 -05:00
Sven Eberhardt ae93236729 Fix typo in enemy spawn 2017-03-07 22:43:26 -05:00
Maikel de Vries 0d7c8aacca adjust moveto command to make the clonk move while jumping 2017-03-07 20:20:59 +01:00
Maikel de Vries ae31a1fa96 fix SetVelocity script function for zero angle or speed 2017-03-06 18:52:04 +01:00
Mark c37bc586e9 ObjectInteractionMenu: Add parameter for entry callback #1896 2017-03-06 05:33:57 +01:00
Sven Eberhardt 8db32bb53a Fix script error on player start object with multiple clonks and nil entries in start material list 2017-03-05 14:37:35 -05:00
Sven Eberhardt fd09df4de4 Fix non-airship vehicle AI 2017-03-05 14:35:00 -05:00
Sven Eberhardt d537617de4 Define general AI creature selection for vehicles in enemy spawn 2017-03-05 14:32:57 -05:00
Sven Eberhardt 41b2145494 Fix enemy spawns in rectangular region 2017-03-05 13:22:19 -05:00
Sven Eberhardt 48cb0df60f Airship enemy spawn: Add hit point parameter 2017-03-05 13:17:41 -05:00
Sven Eberhardt 6184231cdc Improve default template map 2017-03-05 13:00:00 -05:00
Sven Eberhardt 5330c53e38 Fix cloud scenario saving 2017-03-05 12:30:25 -05:00
Sven Eberhardt 3d3e51489c Add user action on enemy spawn 2017-03-05 11:45:04 -05:00
Sven Eberhardt b0b64de7de Infinite ammo respawn for grenade launcher AI attack mode 2017-03-05 11:27:45 -05:00
Sven Eberhardt 366c2c4b83 Add shield option to enemy spawn clonks 2017-03-05 11:27:45 -05:00
Sven Eberhardt d4b036b541 Add weapon speed setting to enemy spawn 2017-03-05 11:27:44 -05:00
Nicolas Hake eee5a5d663 Win32: Link libmisc against Winsock
Some parts of libmisc call into Winsock, so we should link that instead
of just linking it into the final binaries.
2017-03-05 12:41:52 +01:00
Nicolas Hake c8d37a5346 C4DrawT: Remove unused functions, add override specifiers 2017-03-05 12:41:51 +01:00
Nicolas Hake 9bb3dd8877 Win32: Don't try to locate Windows SDK
MSVC already knows where the Windows SDK is located, so we don't have to
replicate that logic in CMake (then get it wrong and link to an outdated
one).
2017-03-05 12:14:32 +01:00
Sven Eberhardt 1c7ee21903 Add weapon speed setting to ranged weapons 2017-03-04 22:47:17 -05:00
Sven Eberhardt d2e57dd318 Add airship spawn and attack path movement to EnemySpawn 2017-03-04 22:47:16 -05:00
Lukas Werling 3ebedd0c5f Rank private/UL addresses lower than global ones
Also adds some tests. Yay tests!
2017-02-28 22:15:29 +01:00
Lukas Werling d7e71d8362 Double the maximum address count to accomodate IPv6
With the addition of IPv6, some computers with lots of addresses are
reaching the old address limit of 20 addresses. We'll have to see how
this works out in practise. Maybe we'll have to do the connection in
stages to prevent sending out too many packets at once (like only
connecting to the first five addresses initially, then after a timeout
the next five, and so on).
2017-02-27 22:52:24 +01:00
Sven Eberhardt 1ff3b17dad Add catapult to enemy spawn
Also fix some catapult behavior (such as pushing it along waypoints)
2017-02-26 19:42:38 -05:00
Lukas Werling aa5f5cd654 Convert IPv4-mapped IPv6 peer addresses to IPv4
This avoids duplicating these addresses when broadcasting them.
2017-02-26 23:36:32 +01:00
Lukas Werling 7d55962208 Sort addresses used for initial host connection
Computers with multiple (possibly virtual) network adapters can have
tons of link-local fe80::/64 IPv6 addresses. Connections to those hosts
would run into a timeout before getting to public addresses behind the
link-local ones.

By sorting the address list, we can prioritize public IPv6 addresses if
supported by the client, then try IPv4 before working through the swamp
of link-local addresses.
2017-02-26 23:36:32 +01:00
Sven Eberhardt fccea515cd Add alternative weapon skins as attack modes 2017-02-26 14:59:34 -05:00
Sven Eberhardt a6c99e2cad Add alt material selection to editor 2017-02-26 14:59:33 -05:00
David Dormagen 0d01309958 construction goal: added German translation 2017-02-26 20:49:33 +01:00
Sven Eberhardt b477bf31f3 Move Amazon and Ogre alt skins from FightForGidl to Decoration.ocd 2017-02-26 12:18:15 -05:00
Sven Eberhardt 322b2b97de Fix rogue escape character in US string table of enemy spawn 2017-02-26 12:02:45 -05:00
Sven Eberhardt 54c4a5aa11 Add switch to room objects 2017-02-26 11:50:53 -05:00
Sven Eberhardt b795248da2 Add EditorActions for spin wheel 2017-02-26 11:23:55 -05:00
Sven Eberhardt c8aa5fff8f Fix missing return value in C4PropertyDelegateFactory::PasteFromClipboard 2017-02-26 11:00:20 -05:00
Sven Eberhardt fd5eb86e68 More detailed info icons for enemy spawns 2017-02-26 10:58:17 -05:00
Sven Eberhardt 5032e61dea Editor: Add OnUpdate to all delegates and EditorPropertyChanged callbacks to selected root object 2017-02-26 10:53:59 -05:00
Sven Eberhardt c7feea408d Fix enemy removal of enemy spawn if removal modifies the spawned list 2017-02-25 23:25:11 -05:00
Sven Eberhardt 50c52eea8c Fix DefenseBoomAttack getting hit by own shooter if NoFriendlyFire is off 2017-02-25 23:19:06 -05:00
Sven Eberhardt 6f8368da93 Enemy spawn: Add rocket spawns 2017-02-25 20:24:46 -05:00
Sven Eberhardt 6af82f193a Add user action evaluator: Wait for condition 2017-02-25 17:03:47 -05:00
Sven Eberhardt 2d3705a813 EnemySpawn: Add "all enemies killed" user action conditional
Also fix delayed activation due to script player join
2017-02-25 15:21:54 -05:00
Sven Eberhardt 6cfe109db3 Enemy spawn: Add max concurrent enemies setting 2017-02-25 12:39:23 -05:00
Sven Eberhardt 750d9dafb9 Remove positional parameters in aul compiler warning strings
Feel free to revert this commit when windows autobuilds are no longer done using mingw
2017-02-24 21:42:25 -05:00
Maikel de Vries 5c8ed12c3f correctly initialize script player in defense goal 2017-02-22 21:38:02 +01:00
Sven Eberhardt 649d7bed0a Move bomber and club attackers from FightForGidl to default AI as attack modes 2017-02-21 20:09:44 -05:00
Sven Eberhardt f754210a99 Add balloon enemy spawn 2017-02-21 20:09:44 -05:00
Lukas Werling 306557dee8 Remove (now duplicated) HotIce SCENPAR stats 2017-02-21 21:21:40 +01:00
Lukas Werling 47a419f412 Add SCENPAR to statistics if set 2017-02-21 21:19:00 +01:00
Lukas Werling d8e0b33192 Put scenario parameters in SCENPAR proplist 2017-02-21 21:14:43 +01:00
Nicolas Hake 144451783d Get random stuff test to build again
TestHost can't check that SourceScripts is unmodified anymore because
C4ScriptHost contains a std::unique_ptr these days, so we can't copy
derived classes. Next best thing is just creating two instances of
TestHost and comparing those.
2017-02-21 20:39:02 +01:00
Julius Michaelis 5ad6012a3f Silence warning on switch over sdl scancodes 2017-02-21 19:37:20 +01:00
Lukas Werling 61bcdeba46 Remove separate c4value_test
Those test cases are included in the main "tests" binary as well.
2017-02-21 19:25:21 +01:00
Julius Michaelis e7afd75c67 Travis: container based builds are bad 2017-02-21 19:17:43 +01:00
Julius Michaelis d81a7f10e3 Silence a lot of inconsistent-missing-override warnings 2017-02-21 19:03:46 +01:00
Julius Michaelis 5f1ad6a5d7 Travis: fancy stuff
- gtest
 - colors
 - container based builds and GCC PCH (for a faster: "you failed")
2017-02-21 17:13:18 +01:00
Sven Eberhardt 65db84d07e Add attack path to AI and EnemySpawn 2017-02-20 22:25:28 -05:00
Sven Eberhardt 9abb0bc200 Fix drawing of editor shape delegate polylines with settings StartFromObject=true and Relative=false 2017-02-20 22:25:28 -05:00
Sven Eberhardt 1ee26ae0a6 Fix variable shadowing in Clonk::SetScaleRotation 2017-02-20 22:25:27 -05:00
Julius Michaelis 9d6a407214 Re-enable Travis CI 2017-02-21 02:02:32 +01:00
Sven Eberhardt 198d11427d Fix crash on script error outside function [Knueppel-crash] 2017-02-20 18:45:11 -05:00
Sven Eberhardt ca19504c40 Fix AttackMode initialization in derived AIs 2017-02-20 18:06:21 -05:00
Maikel de Vries b58fc5e848 fix defense goal achievements 2017-02-20 21:09:14 +01:00
Sven Eberhardt e3eec21271 Editor: Add arrow drawing option to polyline delegate 2017-02-20 14:05:24 -05:00
Sven Eberhardt 294b679961 Editor: Add StartFromCenter option to polyline delegate 2017-02-20 13:39:46 -05:00
Sven Eberhardt cc0371bdf5 Add PIF_NoScenarioSave option to script players 2017-02-20 13:39:11 -05:00
Sven Eberhardt 99a65008cd Add enemy spawn object
This object can be placed in the editor to spawn enemy AI clonks.
2017-02-19 20:36:41 -05:00
Sven Eberhardt 6579798907 Add editor enum option to force value serialization on foreign values 2017-02-19 20:36:40 -05:00
Sven Eberhardt 69b0fd4f1a Do not call InitializePlayers after script player join if no human players joined 2017-02-19 20:36:40 -05:00
Nicolas Hake 76b9d68126 C4ValueTest: Use custom formatter instead of a custom macro
We can just make GTest use a custom formatter to write a value to the
console instead of using a custom macro to wrap everything in a
std::string.
2017-02-19 18:40:19 +01:00
Nicolas Hake bbf9e1ee50 C4Value tests: Work around MSVC 2015 preprocessor bug
MSVC 2015 doesn't support raw strings that contain the sequence \"
(U+005C REVERSE SOLIDUS, U+0022 QUOTATION MARK) and fails to compile
with error C2017.
2017-02-19 18:38:39 +01:00
Lukas Werling fc418a219e Fix use-after-free in C4ValueTest 2017-02-19 18:29:34 +01:00
Lukas Werling cb29e31643 HotIce: Remove non-network InitializePlayers() workaround
See a7bbda4ca
2017-02-19 15:34:58 +01:00
Nicolas Hake 168824a603 Win32: Use _vsprintf_p instead of v(a)s(n)printf (#1892)
This makes it possible to use positional parameters in format strings on
all platforms.
2017-02-19 12:57:27 +01:00
Maikel de Vries 45676eaa8b defense goal: put a short break after a wave that ends when all opponents are killed 2017-02-19 11:29:18 +01:00
Maikel de Vries 50f6b2266a fix possible script error in no friendly fire rule 2017-02-19 11:28:35 +01:00
Sven Eberhardt a7bbda4ca1 Fix order of InitializePlayer(s) callbacks in non-network games with teams enabled [Luchs] 2017-02-18 18:26:21 -05:00
Lukas Werling 6999dc39e1 HotIce: Collect scenario settings for statistics 2017-02-18 23:13:05 +01:00
Lukas Werling 16591ffe53 HotIce: Fix initial player spawn
InitializePlayer() semantics differ in online and local games. In a
local game, InitializePlayers() is called before InitializePlayer(plr);
in an online game it's the other way around.

This also improves handling of players joining at runtime. Those
previously started at random positions.

Close GH-32
2017-02-18 23:07:34 +01:00
Lukas Werling a4492dd828 Fix double escaping of Statistics JSON
As newlines are already escaped in the JSON, this is safe.
2017-02-18 19:08:15 +01:00
Fulgen301 c856df57ca AirborneMining: Remove remaining english text from StringTblDE.txt 2017-02-18 18:57:47 +01:00
Fulgen301 22cdca1eef KingOfTheHill: Remove remaining english text from DescDE.txt 2017-02-18 18:56:49 +01:00
Fulgen301 1797589ff5 ThunderousSkies: Fix crash because of FuseTime() overriding the local FuseTime 2017-02-18 15:26:46 +01:00
Fulgen301 cebe111429 VolcanoEscape: Remove Rule_Restart 2017-02-18 15:26:28 +01:00
Fulgen301 6fd109eb14 VolcanoEscapeEx: Remove Rule_Restart as it is not useful, change VolcanoTimer - Schedule to an effect 2017-02-18 15:26:15 +01:00
Fulgen301 a35ec2e983 FightForGidl: Fix redeclaration of static constants 2017-02-18 15:26:02 +01:00
Fulgen301 3ab6427e9a Guardians of Windmills: Fix redeclaration of static constants 2017-02-18 15:25:45 +01:00
Fulgen301 00340cc7f3 AirborneMining: Add missing german translation 2017-02-18 15:25:27 +01:00
Fulgen301 cd84feb9e3 KingOfTheHill: Translate DescDE.txt into german 2017-02-18 15:24:55 +01:00
Fulgen301 4cef61673a Boomshire: Fix one variable shadowing a global one 2017-02-18 15:24:34 +01:00
Fulgen301 95d2e4bec1 Tutorial06: Translate string table which was forgotten 2017-02-18 15:24:17 +01:00
Lukas Werling 87ee44964c Send script-defined statistics to the masterserver
After GameOver(), the global function CollectStatistics() is called
which in turn calls CollectStats() on all definitions and the Scenario.
The results are collected into a proplist and sent to the masterserver
as JSON.

The intended purpose is to collect statistics like weapon kill counts
and evaluate them across all online games to improve balancing.
2017-02-17 23:29:16 +01:00
Lukas Werling ee0b1c2599 Implement JSON serialization for C4Value 2017-02-17 23:29:01 +01:00
Lukas Werling a44bd69b2f Fix find_path for GMock on Arch Linux
The path is /usr/src/gmock/gmock-all.cc there.
2017-02-17 20:21:47 +01:00
Nicolas Hake 5006a7409e Aul tests: Increment subtest counter per script execution
GTest usually only increments its part count per EXPECT_* call, which we
don't use in diagnostics tests, so all compilation failures would show
as part number 0.
2017-02-16 19:32:47 +01:00
Nicolas Hake 15f5eefc3f Diagnostics tests: Pull common code into a macro
Instead of declaring an error handler every time we run a subtest, we'll
just use a class member that we clear when we leave the scope of the
subtest.
The macro is a bit ugly but solves the issue with redeclaring the scope
guard.
2017-02-16 19:32:46 +01:00
Nicolas Hake c07e0768d6 Aul tests: Split DiagnosticsTest.Warnings into individual parts
We'll test every diagnostic we want to issue in a separate test case so
they get grouped more nicely.
2017-02-16 19:32:45 +01:00
Nicolas Hake c67d188d91 Aul tests: Check for warning ID instead of message 2017-02-16 19:32:44 +01:00
Nicolas Hake b4127439ac Tests: Move aul diagnostics test to a separate file 2017-02-16 19:32:43 +01:00
Nicolas Hake 78bbbc917b Fallback to sane settings when compiling scripts without ScriptHost
Compilation without an associated ScriptHost happens in a call to eval,
in which case we'll fall back to the default warning settings (because
we don't have a location which we could get settings from).

Fixes #1891.
2017-02-16 19:32:42 +01:00
Lukas Werling 181f7ab471 Prefer public/stable IPv6 source addresses
We don't benefit at all from privacy addresses as we're publishing all
local addresses in any case. By preferring stable addresses, we can
avoid reconnection issues after the preferred address changes.

This API is defined in RFC5014, but apparently only implemented in
Linux.
2017-02-14 21:44:05 +01:00
Sven Eberhardt da4f49d7ca Add AI attack mode (weapon) to editor properties 2017-02-14 01:36:12 -05:00
Maikel de Vries 60f3e206cc fix variable shadowing in some scripts 2017-02-13 19:04:27 +01:00
Nicolas Hake 1594acd3ed Aul: Warn if a function parameter shadows a local variable
Yeah. Aul looks up function parameters before local variables when
trying to resolve an identifier. Usually this doesn't matter, but you'll
notice it if you have a local variable and a parameter with the same
name, because the variable should be initialized to nil yet you get the
value of the parameter.
2017-02-13 17:20:03 +01:00
Nicolas Hake 1595bf56a5 Aul test: Write correct output for BoolLit 2017-02-13 15:24:17 +01:00
Nicolas Hake 2b5d34f420 Aul: Remove unnecessary virtual dtor from Script node
The dtor (which didn't even do anything) broke testing on g++ and clang,
because they correctly delete some ctors if the dtor is declared.
2017-02-13 15:23:51 +01:00
Nicolas Hake 30c5bb5f8d Aul: Allow the user to selectively enable/disable warnings
This commit introduces a new Aul directive "#warning", which can be used
to enable or disable warnings for a particular piece of code.

"#warning enable" enables all warnings.
"#warning disable" disables all warnings.
"#warning enable empty_parameter_in_call" selectively enables one
specific warning while not affecting any other.

All warnings that used to be controlled by Developer.ExtraWarnings
remain disabled by default.
2017-02-13 15:07:50 +01:00
Nicolas Hake 23bf3c4f0a Aul: Don't explicitly prepend "ERROR" to runtime errors
Since the error handler would itself prepend "ERROR", runtime errors
used to be written as "ERROR: ERROR: <whatever>".
2017-02-13 15:07:50 +01:00
Nicolas Hake a026bda561 Aul: Let error handler count warnings and prepend severity
Instead of explicitly writing to the log, let C4AulParse and
C4ScriptHost warnings go to the error handler to do with as it sees fit.
2017-02-13 15:07:50 +01:00
Nicolas Hake 5f520c6326 C4AulCompiler: Don't double-count compile time warnings 2017-02-13 15:07:50 +01:00
Sven Eberhardt 2b888fd136 Enlarge initial client connection dialogue to accommodate long ipv6 addresses 2017-02-12 11:48:55 -05:00
Maikel de Vries 60e0417dd2 defense enemy: refactor code for better overloading 2017-02-10 17:57:33 +01:00
Sven Eberhardt ef5626774d Add another default scenario template 2017-02-05 16:08:30 -05:00
Sven Eberhardt 22306bd266 Editor: Add templates for new scenarios 2017-02-05 16:08:29 -05:00
Sven Eberhardt 2f44b48e7d Fix German string table entry for map size in new scenario dialogue 2017-02-05 16:08:29 -05:00
Nicolas Hake 7284d65685 Remove unintentional semicolon after if()
Also changed some other instances of the if(); pattern to use an empty
block in order to suppress the new warning.
2017-02-05 14:22:09 +01:00
Nicolas Hake a33d98ee71 Aul: Warn on empty controlled statement
Aul will now emit a warning if you type something like
    if (...); return true;
(note the semicolon right after the condition). It will also warn on an
empty 'else' branch. If you actually intended to have a no-op there, use
an empty block '{}'.
2017-02-05 14:17:37 +01:00
Nicolas Hake 9a201441d5 Mat insertion: Fix broken conditional 2017-02-05 13:51:04 +01:00
Nicolas Hake 9bddba53df Improve CStdStream const correctness 2017-02-05 13:26:24 +01:00
Nicolas Hake b0898f4e1a C4Group: Pull most the data members out of the header 2017-02-05 13:26:23 +01:00
Nicolas Hake bcbd368ffd C4Group: Rename "Status" enum to "SourceType" 2017-02-05 13:20:18 +01:00
Nicolas Hake 71f8cb0699 C4Application: Remove unused flag IsInGameTick 2017-02-05 13:20:18 +01:00
David Dormagen 56fa6ca157 fish: fixed silent defect (usage of wrong variable)
This most likely does not change the behaviour, as VisionMaxRange was a higher value than VisionMaxAngle and probably capped during the fuzzyfication.
2017-02-04 15:07:41 +01:00
Maikel de Vries 2be444c297 defense goal: clean up wave control
Merge this into enemy control, which did handle most of the control stuff already.
2017-02-04 15:01:03 +01:00
Lukas Werling 487fcc362d Linux: Read IPv6 addresses from /proc/net/if_inet6
In contrast to getifaddrs(), /proc/net/if_inet6 allows filtering
deprecated privacy addresses. As these addresses generally won't be
useful for new connections, there's no reason to include them and they
only cause unnecessary connection attempts.
2017-02-02 22:23:12 +01:00
Maikel de Vries 27fa2410f4 defense: only provide infinite grenade launcher ammo if homebase is active 2017-02-02 21:47:57 +01:00
Maikel de Vries caca643c83 ai: add bomber and improve defense ai 2017-02-02 21:47:57 +01:00
Maikel de Vries 2807f36319 indicate which items are explosive 2017-02-02 21:47:57 +01:00
Maikel de Vries 0dbfa2dd91 ai: airship gets new pilot if old one is lost 2017-02-02 21:47:57 +01:00
Maikel de Vries 7b26e1fa13 ai: put a message when an intruder is spotted 2017-02-02 21:47:57 +01:00
Maikel de Vries ac38e1d23a ai: unify settings 2017-02-02 21:47:56 +01:00
Maikel de Vries b3ace26ae3 put ai movement into a separate script 2017-02-02 21:47:56 +01:00
Maikel de Vries b43ce3080a ai: prohibit movement if ai has command and climb down ladders correctly 2017-02-02 21:47:56 +01:00
Maikel de Vries a61743a4d5 improve movement of defense boom attack 2017-02-02 21:47:56 +01:00
Maikel de Vries c02a76119a ai: fix script runtime errors in target finding 2017-02-02 21:47:56 +01:00
Maikel de Vries d221289886 defense goal: fix awarding bonus after game has finished 2017-02-02 21:47:56 +01:00
Maikel de Vries 957d74bbae update king of the hill to new ai and small improvements 2017-02-02 21:47:56 +01:00
Maikel de Vries 21f82e6c41 update defense enemies to new ai 2017-02-02 21:47:56 +01:00
Maikel de Vries 7d3062277a ai: attack messages, logging and better target finding 2017-02-02 21:47:56 +01:00
Maikel de Vries 8159d73be6 ai: implement airship 2017-02-02 21:47:56 +01:00
Maikel de Vries 4d6be35c32 allow script players to join in network rounds (#1885) 2017-02-02 21:47:56 +01:00
Maikel de Vries c5078b269e windmill: remove obsolete HitCheck.c
Done by friendly fire rule.
2017-02-02 21:47:56 +01:00
Maikel de Vries da6ce3d5d6 ranged ai: use upper ballistic angle if lower is blocked 2017-02-02 21:47:56 +01:00
Maikel de Vries 706f4455d4 ai: add protection using the club 2017-02-02 21:47:55 +01:00
Maikel de Vries 4f420766b7 ai: implement healing 2017-02-02 21:47:55 +01:00
Maikel de Vries ef69ee9d5f move ai protection and target finding into separate definitions 2017-02-02 21:47:55 +01:00
Maikel de Vries a6fd976a77 ai: fix saving & editor props, make public calls safe 2017-02-02 21:47:55 +01:00
Maikel de Vries 8d56434fc5 fix possible script runtime error in aim manager library 2017-02-02 21:47:55 +01:00
Maikel de Vries a89af833c7 ai: fix ai getting and implement axe + club 2017-02-02 21:47:55 +01:00
Maikel de Vries ff51f07eeb fix double static declaration warnings in defense scenarios 2017-02-02 21:47:55 +01:00
Maikel de Vries 8ad872930b rework AI: new effects, use effect target
This is a big change but does make it possible to separate the different scripts into different definitions.
2017-02-02 21:47:55 +01:00
Maikel de Vries 2aa1b961ea AI: don't increase normal throw speed for javelin
Javelin uses ranged mechanism for using/throwing.
2017-02-02 21:47:55 +01:00
Maikel de Vries 3282806d7d move AI ranged and melee control to separate files 2017-02-02 21:47:55 +01:00
Maikel de Vries 7fb300896a fix AI SetGuardRange 2017-02-02 21:47:55 +01:00
Maikel de Vries 3fb539522d clean up AI script 2017-02-02 21:47:55 +01:00
Julius Michaelis 80c07d34e4 Add [Landscape] Secret to Scenario.txt to default-disable black NO_OWNER viewports
Related to: c569036d1d
2017-01-24 18:50:30 +01:00
Maikel de Vries 8208a19c8f delete interaction menu effect when menu is closed
This prevents a lot of effects without command target from floating around.
2017-01-22 10:49:58 +01:00
Sven Eberhardt b51dbc3717 Fix duplicate static definitions in Hot Ice 2017-01-21 21:31:57 -05:00
Sven Eberhardt 3f06882a4c Krakatoa: Add German translation of intro messages 2017-01-21 21:27:45 -05:00
Lukas Werling 459adbd199 Fix local network discovery on Windows (#1886)
On Windows, we cannot resolve addresses using getaddrinfo() before
initializing Winsock. By storing the address as string, the address
parsed later on.
2017-01-21 16:03:03 +01:00
Lukas Werling ef4f1d9231 Merge branch 'ipv6' 2017-01-18 21:59:16 +01:00
Lukas Werling e3a0f2f8b5 Implement Happy Eyeballs for C4Network2HTTPClient
This should make masterserver requests more reliable for users with a
bad IPv6 connection.

See RFC6555
2017-01-18 21:55:17 +01:00
Lukas Werling 894edfce5b Allow adding connections from other addresses
Forcing a static address does not work for IPv6 where everyone has
multiple addresses that change over time. For example, adding a new
connection would fail if the preferred privacy address changes during
a game.
2017-01-18 21:55:17 +01:00
Lukas Werling 6677295bac Serialize addresses in UDP connection packages
The previous approach of just embedding the raw struct fails miserably
when trying to transfer AF_INET6 across platforms.
2017-01-18 21:55:17 +01:00
Lukas Werling 6af32a7c46 Fix IPv6 sockets on Windows not being dual-stack
On Linux, all IPv6 sockets are dual-stack per default; on Windows, they
are not. It's still a good idea to set the option on Linux as well as
the default value can be changed.

When connecting via TCP, C4NetIO still creates IPv4 sockets, so no dual
stack option is required there.
2017-01-18 21:54:50 +01:00
Lukas Werling a9ee16a287 Change C4NetIOUDP broadcast to IPv6
It's not actually used anywhere, but it's not broken now!

This also moves the low-level and OS-specific GetLocalAddresses code to
C4NetIO where it's fitting better than in C4Network2Client.
2017-01-18 21:54:50 +01:00
Lukas Werling 890deb997d Improve "unexpected address family" asserts 2017-01-18 21:54:50 +01:00
Lukas Werling efe0b134ef Use UDP address from puncher to derive TCP address
This is necessary for dual stack connections where the masterserver will
only an IPv6 address and the netpuncher will only return a UDP address/port.
2017-01-18 21:54:50 +01:00
Lukas Werling 602d62cf52 Implement netpunching for IPv6 2017-01-18 21:54:50 +01:00
Lukas Werling b3ef196935 Remove ResolveAddress()
As setting a default port is a common operation, add a helper function
for this.
2017-01-18 21:54:50 +01:00
Lukas Werling 85f5b3cb75 Fix local network discovery 2017-01-18 21:54:49 +01:00
Lukas Werling 97be97c94c netpuncher: Add runtime error handling
Previously, the netpuncher would just exit silently when encountering an
error.
2017-01-18 21:54:49 +01:00
Lukas Werling 5a09c1d4a5 Convert addresses from puncher to IPv4
Addresses from the puncher would show as [::ffff:1.2.3.4] and be a bit
confusing.
2017-01-18 21:54:49 +01:00
Lukas Werling 68d18bf872 Remove obsolete CompileFunc for in_addr 2017-01-18 21:54:49 +01:00
Lukas Werling ef9be2e24e Change (discovery) multicast to IPv6
We use ff02::1 as discovery multicast address.

This "all nodes" multicast address is good enough for discovery in the
local network as packets there are likely broadcasted over ethernet
anyways.
2017-01-18 21:54:35 +01:00
Lukas Werling 793207ce28 Fix connections to link-local IPv6 addresses
Link-local IPv6 addresses are valid on all interfaces and thus need an
interface specifier / scope id, e.g. fe80::1%eth0.
2017-01-18 21:54:02 +01:00
Maikel de Vries 8cc30baf02 add option to gravestone rule to fade them out 2017-01-18 18:21:12 +01:00
Maikel de Vries 5b796dd6d0 improve boom attack movement 2017-01-17 21:14:27 +01:00
Maikel de Vries 075f751a89 defense goal: scoring and achievements 2017-01-17 18:08:34 +01:00
Sven Eberhardt 771a82d879 Fix direct PXS insertion when multiple PXS are at the same location
When many PXS were at the same location (e.g. because of fast/multiple pumps pumping into a basin), only one PXS per frame could be inserted because insertion of one PXS would postpone insertion of additional PXS in the same frame until they finished their slide movement.

This caused some scenarios like Rapid Refining to become very frustrating, because adding extra pumps didn't actually do anything (unless you tricked the insertion by putting the output into the basin).

Now insert them directly if slide movement led to an insertion position.
2017-01-16 20:32:20 -05:00
Maikel de Vries 9466dd4b9b move script player control to defense goal 2017-01-16 18:57:00 +01:00
Maikel de Vries c632a6ed15 improve king of the hill scenario 2017-01-16 18:57:00 +01:00
Maikel de Vries 43d6abc802 order defense scenarios 2017-01-16 18:57:00 +01:00
Maikel de Vries ba731123a2 allow for script players to enter full teams
This should not break anything because script players are created by scripts and one may expect sane behaviour. This is useful to block entry for normal players into a team.
2017-01-16 18:57:00 +01:00
Sven Eberhardt 218961f6a8 Add DuroLava liquid object #1879
The extra object is called "Magma" to distinguish it from Lava and has a slightly different color on the symbol. In the pump menu, only "Lava" is shown and magma is turned on/off with it automatically.

It would be nice to have only one object and control a flag somehow. However, this is bound to cause us headaches later on (combining materials, etc.). This solution is probably least error-prone.
2017-01-16 12:54:34 -05:00
Martin Strohmeier 1586ff9635 Remove difficulty from I am rich Scenario.txt 2017-01-15 17:57:18 +01:00
Maikel de Vries 3f9d06aaa7 add new defense scenario (king of the hill)
This is still experimental and needs some fine-tuning.
2017-01-15 15:38:33 +01:00
Maikel de Vries 3b1dd87b8b improvements to defense goal 2017-01-15 15:38:33 +01:00
Maikel de Vries 008e037864 fix script error in basement 2017-01-15 15:38:33 +01:00
Maikel de Vries 73de90ea8f make friendly fire rule work for projectiles 2017-01-15 15:38:33 +01:00
Maikel de Vries 1f5f34b559 improve friendly fire rule to allow inclusion of objects 2017-01-15 15:38:33 +01:00
Maikel de Vries d1c0750095 show wealth in tutorial 1 2017-01-15 15:38:33 +01:00
Maikel de Vries 85ce25fb0f add editor button to place basement under a structure 2017-01-15 15:38:33 +01:00
Maikel de Vries f9e3639d91 silence some warnings in the defense scenarios 2017-01-15 15:38:33 +01:00
Maikel de Vries e00f1e9672 fix aiming of defense boom attack 2017-01-15 15:38:32 +01:00
Maikel de Vries 6dc9850ebd fix possible script error in boom attack 2017-01-15 15:38:32 +01:00
Maikel de Vries accc1b82dd gidl: use defense boom attack object 2017-01-15 15:38:32 +01:00
Maikel de Vries ef27c1d760 windmill: use defense boom attack object 2017-01-15 15:38:32 +01:00
Maikel de Vries 18a313c962 add defense ai control object 2017-01-15 15:38:32 +01:00
Maikel de Vries eec8127e8a add defense boom attack object
This is the standard wave attack weapon and is part of the goal in some sense.
2017-01-15 15:38:32 +01:00
Maikel de Vries a03c67a7a2 add defense wave control object 2017-01-15 15:38:32 +01:00
Maikel de Vries 7a8032e96d add defense enemy control object 2017-01-15 15:38:32 +01:00
Maikel de Vries 1063610369 add defense goal
This is the goal in defense scenarios and controls the waves. In the future a league interface can also be build. The goal is to adapt the existing defense scenarios to this format (mostly internal changes and infinite waves). Also this should allow for easier creation of defense scenarios.
2017-01-15 15:38:32 +01:00
Maikel de Vries 5e6cf4e7b8 show goal name in goal menu 2017-01-15 15:38:32 +01:00
Mark 6b0d0e1c60 IronPeak: Fix function access during intro 2017-01-13 05:50:06 +01:00
Mark 38648dedcc UseControl: #1873 Prevent use while a menu is opened.
Using objects was blocked by the GUI menus and the ObjectControl() function anyway, but (!) it was not blocked for the old style menus that can still be used.
2017-01-13 00:05:35 +01:00
Mark 92e53fe09f UseControl: Merge the two if-blocks that share the same condition 2017-01-12 23:58:38 +01:00
Lukas Werling 5d803d3be3 Improve "could not find connection" error message 2017-01-09 20:35:04 +01:00
Lukas Werling 1925f47440 Fix C4NETIO_DEBUG option 2017-01-09 20:35:04 +01:00
Lukas Werling 6c7d8b7bbb Clarify discovery error message 2017-01-09 20:35:04 +01:00
Lukas Werling 592ef85672 Fix local IPv6 address discovery 2017-01-09 20:35:04 +01:00
Nicolas Hake 102047f537 Implement IPv6 support to C4NetIO 2017-01-09 20:34:43 +01:00
Martin Strohmeier 0fd9d1f40b Updated descriptions for scenario: I am rich 2017-01-07 18:40:28 +01:00
Martin Strohmeier daf23b9b32 New scenario: I am rich 2017-01-07 18:19:52 +01:00
Maikel de Vries e6819bf020 use no friendly fire rule in defense scenarios 2017-01-07 17:13:46 +01:00
Maikel de Vries 918e5ded0d add rule to prevent friendly fire 2017-01-07 15:39:34 +01:00
Nicolas Hake c73fed8aa6 C4Group: Make more stuff private
C4Update needs to access some internal data of C4Group and uses a
special derived class (C4GroupEx). Make everything it doesn't want to
tamper with private so it's more obvious what is and isn't accessed from
outside the class.
2017-01-07 13:41:50 +01:00
Nicolas Hake aef2705825 C4Group: Delete some dead code
The pByChild parameter to C4Group::AdvanceFilePtr was never used except
to pass it to itself recursively, and C4Group::ProcessOut was never used
at all.
2017-01-07 13:41:48 +01:00
Nicolas Hake 561e083181 Win32: Fix build with MSVC's Clang-based toolset
Well, somewhat. I can't get Clang/C2 to build Qt so I can't build OC
with Qt support.
2017-01-07 13:41:47 +01:00
Nicolas Hake c2ae62975a Win32: Fix build without Qt 2017-01-07 13:41:46 +01:00
Nicolas Hake b0b0533227 Make c4script binary use our private getopt library if necessary
Systems that don't come with getopt/getopt_long in their runtime library
need to link to our private copy; link that and use the right const-ness
for its prototype.
2017-01-07 13:41:45 +01:00
Nicolas Hake eeea131674 Aul: Enable better for loop generation
Instead of jumping forward and back repeatedly per iteration, we're
moving the incrementor past the body, which is when it's supposed to be
executed anyway.
2017-01-07 13:35:51 +01:00
Maikel de Vries 220d427915 silence warning for chippie inherited death calls 2017-01-07 07:52:25 +01:00
Mark 8aa442cb2c Defense: Fix typo 2017-01-07 02:22:37 +01:00
Mark 4b33beb9db MoltenMonarch: Clean code
The king size weapons overloaded entire functions from their original objects. This was replaced by adding interfaces that allow for the manipulation of the desired values.
2017-01-07 02:21:22 +01:00
Mark db9451dcce MoltenMonarch: Fix musket/blunderbuss 2017-01-07 02:10:00 +01:00
Mark dfc4483ae9 Hideout: Fix typos 2017-01-07 01:35:08 +01:00
Mark 80b3ceb560 Hideout: Make code more readable
Avoiding duplicate code.
2017-01-07 01:33:46 +01:00
Mark df031f600e Hideout: Fix warnings (shadowing local variable e), clean code 2017-01-07 01:09:55 +01:00
Mark 172613e0c9 Clonk Control / Ladder: Add possibility of triggering a jump with ydir
This was part of a bugfix in the ladder for Hazard: The ladder lets the Clonk execute a jump with Clonk.JumpSpeed / 2 at the top. This is useful for extra jumps and other things where you want to force the clonk to jump.

Regarding the ladder: The most of the problems with ladders arise from the OC implementation. Further commits may follow.
2017-01-06 21:58:13 +01:00
Mark 2168a6948a Base Material: Remove more duplicate code 2017-01-06 15:38:16 +01:00
Mark 879f21acaf Base Material: Add brackets. 2017-01-06 15:34:25 +01:00
Mark 65850d4015 Base Material: Extracted function for accessing the player's base material
Reduces duplicate code.
2017-01-06 15:27:11 +01:00
Mark 32245bfb20 Base Material: Rename 'def' to 'material' 2017-01-06 15:19:15 +01:00
Mark 2b5a2740b4 Base Material: Rename 'cnt' to 'amount' 2017-01-06 15:18:11 +01:00
Mark 548d2a7b13 Base Material: Rename 'plr' to 'player' 2017-01-06 15:16:02 +01:00
Maikel de Vries 1d211c9466 fix burning and destruction of vines 2017-01-05 21:06:17 +01:00
Maikel de Vries 948ef66723 fix AI scaling on ladders 2017-01-05 21:05:28 +01:00
Maikel de Vries 1ad0cb7cab remove unused object bigboomattack 2017-01-05 13:47:33 +01:00
Clonkonaut dad7156f6a Airplane now has just one fire button (Mouse Left / CON_Use), Mouse Right (CON_UseAlt) instead cycles through the firing modes.
As suggested by Maikel (http://forum.openclonk.org/topic_show.pl?pid=32751#pid32751).
2017-01-05 01:18:34 +01:00
Clonkonaut e4cfd39fdc Let plants grow less crowded, especially different kinds of plants (#1607).
This will need some testing whether all scenarios are still playable.
2017-01-04 03:33:28 +01:00
Clonkonaut 3fe83986ce Crash: made airplane invincible (#1754). 2017-01-03 23:03:51 +01:00
Clonkonaut fc9a25d215 Fixed fuse positioning when creating a new one.
Fuses were created at 0,0 and everything looked ugly!
2017-01-03 22:45:20 +01:00
Clonkonaut b7771d6906 Krakatoa: fix goal icon. 2017-01-03 22:35:24 +01:00
Clonkonaut 92f5eda3e9 Locomotive: fixed goal icon. 2017-01-03 22:33:45 +01:00
Clonkonaut a8d0f8f75e Chine: fix goal icon. 2017-01-03 22:30:33 +01:00
Clonkonaut d901a8952a Acid Rift: fixed superfluous declaration of global vars. 2017-01-03 22:25:50 +01:00
Clonkonaut 0eed215bbd Clonkomotive: fixed (deprecated) implicit declaration of for loop var. 2017-01-03 22:11:00 +01:00
Clonkonaut 06151bc5e5 Clonkomotive: fixed superfluous declaration of global vars. 2017-01-03 22:09:52 +01:00
Clonkonaut c423ec5de2 Made airplane touchable (#1663).
Made it untouchable in all missions.
2017-01-03 22:04:48 +01:00
Maikel de Vries 2ac4f2aa97 move windmill defense sounds to general folder
So that other rounds can use them as well.
2017-01-03 18:16:32 +01:00
Mark 83486fceb8 Control: Format scripts 2017-01-03 18:04:10 +01:00
Mark fa28a7a643 Control: Extract library for using menus
External packs use this functionality without using the whole default Clonk control.
2017-01-03 18:03:49 +01:00
Mark 39c54c323c Control: Extract library for using objects
External packs use this functionality without using the whole default Clonk control.
2017-01-03 18:03:32 +01:00
Maikel de Vries 577da1566a fix defense home base menu buy icon 2017-01-03 17:56:03 +01:00
Maikel de Vries 422207b54d add icons for buying and selling 2017-01-03 17:56:03 +01:00
Clonkonaut e6af3d216a Treasure Hunt: fixed superfluous declaration of global vars. 2017-01-03 16:50:13 +01:00
Clonkonaut b984704812 Raid: fixed superfluous declaration of global vars. 2017-01-03 16:38:47 +01:00
Clonkonaut 1fb8e4f757 Deep Sea Mining: Fixed crystal communicator graphics position. 2017-01-03 16:29:22 +01:00
Clonkonaut e2b238c381 Deap Sea Mining: fixed superfluous declaration of global vars. 2017-01-03 15:56:20 +01:00
Clonkonaut 7ec3f90127 Dark Castle: fixed airplane health hack to correct property name. 2017-01-03 15:49:52 +01:00
Clonkonaut 99d4fcb5ba Dark Castle: fixed superfluous declaration of global vars. 2017-01-03 15:48:39 +01:00
Clonkonaut 4fce224238 Crash: adjusted merchant dialogue to new flag behaviour. 2017-01-03 03:56:52 +01:00
Clonkonaut 145be7d097 Mt Brame: fixed goal icon. 2017-01-03 03:41:05 +01:00
Clonkonaut 7be2bd33fa Moved airplane smoke a bit out of the way and made less prominent, added water stirring effect when flying low! 2017-01-03 01:55:18 +01:00
Maikel de Vries efed830df3 fix liquid container accepting materials and show them in interaction menu 2017-01-02 18:33:14 +01:00
Maikel de Vries 8fa5de35a9 fix airplane parachute mode 2017-01-02 18:29:23 +01:00
Maikel de Vries c5590d851a add liquid test which causes an error on material change 2017-01-02 09:17:54 +01:00
Clonkonaut c11ca2f3c6 Airplane: added a bunch of firing modes (switchable via the interaction menu):
Of course, kept the old two modes: bullet and rocket (boompack) firing.
Bomb dropping for dropping fused iron bombs and dynamite sticks.
Liquid spray for spraying the landscape with whatever you like (of course, with water you get a firefighting plane!).
Balloon parachuting for midair action drops!
Object dropping - drop whatever you want!
2017-01-02 01:52:08 +01:00
Sven Eberhardt 8cd2432c58 Allow non-editor collection of objects by dialogue helper object
Also revert Clonkonaut's crash landing into hotfix
2017-01-01 17:00:57 -05:00
Sven Eberhardt d46f98fd7b Add EditorCollection callback
To be used to re-route contents created/moved in editor.
2017-01-01 17:00:56 -05:00
Lukas Werling 088fc450d9 Distribute players based on team instead of PrefPosition 2017-01-01 22:52:48 +01:00
Sven Eberhardt e015cdef8d Add basement width editor property 2017-01-01 12:46:23 -05:00
Sven Eberhardt dc9b948590 Editor: Add blit mode editor prop 2017-01-01 12:26:02 -05:00
Sven Eberhardt 52d0525886 Editor: Show proper name for default (nil) visibility property 2017-01-01 11:32:23 -05:00
Sven Eberhardt a23e4f2707 Dynamite box fixes and improvements
* Correctly save in scenario: Dynamite count and fuses
* Allow recollection and placement of dynamite sticks
* Allow recollection of dynamite sticks into the box, in which case fuses are automatically cut
* Implement with less duplicate state (removed count, wire, wires and dynamite_sticks variables)

This also allows placement of more than five dynamite sticks from a single box by collecting more sticks after some of them are already on the wire. I don't see why not; it's fun and cannot really be abused.
2016-12-31 22:54:43 -05:00
Armin Burgmeier f68fa47266 Fix auto-detection of SDL2_Mixer audio provider 2016-12-29 23:12:45 -08:00
Clonkonaut 8f972fd4b7 Airplane: float, to make it land on water (#1097). 2016-12-30 03:55:31 +01:00
Clonkonaut 71d5e611a4 Airplane: carry up to 20 items and 3 clonks (#1663). Also refactoring of the script. 2016-12-30 03:54:01 +01:00
Maikel de Vries 6fe22afe1a fix script runtime error in pump 2016-12-29 18:57:33 +01:00
Maikel de Vries 9b133030dc destruct airplane when crashing with low hit points
TODO: needs visual feedback when low on hitpoints.
2016-12-28 22:18:52 +01:00
Martin Strohmeier a16de0be0f Merge branch 'master' of git://git.openclonk.org/openclonk 2016-12-28 18:29:21 +01:00
Maikel de Vries 7a0b931c83 fix docs after GetBase removal 2016-12-28 18:23:33 +01:00
Martin Strohmeier c4ed3b56f4 Merge branch 'master' of git://git.openclonk.org/openclonk 2016-12-28 18:20:55 +01:00
Maikel de Vries 59961f3a17 remove base library
* remove library itself
* remove GetBase()
* change flagpole, etc.
* move basematerial library to vendor
2016-12-28 18:19:10 +01:00
Martin Strohmeier ded408701b Add Cavern.ogg to Music.ocg (Underground Music) 2016-12-28 18:18:46 +01:00
Clonkonaut 7968372dfa Crash: minor fixes:
g_has_bought_plans was defined multiple times, the wooden cabin will be created 2 pixels lower to stop it from jittering.
2016-12-28 14:29:21 +01:00
Clonkonaut b2d112b332 Crash: weird fix for the intro (see forum for details). 2016-12-28 14:29:21 +01:00
Sven Eberhardt 8ae8dd9c44 Add user action: Set player view 2016-12-28 08:54:01 -04:00
Sven Eberhardt f2e8bc5814 Fix basement width scenario saving 2016-12-28 08:53:59 -04: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
Sven Eberhardt b0429bdbcd Add earthquake user action 2016-12-28 08:53:57 -04:00
Sven Eberhardt bdb3118309 Add missing inherited calls to structure Definiton calls 2016-12-28 08:53:55 -04:00
Sven Eberhardt 16988e76f0 Add "flip" EditorAction to structures 2016-12-28 08:50:19 -04:00
Sven Eberhardt eee156b5ac Add sequence user action to trigger other sequences 2016-12-28 08:50:18 -04:00
Sven Eberhardt 93109e60f5 Fix solid check position for earthquakes launched from local calls
The effect is created in global coordinates, but the SemiSolidCheck was done in local coordinates.
2016-12-28 08:50:17 -04:00
Clonkonaut 308fc37e47 Remove extinguished flames. 2016-12-27 22:51:44 +01:00
Maikel de Vries ee2f82860c put pipe at structure bottom when cutting it 2016-12-26 20:30:29 +01:00
Maikel de Vries 2392f85358 fix another c4script error when updating power network 2016-12-26 17:55:45 +01:00
Maikel de Vries aeddfd1b03 prevent bullet pack from sliding due to zero friction 2016-12-26 17:55:45 +01:00
Maikel de Vries a422c6d6ec power storage: save stored power and make editor property 2016-12-26 17:55:45 +01:00
Maikel de Vries 84d621fc5a fix script runtime error when updating power networks 2016-12-26 17:55:45 +01:00
Mark 7c2a4ee574 #1710: Fix wrong animation on ladder after wall jump
The problem was that the call to Actmap.*.StartCallLadderOverloaded happend parallely with the ladder search effect and finished after the search effect call was finished, starting a wall jump animation after the Clonk grabbed the ladder.
2016-12-25 19:24:10 +01:00
Mark bace3b7d2b #1710: Remove logs for debugging 2016-12-25 19:21:16 +01:00
Mark 45f98ce03a #1710: Fix the bug
The problem was that the call to Actmap.*.StartCallLadderOverloaded happend parallely with the ladder search effect and finished after the search effect call was finished, starting a wall jump animation after the Clonk grabbed the ladder.
2016-12-25 19:21:08 +01:00
Mark 17d6bb0e1b #1710: Logs for debugging 2016-12-25 19:21:01 +01:00
Maikel de Vries 7f1b6ac19b pumping air: fixed power need and high consumer priority 2016-12-25 19:07:26 +01:00
Maikel de Vries 525caa069a properly implement air pumping: no source needed, only pump on air need 2016-12-25 18:53:43 +01:00
Maikel de Vries 42c8dbc2c8 make producer continue directly after production finishes 2016-12-25 17:48:07 +01:00
Maikel de Vries 135a7d8aff fix support for multiple liquids in liquid containers 2016-12-25 12:48:15 +01:00
Maikel de Vries 0d0a61d4b0 change concrete production time to enable continuous pumping 2016-12-24 15:30:20 +01:00
Maikel de Vries b9aaa2fda4 pump: implement gui interface for selecting materials to pump 2016-12-24 15:12:14 +01:00
Maikel de Vries ae40126dbb implement pumping specific liquids only 2016-12-24 14:09:47 +01:00
Maikel de Vries d03ac67807 snow is not a liquid
We can make it a liquid if we want it to be used in the foundry, or adapt the foundry. But that should be done properly.
2016-12-24 14:09:47 +01:00
Maikel de Vries 203e8b8d1d add a test scenario for liquid systems 2016-12-24 14:09:47 +01:00
Maikel de Vries aa7eb1210e fix an error when deleting a pipe when the end is contained 2016-12-24 14:09:47 +01:00
Maikel de Vries c7afed1aeb allow pumping liquids from container (foundry and steam engine) 2016-12-24 14:09:47 +01:00
Lukas Werling 52626fe021 Fix AulCompiler leaking C4Strings with variable names 2016-12-24 00:13:02 +01:00
Lukas Werling 61962fe70a Add --check/-c parameter to c4script for syntax checking 2016-12-23 17:18:00 +01:00
Maikel de Vries 3aaf216582 tutorials: don't show tutorial helper objects in editor 2016-12-21 14:12:01 +01:00
Maikel de Vries 478265fe96 explain clicking on goal icon in tutorials (#1683) 2016-12-21 14:12:01 +01:00
Lukas Werling f9305a1526 Editor: Fix crash when trying to save scenario into itself 2016-12-19 23:14:49 +01:00
Maikel de Vries ae6cdc6619 fix return value of InsertMaterial when a pixel is created
This is a partial fix for #1865. Also this return value still needs to be fixed for query_only == true, but that requires a bit more work in C4PXS.
2016-12-19 22:49:28 +01:00
Maikel de Vries caef28c7f6 add concrete object (#1572)
This still needs some work to fully function with pumps and pipes.
2016-12-19 21:09:22 +01:00
Lukas Werling 8d9eedffe4 Reset C4NET2IO_DUMP_LEVEL to 1 (#1869) 2016-12-19 17:30:19 +01:00
Maikel de Vries 7715d961f5 add information about whether power storages are being filled to the power display 2016-12-18 12:20:36 +01:00
Maikel de Vries 95e520a941 initialize power library local vars in construction callback (#1868) 2016-12-18 11:08:51 +01:00
Clonkonaut afc565a419 Re-enabled automatic bucket emptying (#1867). 2016-12-18 00:50:35 +01:00
Maikel de Vries 60dfc86c55 fix power system test 22 2016-12-17 17:37:26 +01:00
Maikel de Vries 975269655f pipe: fix scenario saving 2016-12-17 17:34:39 +01:00
Maikel de Vries 5846d33692 add another test with pumps to the power system tests 2016-12-17 17:30:18 +01:00
Maikel de Vries 32dc9e3133 pump: fix InsertMaterialAtDrain taking into account if pixels have been inserted 2016-12-17 17:29:28 +01:00
Maikel de Vries 2b610ecb1d pipe: improve speed of GetConnectedLine
This leads to a factor 3 speed up for the pump.
2016-12-17 17:27:48 +01:00
Maikel de Vries 667b13c098 remove LifeCheck effects from progress bars
This check is done by the attachment action already and led to the creation of many useless effects.
2016-12-17 17:26:11 +01:00
Maikel de Vries 309b24c6fe fix deprecated implicit declaration in for loop for tutorial arrow 2016-12-16 21:39:37 +01:00
Maikel de Vries 7ef0fc5568 don't let producers empty extra slots (#1864) 2016-12-16 21:37:47 +01:00
Maikel de Vries d47c5eba2f fix construction goal (#1866) 2016-12-16 21:02:45 +01:00
Mark 46450a689f Fix additional UTF-8 warnings 2016-12-16 10:26:56 +01:00
Lukas Werling d84c9b174f Add warning for non-UTF-8 files 2016-12-13 22:40:51 +01:00
Lukas Werling 68ddeb3bed Convert all text files in planet to UTF-8 2016-12-11 21:19:13 +01:00
Lukas Werling 4c51620dcf Fix UPnP/Linux crash when there is no UPnP device 2016-12-10 22:07:37 +01:00
Maikel de Vries 1d258d3d48 fix (#1846) for real now 2016-12-01 23:02:43 +01:00
Nicolas Hake 60829ae5e4 Aul: Don't let exceptions escape from constant resolver
Letting the constant resolver throw exceptions prevented us from doing
checking on later initializers anyway, so instead we'll send them to the
error handler. As a special bonus this makes it so we don't crash when
a global variable initializer has errors. Fixes #1850, #1855.
2016-11-30 13:37:33 +01:00
Maikel de Vries 7552fd94f7 fix ownership changes of moving flags (#1846) 2016-11-28 00:53:48 +01:00
Armin Burgmeier 88361ab606 Use NEAREST texture filtering for material map
The material map is 1D texture that contains information about every
material-texture combination. There is no point in linear filtering,
i.e. trying to interpolate between two materials such as gold and granite
or whichever two materials happen to be adjacent in the material map texture.

This might or might not be relevant to #1841, but should be more correct
behavior in any case.
2016-11-27 11:21:17 -08:00
Armin Burgmeier 0340a28cdd editor: delete viewport widgets immediately
I don't know why the viewports are deleted with deleteLater(), but it leads
to an OpenGL context getting deselected behind our back, and so we don't know
when is a good time to re-select it. This leads to termination of the engine
when selecting File->Close (Ctrl+W) in the editor, because the graphics
re-initialization fails with no GL context active.

Instead, just delete the viewport widget immediately, which works fine at
least on Linux. This is also recommended by the Qt documentation at
http://doc.qt.io/qt-5/qopenglwidget.html.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 75cbba8b7d editor: keep track of viewports properly
When removing a viewport, then also remove it from the internal list of
viewports. Otherwise, we might attempt to delete it again later. Fixes
crash on editor shutdown on Linux.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 648309cf7e Make console destruction more deterministic
This fixes a crash on Linux when exiting the editor. It was caused by
C4Console::~C4Console being called by the C++ runtime after after main()
returned. The C4Console destructor then goes and deletes all the Qt
resources (QApplication and friends), and that caused a segfault, maybe
because some of the static Qt structures have already been deallocated.

Fix this by making the destruction of the Qt components deterministic. Add
a function "DeleteConsoleWindow" which deletes all the Qt components, and
call this function in C4Console::Clear.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 7a8b01f7d5 Change return type of CreateConsoleWindow to bool
All implementations were just returning `this` anyway, and this makes it
easier to add a corresponding cleanup function.
2016-11-26 15:19:51 -08:00
Mark d356d9db3d Fix inherited() calls
The ... operator should be added so that the parameters are passed down. In some cases even the named parameters were not passed down.
2016-11-26 18:57:31 +01:00
Mark 94ec4e336b Fix inherited(...) calls
The named parameters have to be handed down, because the ... operator only passes all the unnamed parameters.
2016-11-26 17:56:41 +01:00
Mark 5fc6ae05f8 HUD Modularity: Move library as suggested by Clonkonaut 2016-11-26 11:12:09 +01:00
Mark 202e1ed682 HUD modularity: Callback for controller ID
I think that the call GUI_Controller->GetControllerID() has more appeal, but it makes the code confusing maybe.
2016-11-26 11:10:35 +01:00
Mark b557719287 HUD modularity: Library for HUD controller
Extracted the basic functionality for HUDs from GUI_Controller to a library. This way, if you want to create a new HUD, you only have to include the library and all the desired components. Previously you had to copy the script from GUI_Controller, too. This holds of course only if you want to actually remove components from the HUD, and not just add to it.

Currently the GUI_Controller is referenced as the ID for the HUD, will change this to a callback.
2016-11-26 11:10:29 +01:00
Sven Eberhardt 551d9968f5 UserAction: Fix default value assignment on "Any" evaluators 2016-11-23 23:34:04 -05:00
Sven Eberhardt b12421bff8 Add inscription EditorProp to guidepost2 2016-11-22 23:25:27 -05:00
Sven Eberhardt 5ccc932386 Editor: Disable packed export if no game is loaded 2016-11-22 22:28:19 -05:00
Sven Eberhardt 1cde52e060 Editor: Add "Export packed" file menu item 2016-11-20 22:43:44 -05:00
Sven Eberhardt d77206338c Editor: Fix pre-selection of last file and folder in save as dialogue 2016-11-20 22:43:15 -05:00
Sven Eberhardt 290d606bc5 Fix boiling liquid visibility, saving and activity in cave maps 2016-11-20 21:52:33 -05:00
Sven Eberhardt 27272aea02 Fix mac build 2016-11-20 13:58:25 -05:00
Sven Eberhardt a5de44b4e9 Add UserAction: Set shader 2016-11-20 13:43:46 -05:00
Sven Eberhardt 04b5f82080 Editor: Add "open in network" to file menu and to new scenario dialogue 2016-11-20 13:24:09 -05:00
Sven Eberhardt 4b508134f8 Add clonk EditorAction: Turn around 2016-11-20 13:15:03 -05:00
Sven Eberhardt 27291ec977 Automatically move dropped items from dialogue to dialogue target
Because it happens easily when editing.
2016-11-20 13:15:02 -05:00
Sven Eberhardt 615e08a137 UserAction evaluator: Object alive 2016-11-20 13:15:02 -05:00
Sven Eberhardt fb400456ce Add MovingBrick editorprops and graph movement 2016-11-20 13:15:01 -05:00
Sven Eberhardt 5e2c39da28 Editor: Fix shape edge and vertex properties when used within an enum 2016-11-20 13:15:00 -05:00
Sven Eberhardt e0d741079a Editor: Fix shape drag value updates 2016-11-20 13:15:00 -05:00
Sven Eberhardt 6793455119 Add drag_finished parameter to EditCursorMoved callback 2016-11-20 13:14:59 -05:00
Sven Eberhardt 4a31ce0fd8 Add editor prop for neutral flagpoles 2016-11-20 13:14:59 -05:00
Sven Eberhardt 8ac9a1e2bf Add Rule_BaseRespawn editor props 2016-11-20 13:14:58 -05:00
Sven Eberhardt c5623aa7a2 Fix crash on script error in DirectExec scripts 2016-11-20 13:14:57 -05:00
Sven Eberhardt bcf782a5a8 Improve diamond+socket scenario saving and editor visibility 2016-11-20 13:14:57 -05:00
Mark f2870dfa16 Object.c: New functions
Needed AddSpeed() in a project and thought that it would be a good addition. AddVelocity() is not used so far, maybe we should remove it again.
2016-11-19 19:05:27 +01:00
Sven Eberhardt a46ecc7b5b Editor: Invalidate selection if EditCursorMoved()-callback returned true
This allows position-induced shape- or property-changes to be reflected immediately.
2016-11-16 01:11:55 -05:00
Fulgen301 399a619e4c Aerobatics: German translation added. 2016-11-13 21:57:16 +01:00
Nicolas Hake 34bdab6ba5 Aul: Don't force assertions active
Assertions are great for debugging, but in public builds they just kill
apps dead.
2016-11-13 11:07:22 +01:00
Nicolas Hake eda6cc9c7f Aul: Gracefully handle errors in codegen (#1840)
By continuing to generate bytecode even after an error is found, we're
able to find more syntax errors and will also be able to keep the value
stack at the expected height.
2016-11-13 11:07:21 +01:00
Nicolas Hake ff0325dfac Aul: Always reset the current function when a declaration ends (#1839)
When an error occurred during codegen of a function, the current
function pointer would not be reset to 0, leading to spurious warnings
about redeclaration of functions.
2016-11-13 11:07:01 +01:00
Sven Eberhardt 072e1dcde0 Editor graph delegate: Add update callback functionality for graph edits 2016-11-12 22:20:05 -05:00
Sven Eberhardt 83c1d25b84 Fix editor graph delegate vertex hit radius 2016-11-12 22:20:04 -05:00
Sven Eberhardt 1621e984a9 Editor shapes: Update shape if value changed by script 2016-11-12 22:20:04 -05:00
Sven Eberhardt 91af5a95be Editor graph delegate: Add HorizontalFix, VerticalFix and StructureFix constraints 2016-11-12 22:20:03 -05:00
Lukas Werling 3b2909fa95 Use glUniform*iv for setting script uniforms 2016-11-13 00:17:35 +01:00
Lukas Werling d720e648ce Fix compile error with libstdc++ 2016-11-13 00:13:04 +01:00
Lukas Werling 6847e50e79 Implement setting shader uniforms from script (#1206)
Uniform variables are read from the "Uniforms" proplist set on Scenario
or on individual objects. Proplist keys are uniform names. Values can
either be an int or an array of one to four ints in C4Script. In GLSL,
the uniforms then need a matching type (int/ivec2/ivec3/ivec4). There is
no error reporting; uniforms are only set if both name and type match.

The implementation walks the "Uniforms" proplists on each Draw call. We
may need to cache the uniform maps if this turns out to be too slow.
2016-11-12 22:09:23 +01:00
Maikel de Vries bfc830a103 fix wrongly turned catapult (#1838) 2016-11-11 20:10:12 +01:00
Fulgen301 fb882d693e Ropebridge: German translation added. 2016-11-11 18:43:35 +01:00
Fulgen301 db61e047ee Tutorial 06: German translation added. 2016-11-11 18:43:35 +01:00
Fulgen301 863213fe76 Rapid Refining: German translation added. 2016-11-11 18:34:35 +01:00
David Dormagen 83435a89fa Fixed typo in German localization (#1848) 2016-11-11 18:20:59 +01:00
Lukas Werling b3772e6650 Fix assertions in C4ConsoleQtGraph 2016-11-11 18:00:21 +01:00
Sven Eberhardt bf9c940aa6 Editor graph delegate: Add edge and vertex properties. Remove graph storage options.
The different storage options weren't really needed and would not work with edge and vertex delegates.
2016-11-10 21:43:43 -05:00
Sven Eberhardt e13bd62f94 Editor: Keep current shape list separate from property holders
This prevents shapes from being re-created (and temporary state lost) if the holding property moves within the list.
2016-11-10 21:43:42 -05:00
Sven Eberhardt 1e52ed5a74 Remove unused variable ndx in C4AulParse::Parse_Expression 2016-11-10 21:43:41 -05:00
Lukas Werling bd8b241734 Update dependency list in README 2016-11-10 22:19:58 +01:00
David Dormagen ae2000f0a1 Contents menu: sort extra-slot containers to front to make items jump around less
With the highest items being in the front, the tight grid layout has less reason to resort a major amount of the items every time items are added or removed. This results in a generally more stable layout.
2016-11-07 20:09:37 +01:00
David Dormagen 12e808263b Contents menu: use tight grid layout (#1842)
This makes extra-slot containers not block an extra row anymore. However, they might jump around a bit. It might be a good idea to set their priority lower to make them always appear first.
When they would be in front, the tight grid layout would likely not move them around.
2016-11-05 15:35:15 +01:00
David Dormagen 8a8593e0ba Script GUI: added TightGridLayout style (requirement of #1842)
The TightGridLayout fills spaces more aggressively. This is slower but makes for a tighter layout. Finding the best layout is NP-complete. This here is just O(N^2) or so.
2016-11-05 15:35:15 +01:00
Julius Michaelis 7aeec3279c Fix 75289da and 55b6713 2016-11-03 13:09:54 +01:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Sven Eberhardt 54e8c14666 Editor: Add graph, polyline and polygon shape delegates 2016-11-02 09:54:31 -04:00
Julius Michaelis 75289dabb5 Always Log chat message 2016-11-01 19:26:38 +01:00
Lukas Werling 9c98227a03 Fix all -Wformat warnings 2016-10-31 23:39:45 +01:00
Sven Eberhardt 02dffb8af1 Allow rotation of guideposts 2016-10-31 10:10:29 -04:00
Sven Eberhardt f17046e1f0 Fix display of rotated meshes with MeshTransformation
Rotation used the wrong (untransformed) coordinates for the rotation center
2016-10-31 10:10:29 -04:00
Nicolas Hake 194e7d709b Aul codegen: Handle errors at codegen time better (#1837)
If a parse error occurs inside a declaration, the codegen should just go
on and deal with the next declaration instead of completely giving up on
the entire script.
2016-10-31 11:17:43 +01:00
Nicolas Hake f0f50ec402 Aul: Don't prepend "ERROR:" to parser error msgs
Further formatting of the error message should be the error handler's
job.
2016-10-31 11:16:14 +01:00
Nicolas Hake 3c13c88f56 Aul: Count errors and warnings properly
9caaf1e introduced an external error handler for easier testing of
error conditions. The default error handler needs to count errors and
warnings if we want to display them, but didn't.
2016-10-31 11:15:19 +01:00
Sven Eberhardt 8e281103b0 Improve guidepost editor placement and rotation
* Shows correct size in preview (by setting the scaling on the definition instead of in Construction)
* Can be oversized
* Avoid angles where all signs are facing parallel to the camera
* Unfortunately, rotation doesn't work well with Mesh Transform (uses the wrong rotation center for the graphics)
2016-10-31 00:34:48 -04:00
Sven Eberhardt 5c5e1a5fa3 Fix editor selection after object duplication on remote clients
Also remove some remaining EditCursorSelection/EditCursorDeselection callbacks
2016-10-30 22:26:14 -04:00
Sven Eberhardt aed3f92982 Fix dialogue sequence assignment
It used to be set by reference instead of copying, which means all dialogues created in a single session would reference the same sequence.
2016-10-30 21:56:08 -04:00
Kanibal 97c8104ac8 Fix msvc build. 2016-10-30 21:46:29 -04:00
Sven Eberhardt 15fbb1ea99 Fix editor runtime join to use a file at the temporary path 2016-10-30 20:40:40 -04:00
Sven Eberhardt d048ca01dc Fix resource goal scenario saving 2016-10-30 20:33:55 -04:00
Sven Eberhardt a07d26c839 Fix conditional UserAction in loops 2016-10-30 20:33:55 -04:00
Sven Eberhardt 3712c6ed2f Change MoveTo function signature in experimental CableLorry 2016-10-30 20:33:54 -04:00
Julius Michaelis 55b6713185 Dedicated server: stop game when there are less than 2 clients 2016-10-30 21:36:29 +01:00
Julius Michaelis 890669ea0d Silence a warning from getopt when using --config 2016-10-30 21:36:29 +01:00
Julius Michaelis 65940080a7 Remove two unused config options, set music to default off with the dedicated.
I admit that this is just a hack to silence some warnings by default.
2016-10-30 21:36:29 +01:00
Julius Michaelis 64dd72c380 Fix dedicated: Load JPEG surfaces so the texture shape information can be correctly generated 2016-10-30 21:36:29 +01:00
Lukas Werling 63cc42e967 Improve script shader code
- Avoid std::list.

 - Don't pass strings and vectors by value.

 - Don't try to update script shader slices as they never change.
2016-10-30 12:06:01 +01:00
Julius Michaelis 29b5fa5946 Fix include: no "src/" 2016-10-30 01:21:44 +02:00
Lukas Werling 5da45d68e1 Add docs for AddFragmentShader/RemoveShader 2016-10-29 21:22:12 +02:00
Lukas Werling 13fa0ab7b1 Implement adding/removing shaders from script
New script functions: AddFragmentShader, RemoveShader.

There is currently no support for adding vertex shaders.
2016-10-29 21:19:08 +02:00
Julius Michaelis 9ab410e47d SDL: Notify C4Application of resolution / window size changes. 2016-10-29 14:15:09 +02:00
Nicolas Hake bce0b45413 Editor: Fix scheduler timer so it doesn't busy wait (#1834)
36/1000 is always 0 and doesn't make a lot of sense anyway. Use 1000/36
(aka 1000ms/36fps) instead so the UI thread has some time to rest.

Also use a Qt::PreciseTimer so Qt doesn't try to coalesce the scheduler
timer with other timers to save energy.
2016-10-28 21:31:14 +02:00
Sven Eberhardt f2231e848e AulCompiler: Fix static parameter type check 2016-10-24 22:00:30 -04:00
Sven Eberhardt 2b6eb83e48 Fix some parameter count errors 2016-10-24 21:28:31 -04:00
Sven Eberhardt 591b20b6ca Fix some variable name shadowing errors 2016-10-24 21:21:55 -04:00
Sven Eberhardt 0d20551ab6 Fix some "function variable hides local variable" warnings 2016-10-24 21:05:17 -04:00
Sven Eberhardt 342916a1ed Fix some implicit for loop declaration errors 2016-10-24 21:02:02 -04:00
Sven Eberhardt 7f543e8390 Add AI control UserActions 2016-10-24 21:02:02 -04:00
Sven Eberhardt 2e73343814 EnemyAI: Add "active" setting
This allows disabled AI clonks (to be used by UserActions)
2016-10-24 21:02:01 -04:00
David Dormagen 83260c5e69 Key object: updated graphics
This one has a higher resolution and should also look decent when bigger (e.g. as an inventory picture). Made by me with Blender.
2016-10-24 18:12:45 +02:00
Julius Michaelis e61dcbe4c3 Extend the netpuncher: clients can ask hosts for a connection initiation to circumvent port restricted NATs 2016-10-23 22:34:43 +02:00
Julius Michaelis 078ac47780 Add CMake option for headless-only build. 2016-10-23 22:34:42 +02:00
David Dormagen c2f391e565 editor: don't crash on selecting object when EditorBase doesn't have member EditorProps
This crash happened for me in a custom scenario but with unmodified original objects. No idea why, but it seemed defective anyway.
2016-10-23 18:47:44 +02:00
Sven Eberhardt 8fb8be9cec Sequence: Store trigger offset to allow non-synchronized triggers at the same interval 2016-10-23 00:20:26 -04:00
Julius Michaelis 072c4a3475 Fix windows build: link libpng to libopenclonk
Attempt #2
2016-10-22 21:33:10 +02:00
Julius Michaelis b658f6aeed Fix windows build
Attempt #1
Make that 26 compilation units saved.
2016-10-22 19:59:23 +02:00
Julius Michaelis f72bfc72a3 Add a libopenclonk target to save compiling some units twice
Unfortunately, only 27 units could be deduplicated with the current state of USE_CONSOLE.
2016-10-22 18:28:25 +02:00
Julius Michaelis 3c5dde1293 .gitignore 2016-10-22 17:42:23 +02:00
Julius Michaelis 376ca5a9df Prevent using USE_CONSOLE in lib{misc,c4script} 2016-10-22 17:42:23 +02:00
Lukas Werling e7f4105b97 Replace duplicate BreakMessage() implementations
...with a single one based on std::string in the hope of getting rid of
StdStrBuf some day.
2016-10-22 17:00:20 +02:00
Nicolas Hake cada67c097 Prohibit overriding local vars with functions (#1831)
The old parser threw a standard compile error in this case; the
AST-based parser threw an ICE, which is ultimately the same thing but
made it sound like the parser was at fault. And maybe it is, and we
should allow code like "local a; func a() {}" but that seems like it
should be a conscious design decision.
2016-10-21 22:32:24 +02:00
Julius Michaelis 8d2f2846b5 Fix mac build
Also move some stuff around once again…
2016-10-21 01:25:48 +02:00
Julius Michaelis 5b7c5b48ee Fix mape and mac build
Attempt #1.
2016-10-20 20:36:52 +02:00
Julius Michaelis 34a9a1de8d Twiddle with header organization: lib{misc,c4script} do no longer include GL/glew.h
(Yes, it is just that complicated.)
2016-10-20 18:46:32 +02:00
Nicolas Hake e2fd7095c1 Merge branch 'ast'
# Conflicts:
#	src/C4Include.h
#	src/script/C4AulCompiler.cpp
#	src/script/C4AulParse.cpp
#	src/script/C4AulParse.h
#	src/script/C4ScriptHost.cpp
#	src/script/C4ScriptHost.h
#	tests/CMakeLists.txt
2016-10-20 17:33:02 +02:00
Nicolas Hake 266feeda4d Aul: Add AST generation tests
Just making sure the parser creates the AST the way we expect before we
hand off the code to the codegen.
2016-10-20 17:20:55 +02:00
Nicolas Hake 118961d0b7 Aul: fix octal escape parsing
Bet you didn't know C4Script supported octal escapes inside strings.
Well, it didn't; or at least not correctly.
2016-10-20 16:53:23 +02:00
Nicolas Hake 5915f79960 Don't entirely recreate global vars in second compile pass
This allows people to properly cross-reference two proplists from each
proplist's initializer.
2016-10-19 14:20:48 +02:00
Nicolas Hake 021a6e89f5 Implement direct execution of whole function definitions
This implements the changes made in c6e4bfd on the AST-based parser.
2016-10-19 14:20:47 +02:00
Nicolas Hake 1a8db9e109 Make C4ScriptHost store C4Value refs to owned functions
C4Value already handles refcounting properly for us, so we don't need to
do it manually. It might still be worth manually refcounting them
to avoid the boxing/unboxing overhead, but it's only needed at load and
unload so it's not a priority at the moment.
2016-10-19 14:20:46 +02:00
Nicolas Hake 5f3dbdd417 Reject function expressions inside proplists inside functions
These aren't supported by the codegen on account of not working in
savegames.
2016-10-19 14:20:45 +02:00
Nicolas Hake 9caaf1e298 Aul: Split out error handling into a separate class for easier testing
By using an extern error handler in the script engine, we can mock that
handler and make sure something that should fail actually does, instead
of having to parse log messages.
2016-10-19 14:20:41 +02:00
Nicolas Hake b2d5164a0f Remove re namespace alias
This alias is a legacy from when we were using Boost.Regexp to
workaround a broken implementation in GCC's libstdc++ earlier than 4.9.
2016-10-19 13:46:03 +02:00
Nicolas Hake a188500609 Remove MS CRT memory management debugging
Redefining new breaks perfectly valid code, but only on MSVC and only in
one particular configuration (Debug). This is very annoying because it
means people not using MSVC, or even people doing Release builds, can
write standards-conforming code which then may fail to build for other
people.
2016-10-19 13:46:01 +02:00
Nicolas Hake f7a04624eb Remove references to functions defined in unloading defs (#1776) 2016-10-19 13:45:59 +02:00
Nicolas Hake ab1e6bd5a4 Allow proplist-local funcs to access vars of their owner's prototype
Thanks to JCaesar for providing this test case.
2016-10-19 13:45:35 +02:00
Nicolas Hake 46f342dd0c Tests: Split test helper functions into Expr/Code/Script evaluators
RunExpr will evaluate and return the value of a single expression.
RunCode will evaluate a full function body.
RunScript will compile a complete standalone script and return the
return value of its Main() function.
2016-10-19 13:45:11 +02:00
Sven Eberhardt a0580580aa Add rdir parameter to user action object creation 2016-10-16 21:47:20 -04:00
Nicolas Hake 1b32633806 Add C4LangStringTable::system_string_table def'n to standalone stubs 2016-10-16 20:11:13 +02:00
Maikel de Vries 0d6a8497fc allow setting the rotation of an created object in editor user actions 2016-10-16 19:59:54 +02:00
Lukas Werling 2163e27661 Add documentation for SetSky() 2016-10-16 19:41:03 +02:00
Armin Burgmeier 2362a73e60 FnSetSky: open Graphics.ocg before re-loading sky (#1827)
Needed to load shader slices in C4Sky::Init.
2016-10-16 10:04:54 -07:00
Armin Burgmeier 8f61918219 Initialize graphics when re-loading sky (#1827)
Need this so that C4Sky::Init can read the shaders.
2016-10-16 10:04:54 -07:00
Maikel de Vries 9aaec9a009 add option to door to lock it with a given key 2016-10-16 18:47:45 +02:00
Maikel de Vries 5e7ce466e1 add key object
Can be used to open doors, etc. Editor interactions and stuff are still on the todo.
2016-10-16 18:47:45 +02:00
Maikel de Vries ff2c32b77e play keypad sounds only for operating player 2016-10-16 18:47:45 +02:00
Maikel de Vries e124433cd5 fix playing sound when trying to enter enemy door 2016-10-16 18:47:45 +02:00
Maikel de Vries b4cdeb3da4 base material & production: add fail safes and remove entries with zero material 2016-10-16 18:47:45 +02:00
Nicolas Hake 8f47edc1e3 Fix destruction order of system string table vs. editor
Depending on the mood of the linker, the editor may have been
constructed before and destroyed after the system-wide string table
because they weren't defined in the same file. Destruction of the editor
tries to load some strings, which would then access the already
destroyed string table and thus crash.
2016-10-16 18:40:51 +02:00
Sven Eberhardt 24c386c67f Editor: Fix recent scenario display on welcome page if a recent entry was opened via path including Scenario.txt
Always show the name of the enclosing .ocs file.
2016-10-16 09:52:48 -04:00
Sven Eberhardt cd9d6f5c6f Editor: Show full path name in sound delegate display string 2016-10-16 01:15:38 -04:00
Sven Eberhardt 38cf275de7 Editor: Implement saving of editable enum delegates 2016-10-16 01:12:21 -04:00
Sven Eberhardt 386f178568 Editor: Auto-focus enum child editors for int, string, color and any types 2016-10-15 18:26:03 -04:00
Sven Eberhardt 028b576ab3 Editor: Change initial tool to "object edit" 2016-10-15 11:43:55 -04:00
Sven Eberhardt c44a776090 Editor: Fix object list update on object removal 2016-10-15 11:43:12 -04:00
Sven Eberhardt 978afbc4a2 Editor: Focus object script box on double-clicking item in object list 2016-10-15 10:39:33 -04:00
Sven Eberhardt d24afbe835 Editor: Fix display of non-object properties
Fixes property display of definitions, Global and Scenario.
2016-10-15 10:06:44 -04:00
Sven Eberhardt 06a438e05e Editor object list: Remove effects; add Global and Scenario 2016-10-15 10:06:44 -04:00
Sven Eberhardt 4b3f8c0fef Remove EditCursorSelection and EditCursorDeselection callbacks
They never worked properly in network mode because all users would see the changes.

EditorProps, EditorActions and shape delegates now provide the functionality to have custom object editing widgets.

This also fixes a bug with the selection callback causing the object list to act up.
2016-10-15 10:06:43 -04:00
Lukas Werling 59b5525a41 Rework sky definition parsing
This also adds a broken SetSky() script function which was the main
motivation for the rework. See #1827
2016-10-15 13:34:39 +02:00
Mark 44b2fda439 Cloud: Insert snow only if allowed to 2016-10-14 18:43:35 +02:00
Sven Eberhardt 15d850e4ec Editor: Add effects to property viewer 2016-10-14 10:50:17 -04:00
Maikel de Vries ce92a3cc16 add floor switch object to Decoration.ocd 2016-10-13 23:11:58 +02:00
Nicolas Hake 66d5ef8b08 Reset codegen target after parsing nested function
Parsing a function expression inside another function failed to reset
the code generator target to the containing function, so all following
bytecode would still be appended to the nested function, leaving the
container broken.
2016-10-12 14:56:54 +02:00
Mark 0996c6e31e Cloud: Play sound at rain impact location
The cloud does this with a helper object.
2016-10-11 21:51:32 +02:00
Mark 7df951fb65 Cloud: Mode without material insertion
Added a mode where the cloud does not extract or insert any materials, so that the rain is just a decorative element of the game.
2016-10-11 21:19:21 +02:00
Nicolas Hake d9696d2f88 Reorder game cleanup
The order in which game components were cleaned up seemed rather
arbitrary, so let's change that into blocks of reasonably connected
parts.
2016-10-11 19:44:29 +02:00
Nicolas Hake 14bfd7ea59 Clear console pointers earlier
It doesn't make a lot of sense to keep console pointers around while the
objects and scripts have already been deleted. Clear them earlier so we
don't have any dangling pointers.
2016-10-11 19:44:27 +02:00
Lukas Werling 170a793a44 Windows: Only write to stdout if there is no debugger 2016-10-11 18:07:31 +02:00
Sven Eberhardt 510d91fd00 Editor: Allow movement of HorizontalFix items by holding Shift and on object duplication 2016-10-10 21:46:17 -04:00
Sven Eberhardt 5e4aefddb2 Editor: Fix Ctrl+Click in object creation mode to create contents 2016-10-10 21:35:04 -04:00
Sven Eberhardt 4eae2b28d7 Editor: Fix drop cursor drawing 2016-10-10 21:26:10 -04:00
Sven Eberhardt eee79366d0 Add tool tip to "test sequence" button 2016-10-10 16:45:24 -04:00
Sven Eberhardt 6e6f642be6 Add tool tip to dialogue editor action 2016-10-10 16:45:24 -04:00
Sven Eberhardt d670291aba Implement tool tips for EditorActions 2016-10-10 16:45:23 -04:00
Sven Eberhardt 20d234e324 Editor: Replace | by line breaks in descriptions and EditorHelp texts 2016-10-10 16:45:22 -04:00
Nicolas Hake a6b65f0dee Merge pull request GH #28 from aburgm:fix-proplist-leak
Don't leak static proplists with cyclic references
2016-10-10 19:32:30 +02:00
Lukas Werling f5613c350e Windows: Write console output to stdout
This is useful for third-party editor UIs.

See http://forum.openclonk.org/topic_show.pl?tid=3344
2016-10-10 16:03:49 +02:00
Lukas Werling 4d5bb7304c Fix game controllers not working with the editor 2016-10-10 14:16:18 +02:00
Sven Eberhardt 244650bb17 Add base material to player spawn object.
Set the default to a lot of clonks. This is useful so the "respawn at flagpole" rule works as expected even if users don't know about the base material setting.
2016-10-09 13:27:20 -04:00
Sven Eberhardt b0e42e35d1 Sequence: Default action to empty sequence 2016-10-09 13:27:20 -04:00
Mark 2957a777b3 Goal: Extracted function NotifyPlayerHUD
Removed duplicate code in the process.
2016-10-09 11:53:25 +02:00
Mark 35e8a43f82 Goal: Optimize HUD updates
No more lacking behind the fulfillment status.
2016-10-09 11:50:06 +02:00
Mark 84dd95df34 Goal controller: Player parameters for goal display functions
Allows goals with different symbols per player.
2016-10-09 11:34:13 +02:00
Mark 9fcd3ee13e Goal controller: Extracted functions
Made the variable names consistent between GoalSubMenu() and OnGoalUpdate();
Extracted the functions GetGoalSymbol() and GetGoalGraphics();
2016-10-09 11:26:47 +02:00
Mark b18a7b7a3f Goal controller: Readability
The change in call structure should not make that much of a difference in performance.
2016-10-09 11:18:10 +02:00
Mark 0d22f58b52 Goal controller: Get short description only once. 2016-10-09 11:13:12 +02:00
Mark 0732b7dc87 Goal controller: Code cleanup 2016-10-09 11:11:51 +02:00
Mark b235c5e9e4 Goal controller: Simplified code 2016-10-09 11:11:28 +02:00
Mark f52159b835 Goal controller: Variable definitions 2016-10-09 10:58:37 +02:00
Mark be207737bc Goal controller: Slight optimization
No need to call the function twice. This is trivial though, the call is not expensive usually.
2016-10-09 10:51:48 +02:00
Sven Eberhardt c05ee7e644 Add gravestone inscription editor props 2016-10-08 23:29:50 -04:00
Sven Eberhardt 5e3730fc3e Editor: Store+Restore maximized state 2016-10-08 20:53:01 -04:00
Sven Eberhardt 765648877f Editor: Fix window shutdown to correctly save editor geometry even if quitting via Application.Quit (e.g. Ctrl+Q) 2016-10-08 20:52:25 -04:00
Sven Eberhardt cf7134e60e Fix a few warnings / possible divisions by zero 2016-10-08 20:51:51 -04:00
Sven Eberhardt 64cfe42827 Update shipped getopt version to include the new optional_argument option 2016-10-08 20:51:22 -04:00
Sven Eberhardt 45718ee44d Change tool hotkeys from <number> to to <Ctrl>+<number>
This allows better combined playing+editing experience [Maikel]
2016-10-08 19:15:28 -04:00
Sven Eberhardt 685513816f Editor: Raise focused viewport dock.
When switching viewports using F10, the selected dock may have been hidden
2016-10-08 19:15:27 -04:00
Sven Eberhardt 9e150f2bfb Viewport zoom towards center and fix scrolling 2016-10-08 19:15:26 -04:00
Mark 7c169c7905 Moved object interaction menu sidebar icons to separate overloadable functions 2016-10-08 17:46:39 +02:00
Lukas Werling eff406a181 Fix plain --lobby not working 2016-10-06 21:19:31 +02:00
Maikel de Vries 2505dc77f1 add room door to Decoration.ocd
This is a door which leads to nowhere, but they can be connected via script or serve other purposes. Graphics by Apfelclonk.
2016-10-06 18:43:04 +02:00
Armin Burgmeier 561651b715 Fix issues with resolution switching on Linux
* Engine would always open up in Fullscreen and then switch to Windowed
   instead of just starting up as Windowed.

 * Could not change resolution because bit depth or refresh rate did not match
   * handle RefreshRate==0 as "any", just like windows

   * Remember refresh rate in combo box that enumerates all the modes and
     propagate to video mode setting instead of assuming all modes have the
     same refresh rate.

   * Report bit depth as 32 even if SDL tells us it's 24. Other parts of the
     code require it to be equal to 32, but 24 works just fine.

 * Changing from fullscreen to windowed when "Screen" was selected in
   resolution combo box (i.e. iXRes==-1) makes the window tiny (0x0 pixels).
2016-10-05 21:38:46 -07:00
Clonkonaut f37eda9508 Moved HUD proplist definitions to separate, overloadable functions.
See http://forum.openclonk.org/topic_show.pl?pid=32552#pid32552 for more information.
2016-10-06 01:47:45 +02:00
Lukas Werling ddb34ab5cb Disallow interaction with actively controlled Clonks
This prevents inventory stealing which is undesirable in cooperative
scenarios with competitive elements (e.g. some races) and confusing to
players.
2016-10-05 22:14:40 +02:00
Armin Burgmeier 25b1a49543 Set last error when setting resolution fails
The last error is displayed in the GUI, so until now there was just a "(null)"
string there.

The whole (SDL) resolution switching code is completely broken as well, but
that's a different story...
2016-10-03 22:39:46 -07:00
Maikel de Vries 89be9bd158 implement scenario saving for liquid tank, pump & pipe 2016-10-03 18:07:49 +02:00
Sven Eberhardt 4756fb0ba1 Unify moving brick graphics size.
Otherwise, there were still graphics artifacts sometimes.
2016-10-03 00:02:46 -04:00
Sven Eberhardt 76ce8089af Fix display of moving bricks with size<4. 2016-10-02 23:47:02 -04:00
Sven Eberhardt d48dbfba82 Add optional size parameter to Particles_Flash 2016-10-02 23:47:01 -04:00
Lukas Werling bca0c76331 Lower minimum masterserver update interval to 1s
This interval is critical for the netpuncher. Clients have to wait for
the first masterserver update before they can join.
2016-10-03 00:05:23 +02:00
Maikel de Vries 1483620b2b fix c4script runtime error in power system when pump is initialized 2016-10-02 23:23:20 +02:00
Maikel de Vries 48d98d708e fix script error in keypad 2016-10-02 08:03:14 +02:00
Maikel de Vries b0ff00439f fix possible script error in pump 2016-10-01 19:18:23 +02:00
Maikel de Vries 2073fb0f0a improve picture graphics of animals 2016-10-01 16:32:29 +02:00
Maikel de Vries 1eb17613bc keypad: allow alternative graphics for its buttons 2016-10-01 16:32:29 +02:00
Maikel de Vries df43ab86f2 add IsAnimal to animals for finding them 2016-10-01 16:32:29 +02:00
Sven Eberhardt 9299ec4223 Fix max energy in AI test scenario 2016-10-01 10:26:43 -04:00
Sven Eberhardt b317afbadc Fix division by zero on progress bars with max=0 2016-10-01 10:26:25 -04:00
Sven Eberhardt d35fc728bf Fix DrawParticleLine documentation and example #1823 2016-10-01 10:19:40 -04:00
Armin Burgmeier 836927d93c Don't leak static proplists with cyclic references
If a local variable in a definition was set to a proplist inside the
Definition() callback, and that proplist contained cyclic references
then those references were leaked. Typically cyclic references for
script-created proplists are broken in
C4PropListScript::ClearScriptPropLists, however definition proplists
are changed to be static proplists in
C4PropList::FreezeAndMakeStaticRecursively.

To fix this, each script host maintains a list of proplists made static
by FreezeAndMakeStaticRecursively, and explicitly deletes all of these
proplists on Clear().

This leak also leads to an assertion failure inside
C4PropListScript::ClearScriptPropLists in debug mode, and can also be
observed by C4PropList::PropLists not being empty after game clear.

The definition in Objects.ocd/Helpers.ocd/UserAction.ocd constructs
cyclic proplists in its Definition() call. A simpler, more minimal way
to provoke the leak is the following (it provokes the leak but not the
assertion failure):

    local bla;

    func Definition(def)
    {
        bla = {};
        bla.test = { Name="Test222" , Options = { Name="Test333" } };
        bla.test.Options.Link = { Name="Test444", Blub=bla.test };
    }
2016-09-30 17:50:41 -10:00
Sven Eberhardt d04476ad0b Allow oversize and rotation of fence 2016-09-30 22:23:11 -04:00
Sven Eberhardt 0604a815d0 Fix undefined constant in keypad 2016-09-30 21:40:57 -04:00
Maikel de Vries fa977149e9 make firefly use insect swarm library 2016-09-30 18:58:42 +02:00
Maikel de Vries b42a4b824b insect swarm: fix movement issues 2016-09-30 18:58:42 +02:00
Armin Burgmeier 732fff3029 Fix possible use of uninitialized variables
For example, creating a C4WindowSDL and deleting it without calling
::Init() on it would lead to use of uninitialized variables.
2016-09-27 21:52:55 -10:00
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 8a09fcc1b1 Increase REPL output depth to 10 (from 1)
This makes working with nested arrays and proplists a lot less annoying.
2016-09-26 16:33:24 +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 679eedaf50 GetPathLength: add optional depth parameter
This is also exposed by the PathFinder defcore entry.
2016-09-25 21:48:19 +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
Lukas Werling c3cf464a83 Editor: Fix scenario open filter (#1817) 2016-09-18 23:22:39 +02:00
Lukas Werling 880981ad31 Fix build on systems with non-long regex index types 2016-09-18 19:40: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 fbb8ad5d87 Add RegexSplit() 2016-09-18 11:10:19 +02:00
Lukas Werling 219f81f004 Regex: Fix off-by-one error 2016-09-18 10:49:06 +02:00
Lukas Werling 619ad27a91 Regex: Fix infinite loop with zero-length matches 2016-09-18 01:16:06 +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
Lukas Werling b614209593 SDL: Use OpenGL 3.1 if 3.2 is not available (like WGL) 2016-09-17 12:32:18 +02:00
Nicolas Hake 6a6f4520d3 Merge pull request GH #25 from Mailaender/appdata
Added a Linux AppData file
2016-09-17 11:55:43 +02:00
Nicolas Hake 59173dbd12 Merge pull request GH #27 from lheckemann/master
Require Qt 5.4+ for editor — needs QOpenGLWidget
2016-09-17 11:03:00 +02:00
Linus Heckemann 355b6fe070 Require Qt 5.4+ for editor — needs QOpenGLWidget 2016-09-17 08:23:07 +01:00
Lukas Werling d7cd224a4f Add functions RegexReplace, RegexSearch and RegexMatch 2016-09-16 23:46:03 +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
Lukas Werling 8d9657a800 Change default puncher address to netpuncher.openclonk.org 2016-09-09 18:31:39 +02:00
Sven Eberhardt 2490ef4584 Editor: Add more shortcut keys 2016-09-09 00:56:16 -04:00
Sven Eberhardt e67e429fef Editor: Improve default layout and raise proper dialogues on tool change 2016-09-09 00:56:15 -04:00
Lukas Werling c41f93a2f6 Fix c4script and mape build 2016-09-08 21:45:30 +02:00
Lukas Werling f7376169b9 Fix crash when starting a game in fullscreen mode 2016-09-08 21:26:59 +02:00
Lukas Werling 7177c261b3 Bring back and fix the netpuncher
As carrier-grade NATs are becoming common, many players cannot host
Clonk games at all. The simple STUN-like netpuncher from Clonk Rage
which was removed three years ago is already effective against some
DS-Lite NATs.

With some extensions, we should be able to make it work with more
restrictive NATs as well.

This reverts commit 72002cc366.
2016-09-08 21:10:06 +02:00
Sven Eberhardt 53b365a6d2 Editor: Add shortcuts, menu items, tooltips 2016-09-08 01:56:01 -04:00
Sven Eberhardt 0e02bad837 Editor: Disable reinit scenario button if no scenario is loaded 2016-09-08 00:25:17 -04:00
Sven Eberhardt b95d1387a4 Editor: Add "reset to saved scenario" command 2016-09-07 01:53:54 -04:00
Sven Eberhardt 856730aabd Fix some signed/unsigned warnings 2016-09-07 01:53:54 -04:00
Sven Eberhardt 2c20204021 Add C4SECT_ReinitScenario flag for LoadScenarioSection
This also resets the script engine and does player init callbacks. Useful to restart the scenario in the editor.
2016-09-07 01:53:53 -04:00
Lukas Werling 3d5f2f012a Fix openclonk-server build 2016-09-06 22:12:06 +02: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 a882a6e64b Fix black editor screen due to GL object creation and removal in wrong context 2016-09-06 02:45:17 -04:00
Sven Eberhardt 5523e685fb Fix script engine assertion on game clear 2016-09-06 01:13:53 -04:00
Sven Eberhardt dee6086e1d Fix access violation in proplist-to-static conversion 2016-09-06 01:09:29 -04: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 ba371db0e6 Editor property enum delegate: Improve grouping when an item is also a group 2016-09-05 19:19:33 -04:00
Sven Eberhardt d70506ee2e Improve GetDefinitionGroupPath script function
* Now works on _this instead of parameter
* Now works before editor window opened
2016-09-05 18:30:04 -04:00
Sven Eberhardt 41dde5e7d0 Add script function GetDefinitionGroupPath 2016-09-05 02:00:01 -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
Nicolas Hake 2e4afb70a9 OS X: Make bundling of libraries recursion-safe (#1818)
Bash variables are global by default. Therefore, recursing into sub-
dependencies was breaking ID updates in the dependency parent.

Mark variables that are local to each recursion step as local so that
their original value gets restored when the recursion returns.
2016-09-04 14:11:51 +02: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 3669f28b75 Fix array property delegate default value to write a copy instead of a reference when it's a static prop list 2016-09-04 02:14:30 -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 5a149b3b8a Add alpha mask option to editor property color delegate 2016-09-03 22:07:09 -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 0093555b49 Fix sorting between groups and names in enum editor properties 2016-08-30 19:37:42 -04:00
Sven Eberhardt 30738c760e Fix water splashing particles 2016-08-30 18:56:46 -04:00
Sven Eberhardt 6ac3bde3de Fix possible crash in viewport drawing 2016-08-30 18:56:27 -04:00
Sven Eberhardt a291ba2144 Fix a warning in random number generator 2016-08-30 18:55:35 -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 f53a4a6597 Fix enum parameter value resolution to nil when proplist value is undefined 2016-08-29 15:18:02 -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
Sven Eberhardt 4caa9ee217 Fix disappearing health bars after crew reactivation and savegame reload (#1629, #1740) 2016-08-28 22:13:08 -04:00
Sven Eberhardt 80d5810c3e Another Mac/Linux build fix 2016-08-28 10:23:13 -04:00
Sven Eberhardt 5a2e96e25b Correct a format placeholder type 2016-08-28 10:17:36 -04:00
Sven Eberhardt 0acf8a36f9 Fix Linux/Mac build 2016-08-28 10:16:06 -04:00
Sven Eberhardt b763982f45 Fix scenario saving as network client to not delete saved scenario after game end (#1814) 2016-08-28 00:56:15 -04:00
Sven Eberhardt f796716655 Fix cotton scenario saving 2016-08-28 00:20:39 -04:00
Sven Eberhardt 5da1a0d5c1 Fix some sequence progress bugs 2016-08-28 00:16:58 -04:00
Sven Eberhardt 96842e2961 Sequence test uses first local player as triggering player 2016-08-27 22:20:03 -04:00
Sven Eberhardt 3163332def EditorActions: Replace %player% by first local player number 2016-08-27 22:19:25 -04:00
Sven Eberhardt 949ab90fc8 Editor: Fix enum delegate setting a value on cancel undeer certain conditions 2016-08-27 21:33:25 -04:00
Sven Eberhardt aa8289b55b Editor: Always commit string property changes if text has been edited 2016-08-27 21:24:43 -04:00
Sven Eberhardt 528504d72e Editor: Hide grade circle in viewport when using rectangle or picker tool 2016-08-27 20:10:58 -04:00
Sven Eberhardt 4f74d88d51 Editor: Fix selected object property dropdown list 2016-08-27 19:56:46 -04:00
Sven Eberhardt c98f99b427 Editor: Do not reset landscape brush when switching tools 2016-08-27 19:43:34 -04:00
Sven Eberhardt 6070bb4782 Fix editor prop enum option Set function 2016-08-27 19:05:12 -04:00
Sven Eberhardt 61b75f002f Add extra clonk skins to skin selection menu in editor props 2016-08-27 19:04:50 -04:00
Sven Eberhardt 64f7a97eb6 Fix hang on startup on negative definition priority 2016-08-27 18:37:56 -04:00
Sven Eberhardt b339db9ea7 UserAction particles: Add fire and ring particles
Also sort particle type list by name.
2016-08-27 17:45:01 -04:00
Sven Eberhardt 0e3b1865ea UserAction: Add more options for particle creation
Also fix collision behaviour setting to work.
2016-08-27 17:38:25 -04:00
Sven Eberhardt 147e70ace9 Fix sequence and dialogue progress mode saving 2016-08-27 17:17:48 -04:00
Sven Eberhardt 065d8536da UserAction evaluators: Sort constant value above other evaluators 2016-08-27 17:15:20 -04:00
Sven Eberhardt dfefa7df6f UserAction goto and log: Put parameters directly into enum 2016-08-27 17:14:51 -04:00
Sven Eberhardt 6b9df3118c Sort UserAction evaluators and groups by name
Also merge effect group into ambience group.
2016-08-27 16:46:59 -04:00
Sven Eberhardt e2e9248d89 UserAction: Clarify HideFullName property comment 2016-08-27 16:46:58 -04:00
Maikel de Vries 788ba6e0c4 allow swapping source and drain pipe at the pump 2016-08-27 17:10:30 +02:00
Maikel de Vries a15ac3742e add icon for swap 2016-08-27 17:10:30 +02:00
Sven Eberhardt 00bc92e13f Use short names as main editor delegate display in property window.
Simplifies most user action displays by omitting things like "Constant" in the list.
2016-08-27 10:12:17 -04:00
Sven Eberhardt dba7e773ab UserAction variable evaluators: Default name to empty string constant 2016-08-27 10:01:33 -04:00
Sven Eberhardt 4a14ce735e Fix UserAction type "Any" evaluators
Their callback function was not registered if they weren't duplicates from a non-any type
2016-08-27 09:59:25 -04:00
Matthias Mailänder c1d1e0a437 Add a Linux AppData file. 2016-08-27 12:28:48 +02:00
Sven Eberhardt 357eb462bd Fix display of nil enum child delegate value if stored in a proplist and key is not defined.
It would fall back to the outer value instead.
2016-08-27 02:21:35 -04:00
Sven Eberhardt e4b4246500 Fix freezing and assignment of static names to child proplists created in Definition()-callbacks (#1798)
Also adjust editor props for the change:
1. enum needs to create a copy, not a reference for the default value of an option if it is defined inline
2. Always use proper GetName() resolution on property group names even if a static name would be available
2016-08-27 02:04:03 -04:00
Sven Eberhardt 820b2a39a0 Fix display of some user actions 2016-08-27 02:04:02 -04:00
Maikel de Vries 49fa224bcd C4D_Vehicle to C4D_None for some non-vehicles 2016-08-26 22:11:18 +02:00
Maikel de Vries 96e8f0a12f fix fusing of dynamite box (#1816) 2016-08-26 19:54:19 +02:00
Maikel de Vries 07008af820 fix missing string table entry in UserAction.ocd 2016-08-25 19:07:24 +02:00
Maikel de Vries 4410e95cc2 tutorial 6: do not allow turning catapult while aiming (#1744) 2016-08-25 19:07:24 +02:00
Maikel de Vries 97c093ea0d tutorial 03: add welcome message to guide post 2016-08-25 19:07:24 +02:00
Sven Eberhardt 44022f840f Add CustomInitializationScript to all objects 2016-08-25 00:18:11 -04:00
Sven Eberhardt 540bd62ad3 Optimize torch timer
The torch timer was #1 script in a profiler run of a scenario with 10 torches.

Reduce to 1/4th of the calls. Actually, I think it looks better now (less regular, more torch-y).
2016-08-24 01:28:28 -04:00
Armin Schäfer 77790c7313 Add Shark: Squashed commit of the following:
commit 1abfae50c6454c8f5bab10bff753fb472f0596d0
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Wed Aug 3 00:56:40 2016 +0200

    Make shark slower (only twice as fast as the Clonk) and reactivate FastSwim animation.

commit b35db07894be864978a6b03609eb3d754b622705
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Thu Jul 21 22:24:48 2016 +0200

    Shark: Fix shark not swimming for a while when Clonk was too near.

commit f1495371394796e4a2d984049c026eaa66a0d30e
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Sun Jul 3 19:48:22 2016 +0200

    Shark: Revert wrong location of the shark.

commit 437f911629c8ec9ee1c587e653790378b0d8fd17
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Sun Jul 3 19:44:49 2016 +0200

    Shark: Fix one turning bug, it can not be big enough to cause a mesh bug when turning around; shark is a bit slower when attacking (hopefully it can not jump out of the water now)

commit 28d0a9dfbad4e2b4c42295e73d8d42e5495b0e37
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Sat Mar 26 01:28:19 2016 +0100

    Move shark to Objects.ocd and add sharks to Clonkomotive on hard settings.

commit 000d162fb5c36225fdd215d1d30336a1c926ec27
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Sat Mar 26 01:09:55 2016 +0100

    Shark: Fix bugs.

commit be201ffd6424203bf2b9b3a2a8496b3d41ec3122
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Sat Feb 20 14:48:12 2016 +0100

    Shark update. Fix animation when attacking.

commit 7dc24e93fa19f26cc2f3344ac8267b81b4fd3eee
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Sat Jan 23 22:36:24 2016 +0100

    Delete the patch.txt from my last commit.

commit 36e828fb7545fb6c2538c728844f0b4dc97bfcc5
Author: Armin Schäfer <arminnessie@gmail.com>
Date:   Sat Jan 23 17:38:29 2016 +0100

    Add experimental Shark scenario.
2016-08-23 19:16:54 +02:00
Sven Eberhardt 83a5034f63 Add inscription property to guideposts
Now you can set a guidepost message in the editor!
2016-08-23 02:08:12 -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 e4fad91d36 Fix user action sound in local context 2016-08-23 02:07:53 -04:00
Maikel de Vries e18cee3a46 turn musket into blunderbuss
The musket was not a very popular and useful weapon, being inferior to the bow. It now shoots 5 weaker bullets in one shot with less damage per bullet, this might require some further testing and fine-tuning. Also the weaker bullets mean that they can be used in a gatling-gun (WIP) and in the airplane as well.
2016-08-22 16:32:48 +02:00
Maikel de Vries 7935f736fe make mooq firebomb C4D_None instead of C4D_Vehicle 2016-08-22 16:32:47 +02:00
Maikel de Vries 095a589842 clean up bullet trail and fix offset to bullet 2016-08-22 16:32:47 +02:00
Maikel de Vries 1fc7fea628 remove unused local variable from grenade launcher 2016-08-22 16:32:47 +02:00
Maikel de Vries 45bb9ab550 rename lead shot to lead bullet and clean up script 2016-08-22 16:32:47 +02:00
Sven Eberhardt d2557960ae Add user action: Give player knowledge 2016-08-21 15:40:38 -04:00
Sven Eberhardt f6b3a6efb8 Add magic wand as an editor-assignable usage item 2016-08-21 15:17:51 -04:00
Sven Eberhardt f9349721e4 Add user action: Cast particles 2016-08-21 14:49:23 -04:00
Sven Eberhardt c7b114139a Add user action: Change wealth 2016-08-21 14:49:22 -04:00
Sven Eberhardt 967a5730ed UserAction evaluator display: Invert full name display default
Showing the full name is far more common than hiding it.
2016-08-21 14:49:21 -04:00
Sven Eberhardt 237956e7ba Add user action: Fling object 2016-08-21 14:49:20 -04:00
Lukas Werling 2044fc3c06 SDL: Fix wrong keyboad button labels 2016-08-20 23:16:31 +02:00
Sven Eberhardt b553d69d25 Add user action: Game over 2016-08-20 11:30:45 -04:00
Sven Eberhardt 56adee6bb9 Add script goal editor properties and user actions 2016-08-20 01:55:22 -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 947ca6af7c Add user action: Activate/deactivate sequence 2016-08-20 01:55:20 -04:00
Clonkonaut 6a80ce8edb Hot Ice Hotfix: Prevent grenade launcher from getting stuck uselessly in aim mode.
This fix might be dangerous, I do not know it. I have no real idea what this line was supposed to do. But it certainly prevented the release use command from getting to the used item in certain corner cases (right between loading and aiming).
I tested a bunch of vehicle and they work fine so far. So maybe this line was useless and harmful after all.
2016-08-20 00:56:50 +02:00
Sven Eberhardt 568088aedb Editor: Add Copy+Paste functionality for properties 2016-08-19 16:13:28 -04:00
Lukas Werling c965c24ee2 Docs: Remove obsolete remark about Random() range 2016-08-19 16:03:54 +02:00
Lukas Werling 26a552473c Add support for two extra mouse buttons (#mantis-is-down-right-now)
This also fixes a missing definition for "MiddleDouble". Only
implemented for SDL and Qt, someone else will have to do Windows.
2016-08-18 22:43:42 +02:00
Sven Eberhardt 5d6ecc8dc8 Fix possible hang on effect execution with timer=1
If a timer=1-effect registered another timer=1-effect into the same object, it could cause an endless loop. This happened if the timer in the sequence object was set to 1.
2016-08-18 00:14:19 -04:00
Clonkonaut 5518d0ca15 Forgot to make the diving helmet a tool product! 2016-08-17 20:28:26 +02:00
Clonkonaut d93b4d7b3a Do not show helmet on back (can't make it work properly with other items).
The helmet is just too big and bulky. Same with the diving helmet.
2016-08-17 20:25:05 +02:00
Clonkonaut 01232b61a5 Fixed taking off of helmet when putting on another. 2016-08-17 20:23:33 +02:00
Clonkonaut afe5cd3c24 Added diving helmet, must be connect to a pump!
Rudimentary handling of air pumping added to the pump and of course the helmet. The functions of the helmet concerning air pumping can maybe later used for a library.
2016-08-17 20:23:18 +02:00
Maikel de Vries 192ccc0203 prevent hitting self with reverse throw (#1759) 2016-08-15 19:20:08 +02:00
Sven Eberhardt 3a49a9c21d Add user action: Set object position 2016-08-15 01:19:14 -04:00
Sven Eberhardt 20f9dbed43 Fix sync loss on InitializePlayers callback
It was called too early for remote clients.
2016-08-15 00:51:59 -04:00
Sven Eberhardt a86576b763 Add TreasureHunt title image 2016-08-14 18:41:37 -04:00
Sven Eberhardt 1fe086a106 Add MtBrame title image 2016-08-14 18:39:48 -04:00
Sven Eberhardt 9be5379f73 Add MineRescue title image 2016-08-14 18:39:47 -04:00
Sven Eberhardt 343a4be8cc Add GoldenMountain title image 2016-08-14 18:39:47 -04:00
Sven Eberhardt 225b0a9444 Add FrostySummit title image 2016-08-14 18:39:46 -04:00
Sven Eberhardt 2415e0d7d3 Add DeadlyGrotto title image 2016-08-14 18:39:45 -04:00
Sven Eberhardt 42e6c3de3c Add DarkCastle title image 2016-08-14 18:39:45 -04:00
Sven Eberhardt 18437305ca Add AcidDrilling title image 2016-08-14 18:39:44 -04:00
Clonkonaut 1b76c31452 5 title picture by ala and K-Pone.
https://clonkspot.org/forum/topic_show.pl?pid=14524#pid14524
2016-08-15 00:32:01 +02:00
Sven Eberhardt 6ee3849b18 Fix "number of objects in container" sequence trigger 2016-08-14 14:16:03 -04:00
Sven Eberhardt bce903ee04 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Animal.ocd/CreatureControl.ocd/DefCore.txt
2016-08-13 23:42:59 -04:00
Sven Eberhardt 4a94c3598b Sequence: Add "<" operator to contents count trigger 2016-08-13 23:25:01 -04:00
Clonkonaut 1036bad7fb Added a helmet by pluto. Wear and get 20% off damage*!
*: not all damage is reduced, does not help against explosions, fire, asphyxiation or corrosion. We assume no liability for any deaths or injuries occurred while wearing.
2016-08-12 18:25:01 +02:00
Clonkonaut 43117a53bd Added Library_Wearable for clothing or other worn items. 2016-08-12 18:22:50 +02:00
Lukas Werling abef0da0aa Fix RestartApplication on Linux
(and hopefully don't break it on Windows)
2016-08-11 22:11:15 +02:00
Sven Eberhardt 4869eff787 Allow joining to editor games through startup network dialogue 2016-08-10 19:35:39 -04:00
Clonkonaut 825c0653e5 Added a slight helper for corner scaling when just pressing up (#1770, #1630).
The problem occurred as soon as the clonk's leg vertices passed the edge. It seems the engine does not really align the bottom vertex to the material. However, the bottom vertex does have CNAT_Bottom & _Left & _Right, in theory it should be properly attached. Maybe this is a little bit broken engine-wise or maybe assigning both left and right to a vertex isn't supported?
Because the lower vertex (foot vertex) isn't attached, the clonk falls down onto its leg vertex and gets stuck in an endless loop of Scale, Jump, Walk, Scale, ...
When pressing left/right, this is no problem as the clonk will be pushed towards the edge when walking and soon touch it with its foot vertex (I assume at this point regular engine behaviour kicks in).

I added a little helper in the scale effect that sets COMD_UpLeft / UpRight whenever this situation is detected and only Up is pressed. 2 frames (1 is not enough) after the effect ended, the ComDir will reset to COMD_Up. It is then possible to climb an edge and stand still on top of it.

Maybe not a perfect solution (a perfect solution would probably be to fix attachment in the engine but I couldn't pinpoint the exact problem) but it works for now.
2016-08-10 01:19:11 +02:00
Clonkonaut 7a56086d13 Fix Brick density in VolcanoEscapeEx (#1781). 2016-08-10 01:07:42 +02:00
Clonkonaut 52fdcec172 Renamed coconut tree (#1752). 2016-08-10 00:08:01 +02:00
Clonkonaut 51a18f42b2 Expand ObjectInteractionMenu search radius one pixel lower (#1788).
I don't think this pixel will hurt too much.
2016-08-10 00:01:27 +02:00
Clonkonaut 05a814461f ObjectInteractionMenu: don't create infinite ExtraSlotTracker effects.
I think there's a bug in the effects system. It seems that effects are not removed properly if command_target is deleted. I will investigate.
2016-08-09 23:45:48 +02:00
Clonkonaut 07ea0fe438 Dynamite Box is now a container holding 5 sticks of dynamite. Can be taken out separately (and put back in). 2016-08-09 23:44:14 +02:00
Lukas Werling 4f5ba57170 Allow scenario saving as editor client 2016-08-09 18:55:43 +02:00
Sven Eberhardt 4fbeead744 Fix user action "Cast objects" speed property name 2016-08-09 00:12:45 -04:00
Sven Eberhardt ba9165d016 Fix "triggering clonk" user action evaluator in "a clonk dies" to point to the clonk. 2016-08-09 00:09:07 -04:00
Sven Eberhardt c5ecc3a2b1 Fix user action evaluator: Find contents with ID given 2016-08-09 00:03:51 -04:00
Sven Eberhardt d005c20f00 UserAction: Fix typo in US strings 2016-08-09 00:01:10 -04:00
Sven Eberhardt effec53f0a PlayerStart: Default crew to one clonk
It's the most sensible setting for most scenarios (melee, parkour, etc.) and probably the best default for newbies.
2016-08-09 00:00:17 -04:00
Sven Eberhardt 9d715387f2 Qt editor: Store and restore window layout (docked dialogues, etc.) 2016-08-08 23:57:24 -04:00
Sven Eberhardt 60240ac05b Qt editor: Fix material size slider when adjusting with a method other than dragging 2016-08-08 17:39:10 -04:00
Maikel de Vries daf45a17f5 fix boiling lava name 2016-08-08 23:04:21 +02:00
Sven Eberhardt d5cc9c2a36 UserAction: Add missing SetCondition setter function 2016-08-08 16:24:06 -04:00
Sven Eberhardt be60b276d0 User action script: Fix script error if a context returns nil.
If a context is defined but returns nil, the script now returns nil instead.
2016-08-08 15:34:06 -04:00
Sven Eberhardt 4581022411 Fix an aul preparser crash on DirectExec functions parsing
GetLastRetType doesn't work because the preparser does not generate code.

The code looks a bit like this line just got lost somehow?
2016-08-08 15:26:25 -04:00
Sven Eberhardt a713870f33 Reorder some user action parameters 2016-08-08 15:03:40 -04:00
Sven Eberhardt 0c31bc7985 Fix parkour checkpoint initialization when loaded form scenario 2016-08-08 14:56:57 -04:00
Sven Eberhardt 6811546dae JetStream: Editor-friendly and scenario savable 2016-08-08 14:41:52 -04:00
Clonkonaut e5d90c90c6 HotIce: Balloon spawn added for extra fairness. 2016-08-08 18:25:52 +02:00
Lukas Werling ec128bede4 Qt editor: Fix freeze during lobby and loading on Linux 2016-08-08 17:24:44 +02:00
Maikel de Vries 700d5c199f rapid refining: fix pumping into refinery drain 2016-08-08 16:54:28 +02:00
Sven Eberhardt b2bed04a7e Fix sequence suspension 2016-08-08 00:49:17 -04:00
Sven Eberhardt 4c349b8c17 Qt editor: Fix enum parameter delegate initial value assignment 2016-08-07 23:42:41 -04:00
Sven Eberhardt 7e87b62e3e Add sequence triggers: Interval and object count in container 2016-08-07 23:42:40 -04:00
Lukas Werling e6c483953a Dynamite: Make FuseTime a local to make changes possible 2016-08-08 01:43:19 +02:00
Lukas Werling 05d5d128c7 Qt editor: Disable scoreboard windows to fix Linux crash
These windows should be reimplemented as Qt windows.
2016-08-08 00:32:31 +02:00
Sven Eberhardt 44999d550c Fix user action sequence check interval and make it configurable 2016-08-07 17:33:51 -04:00
Sven Eberhardt dd2e649825 Fix user action dialogue message options 2016-08-07 16:24:23 -04:00
Sven Eberhardt dd36e46f62 Fix sequence scenario saving 2016-08-07 16:09:40 -04:00
Maikel de Vries df098d2840 pump only activates when drain is free or accepts liquid 2016-08-07 21:26:23 +02:00
Lukas Werling b69576ed73 Merge branch 'master' of https://github.com/openclonk/openclonk 2016-08-07 18:19:03 +02:00
Lukas Werling f3b2ff1295 Merge branch 'gamepad-controls' 2016-08-07 18:10:24 +02:00
Sven Eberhardt eafa2e9305 Fix game coordinates for keyboard controls that request a cursor pos 2016-08-07 18:03:56 +02:00
Sven Eberhardt 231a0ba9b4 Send mouse coordinates directly with control if SendCursorPos is true 2016-08-07 18:03:55 +02:00
Maikel de Vries a9a2ffd95c rapid refining: add waterfall as additional power source 2016-08-07 17:27:31 +02:00
David Dormagen 51bab0b0b2 renamed "Gaya" to "Gaia"
This is necessary to not draw the attention of Zeus and find an end through a dramatic lightning strike.
2016-08-07 17:26:36 +02:00
Sven Eberhardt 159d0811d6 Fix game coordinates for keyboard controls that request a cursor pos 2016-08-07 11:08:42 -04:00
David Dormagen a9b1b975d3 removed Libraries/Animal/CreatureControl (and thus the automatic script player)
The script players was not treated correctly by the goals, so joining it automatically would break stuff. While I still like the implications of an automatic script player, it was too much of a hassle for now.
Find_AnimalHostile works around the main issue as it allows just using Find_AnimalHostile and automatically have the animal work for both neutral owners and as pets. It does not allow for the distinction of hostile neutral and friendly neutral, though.
2016-08-07 17:05:53 +02:00
Sven Eberhardt e5c6ca990b Send mouse coordinates directly with control if SendCursorPos is true 2016-08-07 10:48:54 -04:00
Sven Eberhardt 08d2e3f521 Qt editor: Fix material selection sorting and remove duplicates 2016-08-07 10:33:21 -04:00
Maikel de Vries 809172e74c new world: rapid refining 2016-08-07 14:24:28 +02:00
Lukas Werling 00ee209eca Hot Ice: Handicap teams with more players
In every team, the same number of players will now load their grenade
launcher before the round starts. If there's a team with more players,
some players won't be able to shoot immediately.
2016-08-07 13:56:04 +02:00
Sven Eberhardt 39cfd4a0fe Fix non-editor build (this time for real!) 2016-08-07 02:18:01 -04:00
Sven Eberhardt be58ef5ae1 Goal_Parkour: Also reset last respawn checkpoint on "reset all" editor action 2016-08-07 02:07:27 -04:00
Sven Eberhardt 17409ab4c1 Add user action evaluator: If 2016-08-07 02:06:15 -04:00
Sven Eberhardt 5babeba4d8 Add user action evaluators: X/Y component of position 2016-08-07 01:50:29 -04:00
Sven Eberhardt 0b5e8723c2 Fix non-editor build 2016-08-07 01:42:29 -04:00
Sven Eberhardt b1460398fb UserActions: Prioritize some action main arguments 2016-08-07 01:16:27 -04:00
Sven Eberhardt 009dc4221f Parkour checkpoint US string fix 2016-08-07 01:14:23 -04:00
Sven Eberhardt 3a6a7aceaa Qt editor: Fix object selection on EditorAction in network 2016-08-07 01:13:24 -04:00
Sven Eberhardt f6d1e6ed2b Fix dialogue creation through EditorAction
Silence a warning and make sure the name is valid.
2016-08-07 01:06:26 -04:00
Sven Eberhardt 7a9ff289f5 Make parkour checkpoint and respawn management more robust to runtime editor development 2016-08-07 01:02:23 -04:00
Sven Eberhardt 596d2a5e68 Add "Reset all cleared" editor command to parkour goal 2016-08-07 00:28:53 -04:00
Sven Eberhardt e471a98fe3 ItemSpawn: Add spawn_id EditorProp name and help. 2016-08-07 00:18:28 -04:00
Sven Eberhardt 84190e6685 Reset item spawn points on clonk death 2016-08-07 00:16:50 -04:00
Sven Eberhardt b7e0b9ba3f Add ItemSpawn name and description. 2016-08-07 00:11:09 -04:00
Sven Eberhardt f59b6c837f UserAction: Fix some US string table entry names 2016-08-06 23:59:22 -04:00
Sven Eberhardt 62fb460180 Qt editor: Make completer in script input box case sensitive 2016-08-06 23:54:47 -04:00
Sven Eberhardt c70a2e94f2 Auto re-number and re-assign start and finish checkpoints when points get deleted 2016-08-06 23:41:50 -04:00
Sven Eberhardt 5c70c2aa42 Qt editor: Fix viewport titles and decorations
The custom title bar caused a lot of problems. Particularly turning it on and off between docked and undocked modes caused some internal trouble with the rendering going off. It also didn't have a close button.

Fortunately, the desired font and highlight effect of selected viewports can also be achieved with style sheets on the dock.
2016-08-06 23:39:44 -04:00
Sven Eberhardt a993b6e1ec Add distinct graphics for parkour start
It used to be the same as the end (flag), which was a bit confusing
2016-08-06 22:24:59 -04:00
Sven Eberhardt 769fa0fbdc Do not auto-deactivate clients without players in editor 2016-08-06 22:05:25 -04:00
Sven Eberhardt 5db45c0f47 Merge branch 'master' into qteditor 2016-08-06 21:45:19 -04:00
Sven Eberhardt 90d813fc5a Fix OnMouseOver / OnMouseOut parameter warnings
The callbacks from PlayerControl aren't used anywhere right now and there's only two unrelated internal functions in the GUI list menu with the same name. So the parameter checker emits a warning here.

Solve it by renaming the internal functions.
2016-08-06 21:42:21 -04:00
Sven Eberhardt 1cdf22ae81 Fix restart rule creation in parkour goal
Was created at a large offset and multiple copies could be created.
2016-08-06 21:34:01 -04:00
Sven Eberhardt 40abe71a8c Qt editor: Better placement of PlayerStart object in new scenario 2016-08-06 21:29:26 -04:00
Sven Eberhardt 3553cd54b5 Qt editor: Allow creation of larger map in new scenario 2016-08-06 21:29:09 -04:00
Sven Eberhardt a7fffcfd77 Qt editor: Clear definition list on game close 2016-08-06 21:19:24 -04:00
Sven Eberhardt b6e45daa24 Qt editor: Enable play button to start game in lobby 2016-08-06 21:16:28 -04:00
Sven Eberhardt 5bb204d69b Qt editor: Fix net menu
It didn't work, had the wrong labels and crashed.
2016-08-06 21:12:04 -04:00
Clonkonaut cb8086cff7 Try to space out two items on the back better.
Mainly concerns scaling / hangling and it isn't perfect but better than before.
2016-08-07 03:04:04 +02:00
Sven Eberhardt c0f95d97f7 Fix net menu popping up out of nowhere all the time 2016-08-06 20:29:15 -04:00
Sven Eberhardt 6dc4cb7f1d Remove some outdated todo comments in C4ConsoleQt 2016-08-06 20:28:50 -04:00
Sven Eberhardt 20eaaa97b3 Fix chatting in editor lobby 2016-08-06 20:22:33 -04:00
Sven Eberhardt 1c90f9b2da Do not abort network round due to insufficient player count in editor mode 2016-08-06 15:45:56 -04:00
Sven Eberhardt 5cbbd0d05b Add respawn material setting to player spawn 2016-08-06 15:24:25 -04:00
Sven Eberhardt 714ff028c8 Update GetConditionalIDList to new array delegate syntax 2016-08-06 15:24:03 -04:00
Sven Eberhardt c78a98d4b3 Fix crash on uninitialized pointer in Qt GL window initialization 2016-08-06 15:22:58 -04:00
Sven Eberhardt 8ec12d8490 Add cleared and respawn user callback actions to parkour goal and checkpoints 2016-08-06 14:50:43 -04:00
Sven Eberhardt e39b314239 Add property to auto-save EditorProps in scenarios 2016-08-06 14:49:48 -04:00
Sven Eberhardt db1e9abbe3 Unify rule picture size display in the editor to 32x32 2016-08-06 10:32:21 -04:00
Sven Eberhardt 7825931c95 Limit rule placement in editor to one per rule type 2016-08-06 10:27:56 -04:00
Sven Eberhardt 7aaa581908 Auto-update checkpoint assignment to parkour goal in editor 2016-08-06 02:38:01 -04:00
Sven Eberhardt a21a1a8051 Limit goal placement in editor to one per goal type 2016-08-06 02:37:25 -04:00
Sven Eberhardt fc24969899 Add EditorPlacementLimit property
Limits the number of object instances that can be placed of a given def.
2016-08-06 02:36:53 -04:00
Sven Eberhardt c15a821a51 Name parkour checkpoints by index 2016-08-06 01:13:35 -04:00
Clonkonaut 8d6d57089b Inventory slot selection is back on key down.
This makes the selection of the Q slot slightly more awkward because you select the target slot in between. Or to say otherwise: it is kind of like it was before.
2016-08-05 19:36:26 +02:00
Clonkonaut f4ca4466f1 Basements combine in all four directions when constructing! 2016-08-05 18:21:34 +02:00
Clonkonaut ad2bbbf5fd ForceConstruct() added to ConstructionSite for better debugging.
Will construct the construction without the needed material. I often needed to test stuff with construction sites and always had to script-create all the material which is tedious.
2016-08-05 18:19:05 +02:00
Clonkonaut 2032e0274b IsHammerBuildable added to WoodenBridge. 2016-08-05 18:18:00 +02:00
Sven Eberhardt e6b286b126 Add parkour checkpoint EditorProps and EditorActions 2016-08-05 01:09:34 -04:00
Sven Eberhardt a14f8597d2 Qt editor: Fix AsyncGet on bool delegate 2016-08-05 01:00:33 -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 a06363b70b Fix restart rule graphics 2016-08-05 00:29:52 -04:00
Sven Eberhardt 6bd6c07195 Qt editor: Remove some debug logging 2016-08-04 22:22:14 -04:00
Sven Eberhardt 395cca18e1 Add script to sync System.ocg/Language*.txt files 2016-08-04 22:19:39 -04:00
Sven Eberhardt 1fd12024c7 Add some MSVC and QT files to .gitignore 2016-08-04 22:16:00 -04:00
Sven Eberhardt bce09d272d Add EditorInitialize callback 2016-08-04 22:12:10 -04:00
Sven Eberhardt 693c0124b9 Update more goal icons for better editor size 2016-08-04 21:15:25 -04:00
Sven Eberhardt c14721523c Make standard goals and rules visible as icons in editor 2016-08-04 19:32:57 -04:00
Sven Eberhardt 3eb106dd85 Add SetMaxEnergy function to clonk 2016-08-04 19:14:39 -04:00
Clonkonaut 34af29fd7b Show quick slot item on clonk.
All GetCarry* callbacks receive a parameter whether they are held in this slot and can then return a different display mode!

I also took the opportunity to restructure many scripts in a similar way.
2016-08-05 01:14:13 +02:00
Clonkonaut 70b124c9d4 Added carry mode CARRY_Sword. Similar to CARRY_Belt but attached to a bone which doesn't move while running. 2016-08-05 01:08:03 +02:00
Sven Eberhardt 68700408ad Add max energy and max contents count settings to PlayerStart object
Values are used for all starting clonks and all clonks created later in the game for this player (e.g. respawns) after spawning from the spawn point with these settings.
2016-08-04 10:48:40 -04:00
Clonkonaut 4bd48242cf Fixed CarrySpear animation.
I deserialised the skeleton file and removed some bone positions that I guess were wrongfully included because they concerned the left (non-carrying) arm. I think I didn't break anything but if so, this patch is to be reverted.
2016-08-04 16:18:26 +02:00
Clonkonaut 74636c11a6 Added CARRY_Belt as a new carrying method for items. 2016-08-04 15:56:44 +02:00
Sven Eberhardt 729489e40d Add user action: Set clonk inventory size 2016-08-03 23:50:35 -04:00
Sven Eberhardt 71b337fd59 Add SetMaxContentsCount function to inventory library
Makes sure the inventory buttons and hands are updated.
2016-08-03 23:50:34 -04:00
Lukas Werling b7359e0c27 Remove the GTK platform (USE_GTK)
The GTK code does not work with the Qt editor. The simpler SDL2 platform
does, so we have little reason to keep the GTK code.

Note that GTK is still a dependency for mape.

Discussion: http://forum.openclonk.org/topic_show.pl?tid=3328
2016-08-03 16:25:46 +02:00
Clonkonaut d1382f7244 Fixed inventory slot selection. 2016-08-02 23:59:15 +02:00
Clonkonaut 36e2e1ab3e Switch inventory slots by pressing number key (hold) + number key.
This can be used to sort the inventory according to personal liking!
2016-08-02 18:39:13 +02:00
Clonkonaut 89be1da072 Changed quick switch slot selection to Number + Q.
As suggested by Zapper in this posting: http://forum.openclonk.org/topic_show.pl?pid=31073#pid31073.
This way is probably the only way item usage will ever work on Q. For now, this reverses the previous changes. Q will again react on key down.
2016-08-02 17:49:34 +02:00
Sven Eberhardt c12c51b44d Update sequence editor prop priorities and name 2016-08-02 01:12:09 -04:00
Sven Eberhardt 24a5dc33db Qt editor: Sort properties in property list by localized name and priority 2016-08-02 01:12:08 -04:00
Sven Eberhardt 1d566ec6c5 Add VIS_Editor visibility flag 2016-08-02 01:12:08 -04:00
Clonkonaut faf3add7e7 Quick Switch slot is now selectable using Q + number key.
This makes a very fundamental change with quick switch: The switching action is now performed on the key release instead of the key press. Let's see if this performs badly for players.
2016-08-02 00:37:40 +02:00
Clonkonaut 2713462cd2 Show quick switch key above quick switch item slot in HUD.
This will prepare the quick switch system according to Maikel's suggestion (http://forum.openclonk.org/topic_show.pl?pid=31070). The highlighting method is open to discussion. Currently, font colour and style are similar to the interaction key above the action bar icon. But it is very well possible that this will look bad when the key name is very long.
2016-08-01 17:14:34 +02:00
Lukas Werling 582c82c159 Qt editor/Linux: Fix crash on player removal
See 69fff71abf
2016-08-01 13:54:35 +02:00
Sven Eberhardt e5f2e4e58a Fix StdBuf::Compare with iAt>0
This caused the clonk to sometimes walk in the air when jumping.
2016-08-01 00:37:19 -04:00
Sven Eberhardt 69fff71abf Qt editor: Fix crash on player removal 2016-07-31 23:22:09 -04:00
Sven Eberhardt 2d806772dd Add user action evaluators: Owner of object, controller of object 2016-07-31 22:57:34 -04:00
Sven Eberhardt 2f4ffa0a0c Add user action evaluators: Player wealth, clonk energy, object mass, object speed 2016-07-31 22:23:52 -04:00
Sven Eberhardt bf35f92228 Add arithmetic user action evaluators (+-*/%) 2016-07-31 21:31:53 -04:00
Clonkonaut 8966df8310 Grapple bow: Show hook in extra slot (#1768).
This will give you visible feedback if the hook is fired or not. Perfect for dual hook handling situations. Library_HasExtraSlot is used to show this but IsContainer returns false. This will prevent hook extraction using the interaction menu. Removing the hook from the grapple bow will cause errors (this should probably be taken care of sometime).
2016-08-01 00:03:14 +02:00
Sven Eberhardt d8b488aa98 Add user actions evaluators: Object/Player count 2016-07-31 17:31:18 -04:00
Sven Eberhardt ab954f65a8 Add user action evaluators to find single objects 2016-07-31 15:36:12 -04:00
Sven Eberhardt 27f9e15042 Add user action evaluators: Find objects in area or container 2016-07-31 15:09:05 -04:00
Sven Eberhardt 8163ffac8a User action message: Fix display of empty messages 2016-07-31 10:36:56 -04:00
Sven Eberhardt e57047f26a Add user action evaluators: Logic (not, and, or, ==, !=) 2016-07-31 10:36:22 -04:00
Sven Eberhardt d1e8bc39c5 Qt Editor: Fix enum property delegate option value lookup for undefined options 2016-07-31 10:35:15 -04:00
Sven Eberhardt 102032276b Fix grouping of typed user action evaluators 2016-07-31 09:04:25 -04:00
Sven Eberhardt 368aebb547 Simplify empty string handling in user actions 2016-07-31 09:02:19 -04:00
Sven Eberhardt 099c0e0bcf Add user action: Script 2016-07-31 08:56:38 -04:00
Sven Eberhardt b1a1df8dee Add eval parameter to not pass errors 2016-07-31 08:15:54 -04:00
Sven Eberhardt 9b5c39a33f Add user action evaluator: Concatenate strings 2016-07-31 00:28:02 -04:00
Sven Eberhardt 404a578e5c Add user action: Log 2016-07-31 00:05:58 -04:00
Sven Eberhardt 04a7426e4f Add user action evaluator: Value to string 2016-07-30 23:59:09 -04:00
Sven Eberhardt de699080dc Add user action evaluator: Distance between positions 2016-07-30 23:49:45 -04:00
Sven Eberhardt 108f447b2b Dialogue user actions: Change text and options in message action to use evaluators 2016-07-30 23:00:18 -04:00
Sven Eberhardt f12c6dc3e7 Add user action variables 2016-07-30 22:39:22 -04:00
Sven Eberhardt 18444c7e0d Add StringToIdentifier script function
Required to sanitize variables in the editor. Works by stripping all non-identifier characters and preprending a _ if necessery.
2016-07-30 21:43:01 -04:00
Sven Eberhardt 490e92bc4e Add sequence trigger: Object enters region (rectangle or circle) 2016-07-30 19:42:55 -04:00
Sven Eberhardt 30f62f6a43 Add user action evaluator: Type of object 2016-07-30 18:00:04 -04:00
Sven Eberhardt 8bc310c52a Add user action evaluator: Object exists 2016-07-30 17:47:45 -04:00
Sven Eberhardt a01c6d4db9 Add user action comparison evaluators 2016-07-30 17:39:15 -04:00
Sven Eberhardt ea3603b991 Add user action: Cast objects 2016-07-30 16:51:57 -04:00
Sven Eberhardt 95c556bb9a Shorten some user action display names 2016-07-30 14:50:22 -04:00
Sven Eberhardt 442b8e66df Qt Editor: Add short name for enum delegate options displayed as sub-delegate 2016-07-30 14:50:07 -04:00
Sven Eberhardt 6f204d89f5 User action sound: User "Global" as name for nil sound source 2016-07-30 14:14:09 -04:00
Sven Eberhardt d55c988d2e Qt Editor: Support EmptyName enum delegate property for user-defined option lists
This can be used to clarify what happens e.g. when nil is selected in an object function delegate.
2016-07-30 14:13:23 -04:00
Sven Eberhardt 323691eeca Add user actions: Open and close doors 2016-07-30 13:21:38 -04:00
Sven Eberhardt 9522fb7e42 Add user action evaluators: Random positions and offsets in rectangle or circle 2016-07-30 12:29:35 -04:00
Sven Eberhardt b1096786d8 Add user action evaluator: Difference between two positions 2016-07-30 11:26:34 -04:00
Sven Eberhardt 95e27e6a22 Add user action evaluator: Position of object 2016-07-30 11:14:12 -04:00
Sven Eberhardt 7eee5c4832 Add user action evaluator: Random integer 2016-07-30 11:03:26 -04:00
Sven Eberhardt 8840105f6c Qt editor: Auto-dropdown child enums on creation 2016-07-30 02:37:33 -04:00
Sven Eberhardt 898aff0cc8 Add user action evaluators: Offsets and coordinate positions 2016-07-30 02:06:54 -04:00
Sven Eberhardt 7c094c3bf1 Add user action evaluator: Position (absolute and relative) 2016-07-30 01:06:21 -04:00
Sven Eberhardt affa2aebb0 Qt Editor: Add point property delegate 2016-07-30 01:05:12 -04:00
Sven Eberhardt bdea3876d6 Add user action: Remove object 2016-07-29 02:06:20 -04:00
Sven Eberhardt e19e5ce7ea Add user action: Create object 2016-07-29 01:43:35 -04:00
Sven Eberhardt 77a4916383 UserAction: Add Sound 2016-07-28 23:44:10 -04:00
Sven Eberhardt 37885a2e4f Qt Editor: Add AllowEditing flag for enum delegates.
Used for sound delegate
2016-07-28 00:24:28 -04:00
Sven Eberhardt b6fb7e884f Qt Editor: Put current selection name before EditorHelp/Description 2016-07-27 22:36:14 -04:00
Sven Eberhardt 73510d7fb1 Qt Editor: Add sound property delegate 2016-07-27 22:35:11 -04:00
Sven Eberhardt c70ee82068 Define localized help text strings for UserActions 2016-07-25 22:44:09 -04:00
Sven Eberhardt 11b317808f Qt Editor: Add toggle help button to "?" menu 2016-07-25 21:39:35 -04:00
Nicolas Hake 0cbb476daf Remove re namespace alias
This alias is a legacy from when we were using Boost.Regexp to
workaround a broken implementation in GCC's libstdc++ earlier than 4.9.
2016-07-25 18:39:44 +02:00
Nicolas Hake 5bdddff139 Remove MS CRT memory management debugging
Redefining new breaks perfectly valid code, but only on MSVC and only in
one particular configuration (Debug). This is very annoying because it
means people not using MSVC, or even people doing Release builds, can
write standards-conforming code which then may fail to build for other
people.
2016-07-25 18:39:44 +02:00
Clonkonaut 042ee8b2e5 Changed the colours of the drain and source pipes to accommodate for people with red-green color blindness (#1757).
The colours have been suggested by K-Pone.
2016-07-25 18:03:44 +02:00
Clonkonaut 56f8372a68 Skylands: fix GetComponent when called in definition context on 'small
trees' (#1781).

At some point someone might test if this breaks anything but I think it does not.
2016-07-25 17:55:53 +02:00
Clonkonaut 786b248cdf Chine: Unstuck starting clonks if necessary (#1786). 2016-07-25 17:50:38 +02:00
Clonkonaut 48b5f27f14 Fix effect removal of 'IntUpgradeProductProgressBar' when closing the interaction menu of a producer (#1796). 2016-07-25 17:42:15 +02:00
Clonkonaut b3b8e01f60 Another decorative deciduous tree by Foaly. 2016-07-25 17:26:33 +02:00
Sven Eberhardt 5f9259c27f UserAction EditorHelp props 2016-07-25 01:42:23 -04:00
Sven Eberhardt aa68c7ee16 Add description and EditorHelp for dialogue properties and actions 2016-07-25 01:24:12 -04:00
Sven Eberhardt 35a5df6c9b Revert accidental commit from master merge 2016-07-25 01:08:49 -04:00
Sven Eberhardt 4246a72485 Qt Editor: Add EditorHelp for enum options 2016-07-25 01:05:15 -04:00
Sven Eberhardt ee88a36f73 Qt Editor: Rename EditorInfo to EditorHelp
Fits better with "UsageHelp" and is more precise.
2016-07-24 23:10:43 -04:00
Sven Eberhardt 3a6a7626c1 Qt Editor: Add help hover button to editor props 2016-07-24 23:00:24 -04:00
David Dormagen 2fc3dba47e zap: added guard to prevent accessing removed object 2016-07-24 18:25:18 +02:00
David Dormagen 66263b5bc8 Chippie: removed superfluous phase call
..which led to an error ingame, because the function is not defined.
2016-07-24 18:24:45 +02:00
Sven Eberhardt f47c31749a UserActions: Split triggering clonk and object
Also fix goto.
2016-07-24 10:50:39 -04:00
Sven Eberhardt 534e4cc745 Merge branch 'master' into qteditor
Conflicts:
	src/script/C4AulParse.cpp
2016-07-24 10:23:57 -04:00
Sven Eberhardt 4245f60e83 Qt Editor: Add help/description label for current selection 2016-07-24 10:12:38 -04:00
Nicolas Hake 77c6baff3f Revert "CMakeLists.txt: Disable framework bundling because I can't deal with the emotional trauma of looking at a bash script"
This reverts commit fa8b56b40a.

This commit message was completely and utterly useless so I'm sure the
commit couldn't have been important.
2016-07-24 11:24:41 +02:00
Kanibal a7d6a7dbd7 Use file selector instead of directory selector (select Scenario.txt for unpacked workspace) to select files 2016-07-23 22:47:15 -04:00
Kanibal 1e257c4e9e Allow C4Window to be constructed from Qt Widget on macOS 2016-07-23 22:47:14 -04:00
Kanibal 1c63c8cbe0 Fix off-by-one mistake in C4Landscape assertion 2016-07-23 22:47:13 -04:00
Martin Plicht fa8b56b40a CMakeLists.txt: Disable framework bundling because I can't deal with the emotional trauma of looking at a bash script 2016-07-23 18:20:36 +02:00
Martin Plicht 78f336c67c C4ConsoleQtViewport: Un-TODO some line for now 2016-07-23 18:20:36 +02:00
Martin Plicht 5570d8d521 cmake: USE_COCOA: Remove .mm editor sources, append qt ones if WITH_QT_EDITOR 2016-07-23 18:20:35 +02:00
Martin Plicht 450619bac8 C4WindowController.mm: Only implement some viewport methods if not defined by qt editor implementation somewhere 2016-07-23 18:16:28 +02:00
Martin Plicht 2cfd743777 C4WindowMac.mm: Define some dummy K_* constants which weren't defined before for Cocoa 2016-07-23 18:16:28 +02:00
Martin Plicht 9dbe734f17 CMakeLists.txt: mac: Throw in some -headerpad_max_install_names because Xcode told me so 2016-07-23 18:16:28 +02:00
Sven Eberhardt 5bfd2b87c5 Qt Editor: Reorder array editing buttons below property action buttons 2016-07-23 02:34:08 -04:00
Sven Eberhardt 91873ca0ac Add graphics for sequence 2016-07-23 01:44:32 -04:00
Sven Eberhardt 1f3e457ec2 Qt Editor: Fix enum child delegate value setting if a Set path is defined on the parent proplist 2016-07-23 01:40:51 -04:00
Sven Eberhardt 58faf41068 Sequence: Add more triggers.
* Player enters circular region
* Game starts (after player joins)
* Player joins
* Player removed
* All goals fulfilled
* Clonk death
* Construction of structure
* Production of item
2016-07-22 01:51:29 -04:00
Sven Eberhardt 14d01cd5cd Qt Editor: Add EmptyName option for def property to rename the "nil" entry 2016-07-22 00:28:01 -04:00
Sven Eberhardt f4ea3359d0 Add InitializePlayers callback after all initial players have joined 2016-07-22 00:13:57 -04:00
Clonkonaut 21ea0ff777 Shrunk down texture sizes to 512x512. 2016-07-21 18:23:10 +02:00
Sven Eberhardt 319392a779 UserAction: Rename OptionKey from Option to Function 2016-07-21 00:47:43 -04:00
Sven Eberhardt 626719194a Add trigger+action to sequence object.
Sequences can be used to create triggered cutscenes, intros, outros, etc. in the future.
2016-07-21 00:24:55 -04:00
Sven Eberhardt 5855140cd4 UserAction: Conditions and more triggering player/object options 2016-07-21 00:24:54 -04:00
Sven Eberhardt b915ecc32a Clonk AI EditorProp using SetGlobal 2016-07-21 00:24:53 -04:00
Sven Eberhardt 4fad947980 Qt Editor: Add Set function options SetGlobal and SetRoot 2016-07-21 00:24:53 -04:00
Sven Eberhardt 16a770703a Add IsEditor script function
Returns if the host is running in editor (not adjusted in savegames).
2016-07-21 00:24:52 -04:00
Lukas Werling e06d3a89eb HotIce: Open sides at lava level (#1792) 2016-07-20 21:24:34 +02:00
Lukas Werling 513d51384f Fix nullptr -> bool conversion in return value
GCC does not like this, although both MSVC and clang accept it.
2016-07-19 17:21:23 +02:00
Sven Eberhardt 42e142b4d7 Qt Editor: Fix shape delegates as parameters to enum delegates 2016-07-18 19:24:53 -04:00
Sven Eberhardt 68358c0f87 Qt Editor: Improve display of object delegate 2016-07-14 00:45:18 -04:00
Sven Eberhardt 1151016b56 Add dialogue target editor prop 2016-07-14 00:45:00 -04:00
Sven Eberhardt d605bab0be Qt Editor: Move EditorActions from EditorAction_* to a proplist EditorAction.* 2016-07-14 00:17:53 -04:00
Sven Eberhardt 656aa303f9 Ignore SetAI(..., true) if an AI already exists
Can happen e.g. in multiplayer editing
2016-07-13 22:15:55 -04:00
Sven Eberhardt 5a9e608f55 Qt Editor: Do not show properties of dead effects 2016-07-13 22:14:28 -04:00
Sven Eberhardt 59712bcea0 Qt Editor: Fix display of effect properties 2016-07-13 22:02:18 -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 28d2172b78 Qt Editor: Move editor props from EditorProp_* to an EditorProp proplist 2016-07-13 17:18:08 -04:00
Sven Eberhardt f780a55e0f Add dialogue UserActions to enable/disable dialogue and attention marker 2016-07-13 02:17:56 -04:00
Sven Eberhardt 7a6ced04c5 UserAction: Add const object and bool evaluators 2016-07-13 02:17:12 -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 d9f31b006b Add ReplaceString script function 2016-07-13 02:12:31 -04:00
Sven Eberhardt 279d89393c SaveScenario: Correctly save object pointers within proplist 2016-07-13 01:45:29 -04:00
Sven Eberhardt dfb709df6b Qt Editor: Do not reset value to default parameter when re-selecting an already selected index 2016-07-12 23:28:51 -04:00
Sven Eberhardt 3c84f9e6f8 Qt Editor: Fix evaluation of ValueKey in enum option when changing child delegate value 2016-07-12 22:29:24 -04:00
Sven Eberhardt 097ff2c9fb Moved ConstructionSite from libraries to structures
This makes it more accessible in the editor. Otherwise, there would be "libraries/constructor" folders in the object creator with the construction site as the only contained definition.
2016-07-10 22:10:49 -04:00
Sven Eberhardt 36685a3119 Add HideInCreator=true to internal/helper/library definitions 2016-07-10 22:06:48 -04:00
Sven Eberhardt 0206e9a74a Qt Editor: Add HideInCreator DefCore setting
Hides internal definitions, libraries, etc. from the object creator in the editor.
2016-07-10 21:55:56 -04:00
Mark 3bb4e7b45f Ladder: CanNotBeClimbed callback provides the clonk
Certain ladders (in an expansion pack) should not be climbable, but this depends on the clonk that wants to climb on the ladder. Added the clonk as a second parameter to the callback, in order to not mess up the callback structure of other external packs.
2016-07-10 22:11:35 +02:00
Sven Eberhardt d3ede324be EditorBase: Publish some properties 2016-07-10 16:09:37 -04:00
Sven Eberhardt d2fd1d740e Add EditorProps to create NPC dialogues in the editor 2016-07-10 14:11:23 -04:00
Lukas Werling 2127e78db1 Fix c4script build 2016-07-07 22:50:13 +02:00
Lukas Werling 791315a54e Fix #include-in-#appendto, but discourage with a warning 2016-07-07 21:13:18 +02:00
Nicolas Hake dcd8d9676a Fix unloading scenarios with Map.c or System.ocg scripts (#1778)
Destruction order matters!
2016-07-07 14:39:18 +02:00
Nicolas Hake 4725043493 Def unload: Fix overloaded function refcount 2016-07-07 14:34:24 +02:00
Sven Eberhardt 85c5deb099 Qt Editor: Add option to auto-select objects created by an EditorAction
To be used by the dialogue so you can press a button on the clonk to add and immediately configure a dialogue.
2016-07-07 01:36:58 -04:00
Nicolas Hake 7ff8c4f95a Remove references to functions defined in unloading defs (#1776) 2016-07-06 14:41:22 +02:00
Sven Eberhardt d717e41902 Add user actions to SpinWheel up and down events 2016-07-06 01:04:45 -04:00
Sven Eberhardt d3be591d8d Add "Message" UserAction 2016-07-06 01:03:46 -04:00
Sven Eberhardt 5c6da07c51 Add UserAction scripted editor property delegates
UserActions will be used to click small dialogues and scripts directly in the editor.
2016-07-06 01:03:02 -04:00
Sven Eberhardt 990b6ea8f1 Qt Editor: Add option to descend directly into a subpath from array and sequence property delegates 2016-07-06 00:56:08 -04:00
Sven Eberhardt 8bc5e1911d Qt Editor: When descending into array delegates, use the parent name as header. 2016-07-05 23:27:55 -04:00
Sven Eberhardt 343658db96 Fix MSVC build
Not sure why this builds elsewhere.
2016-07-05 22:54:19 -04:00
Sven Eberhardt 63c9bd78e7 Qt Editor: Fix crash and prop list/array display problems when switching prop lists.
Storing the pointer in QModelIndex could sometimes keep invalid memory on the persistent model indices. Because re-organizing these memory locations would be a nightmare and we only go two levels deep anyway, just store the parent index in the internal pointer and look up the actual property on the fly.
2016-07-05 22:53:41 -04:00
Sven Eberhardt 162a7cb331 Qt Editor: Resolve child delegates when evaluating proplist delegate display value 2016-07-04 13:21:31 -04:00
Sven Eberhardt 62c1f4bda5 Qt Editor: Add callback support for dynamic enum values in Enum delegates 2016-07-04 13:21:30 -04:00
Sven Eberhardt cfca3be7e2 Qt Editor: Fix log output widget settings
Make text non-editable, etc.
2016-07-04 13:21:29 -04:00
Lukas Werling 8ab5d35550 Fix crash due to invalid QApplication arguments
It would trigger on Linux when opening menus.
2016-06-30 22:23:21 +02:00
Nicolas Hake 36aa83b128 Fix rendering on pre-3.2 hardware (#1459) 2016-06-27 13:51:56 +02:00
Nicolas Hake ad091fcfcf Fix shader code memory lifetime problem
I love StdBuf SO MUCH!
2016-06-27 12:40:35 +02:00
Nicolas Hake 9a45843828 WGL: Fall-back to a 3.1 context if 3.2 context creation fails
This is an emergency fallback for older Intel drivers on Windows, which
do not support OpenGL 3.2. As we're creating 3.2 contexts mostly to
access the Core profile, which was not available in earlier versions,
falling back to 3.1 should be fine; I don't think we're using anything
specific to 3.2.
2016-06-27 01:08:28 +02:00
Nicolas Hake cc595ec58d GL Legacy: Survive skinning meshes with no bones 2016-06-27 01:05:18 +02:00
Lukas Werling 440751691d Fix build with CMake >= 3.1.0 and Qt 5.7 2016-06-26 16:57:26 +02:00
Sven Eberhardt bc5eca903f Fix mac build 2016-06-24 20:27:53 -04:00
Sven Eberhardt 62d3817d6a Merge branch 'master' into qteditor 2016-06-24 18:23:34 -04:00
Lukas Werling 622360c359 Set default build type to RelWithDebInfo 2016-06-24 23:55:57 +02:00
Lukas Werling b771baae28 SDL: Fix missing -lX11 2016-06-24 23:41:03 +02:00
Nicolas Hake ef5b39a290 OS X: Pass CMAKE_SYSROOT through to osx_bundle_libs 2016-06-24 19:20:33 +02:00
Nicolas Hake cc8725e332 OS X: Handle 10.11 SDK .tbd files 2016-06-24 19:20:33 +02:00
Nicolas Hake 692b8a9cc5 OS X: Stop whitelisting libraries to bundle
Just bundle everything that we have available.
2016-06-24 19:20:33 +02:00
Nicolas Hake 721753b396 OS X: Query pkg-config for freetype location
Nobody remembers why we're not using pkg-config on OS X, so we'll go back
to it and see what breaks.
2016-06-24 19:20:33 +02:00
Nicolas Hake b7f1bb749b freetype: Let system module handle REQUIRED attribute
If pkg-config can't find the freetype libraries, maybe the cmake system
module can. And if it can't, then it'll still fail if REQUIRED is set.
2016-06-24 19:20:33 +02:00
Julius Michaelis 35dc23826a Add engine-resource.c to .gitignore 2016-06-23 23:37:20 +02:00
David Dormagen 6524136c9d inventory: collect directly into pushed lorry when using Shift
As suggested by Dmyst: http://forum.openclonk.org/topic_show.pl?pid=32169#pid32169
2016-06-22 09:53:52 +02:00
Sven Eberhardt 5c965aba2e Fix mape build 2016-06-22 01:47:45 -04:00
Sven Eberhardt ed368e128b Qt Editor: Ensure duplicated objects are moved to the cursor without extra mouse movement 2016-06-22 01:46:13 -04:00
Sven Eberhardt 8158cbf87c Qt Editor: Allow hotkey (F2) to duplicate selected objects.
Also reset cursor pos to center of duplicated objects to ensure they're on screen when duplicating by hotkey.
2016-06-22 01:04:14 -04:00
Sven Eberhardt b34ae09437 Fix utility builds 2016-06-21 21:48:10 -04:00
Clonkonaut c766078b50 Added a new variation of coniferous tree by Nachtfalter. 2016-06-21 19:16:40 +02:00
Clonkonaut c77ab10b55 Added an additional guidepost, a decorative object by Nachtfalter. 2016-06-21 19:15:57 +02:00
Clonkonaut fd98ed3246 Fixed dimensions of coniferous burned 3. 2016-06-21 19:14:54 +02:00
Clonkonaut 72c4a55d78 Added texture to Sproutberry Bush, by Pyrit. 2016-06-21 19:14:23 +02:00
Sven Eberhardt a7aa89f168 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c
	src/platform/C4WindowSDL.cpp
	src/script/C4AulParse.cpp
	src/script/C4Effect.cpp
2016-06-20 22:27:03 -04:00
Sven Eberhardt 9d9db0d9d5 Qt Editor: Fix grouped item selection in enum property delegate 2016-06-20 19:48:02 -04:00
Sven Eberhardt e97491940f Qt Editor: Fix possible crash if am object is deleted while the object selection delegate combo box is open 2016-06-20 19:13:50 -04:00
Sven Eberhardt 068004d9af Remove unused variable in C4AulExec 2016-06-20 15:50:36 -04:00
Sven Eberhardt b6526d2f65 Qt Editor: Always duplicate contents with objects
Even if they are not selected, this is probably what the user expects.
2016-06-20 15:50:35 -04:00
Lukas Werling 302fa5e362 Qt Editor: Make main loop calls more efficient 2016-06-20 16:56:20 +02:00
Lukas Werling fc10992ab7 Fix crash when starting a game in fullscreen mode 2016-06-20 16:55:23 +02:00
Lukas Werling b853f99b28 Fix -Wc++11-narrowing error in clang 2016-06-20 16:08:37 +02: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 c6e4bfd585 Aul: Add DirectExec method for executing a complete function definition. 2016-06-20 01:37:04 -04:00
Sven Eberhardt e7be7d6acd Qt Editor: Add viewport context menu 2016-06-19 22:45:12 -04:00
David Dormagen 890c430a17 controls: allow to put items into pushed containers via [throw]
as requested by Dmyst here http://forum.openclonk.org/topic_show.pl?pid=32082#pid32082
2016-06-19 20:23:29 +02:00
Nicolas Hake e490428f29 Win32: Drastically improve load times with unpacked planet/
C4Group::SearchNextEntry would waste lots of cycles looking up file
attributes that were never inspected afterwards. Since all we want is
the file size, and we already get that for free from FindFirstFile and
FindNextFile, store it with the directory iterator instead of querying
it at every iteration.

This reduces load times on my machine by almost half, tested across
several different scenarios.
2016-06-19 17:08:50 +02:00
Tobias Zwick 0ad8e15c8a in the documentation, always have "docs" preselected in the search shown in the header 2016-06-19 17:00:18 +02:00
Nicolas Hake e9c5facf91 GL: Disable hardware-based skinning on old Intel devices
Our hardware-based skinning doesn't work on certain Intel graphics
devices. Fall back to software skinning on GPUs that return an OpenGL
3.1 context even though we explicitly request a 3.2 one.

Might fix #1459, #1689.
2016-06-19 13:45:12 +02:00
Nicolas Hake 9555bf737f GL: Bail earlier when encountering degenerate matrices 2016-06-19 11:22:04 +02:00
Sven Eberhardt 7d43d364d0 Add StoneDoor EditorActions to open/close door
Replacing the old EditCursorCommands.
2016-06-19 00:09:37 -04:00
Sven Eberhardt 34289fa18a Qt Editor: Add EditorActions.
Replacing the old EditCursorCommands (which nobody knew). Objects now publish their commands directly on the property viewer.
2016-06-19 00:08:09 -04:00
Clonkonaut ecc386e6e7 Fix Dark Castle goal description (#1667). 2016-06-19 00:18:58 +02:00
Clonkonaut ff92f958ac A different brick texture by Matthi. 2016-06-19 00:10:27 +02:00
Clonkonaut 3637e1f072 Fix the clonk sometimes stuck in infinite jump animation when actually scaling with one vertex. 2016-06-18 19:47:39 +02:00
Clonkonaut 5d2ae6a251 Fixed normal map for brick and brickback textures, by Tarte. 2016-06-18 19:47:04 +02:00
Clonkonaut b6ca10d11a Constructor library: Changed to search through all available knowledge and filter using an overloadable function.
The hammer will now only construct definitions that have the callback "IsHammerBuidable". This will exclude all C4D_Structure objects that are not buildings and can't be build in a meaningful way.
Also, with the carry heavy branch I want to test adhoc built lorries (lorries as construction sites). Sven suggested this.
2016-06-18 19:45:45 +02:00
Lukas Werling 19395b23ae Fix SetMatAdjust() (for kenny) 2016-06-18 17:17:43 +02:00
Sven Eberhardt 6aa926bffa Add Clonk EditorProp to set skin 2016-06-18 10:46:19 -04:00
Sven Eberhardt af3e3bb6c8 Add EditorProps for EnemyAI effect
Also remove old object-based editor controls.
2016-06-18 10:45:06 -04:00
Sven Eberhardt 08b7980d69 Qt Editor: Fix shape relative default 2016-06-18 10:43:00 -04:00
Sven Eberhardt a598dee4e1 Qt Editor: Fix shape delegate parent object when delegate is provided by an effect 2016-06-18 10:41:15 -04:00
Sven Eberhardt 0162b4b21f Qt Editor: Make Relative=true the default for shape delegates.
It should be by far the more common setting.
2016-06-18 10:40:24 -04:00
Sven Eberhardt a7bd20a927 Fix server and utility build
Adding missing C4DefList::SortByPriority() stub
2016-06-18 10:35:54 -04:00
Sven Eberhardt 1b785da271 Fix non-Qt build 2016-06-18 10:33:08 -04:00
Sven Eberhardt 25fa57cabf Qt Editor: Add "Static Flat" landscape mode 2016-06-17 18:44:59 -04:00
Sven Eberhardt ec6998e530 Qt Editor: Fix some crashes and errors when switching between object and definition selection 2016-06-17 01:26:38 -04:00
Sven Eberhardt 2e412d1668 Qt Editor: Fix log output position 2016-06-17 00:56:23 -04:00
Sven Eberhardt b70882d7fa Editor: Object scaling+rotation 2016-06-17 00:07:49 -04:00
Sven Eberhardt bd516dfc44 Add ItemSpawn EditorProps 2016-06-16 16:57:34 -04:00
Sven Eberhardt f6acefa882 Add SpinWheel EditorProps 2016-06-16 16:57:13 -04:00
Sven Eberhardt 4e603e2ef8 Add "Name" EditorProp for all objects 2016-06-16 16:15:42 -04:00
Sven Eberhardt f913b4d012 Qt Editor: Highlight objects hovered in object selection delegate in viewport 2016-06-16 16:15:15 -04:00
Sven Eberhardt 2f22a3a8fe Qt Editor: Add property delegate type "object" 2016-06-16 14:59:04 -04:00
Sven Eberhardt 9e4f036fe2 Qt Editor: Focus across columns in property editor 2016-06-16 13:19:35 -04:00
Sven Eberhardt a52857d073 qt editor: Add string delegate 2016-06-16 00:40:25 -04:00
Sven Eberhardt 2df6fdb52b qt editor: Improve grouped enum tree navigation 2016-06-16 00:09:53 -04:00
Sven Eberhardt e5837dc478 Qt Editor: Use definition grouping on "def" property delegate enum 2016-06-15 21:57:59 -04:00
Sven Eberhardt ad863836b3 Qt Editor: Add groups to enum 2016-06-15 00:15:47 -04:00
Maikel de Vries 3620e22061 fix launching of javelins
Bug was introduced when TakeObject changed.
2016-06-12 11:39:11 +02:00
Lukas Werling 6b958fe88e Fix viewports on high-DPI screens 2016-06-11 22:36:48 +02:00
Lukas Werling 60671474a8 Use Qt's event loop instead of polling for events
This fixes slow input event handling execution on Linux. Additionally,
it seems to fix some crashes with the menu bar.
2016-06-11 21:52:50 +02:00
Maikel de Vries c538a0d617 add missing neutral pipe interaction menu tooltips for liquid tank 2016-06-11 20:57:06 +02:00
Sven Eberhardt 0767fd2616 Qt Editor: Auto-add PlayerStart object to scenarios created via "New..." option. 2016-06-08 22:27:32 -04:00
Sven Eberhardt 923789ec49 Add PlayerStart object.
This is an easy-to-use object for the editor which replaces Scenario.txt [PlayerX] settings.
2016-06-08 22:15:56 -04:00
Sven Eberhardt 0bb910814d Qt Editor: Fix display and control of enum delegate parameters 2016-06-08 00:37:48 -04:00
Sven Eberhardt 5e4e6c9f7c Remove a debug log 2016-06-07 19:08:15 -04:00
Sven Eberhardt 96068b9a17 Initialize EditorBase definition with higher priority.
Many other definitions may depend on it being initialized and it would be verbose and error-prone to add a check to every single dependent definition.
2016-06-07 18:23:53 -04:00
Sven Eberhardt 397dbd867a Add DefinitionPriority property to control call order of Definition()-callbacks. 2016-06-07 18:22:43 -04:00
Sven Eberhardt c4dfd5e276 Add EditorProp for construction goal 2016-06-07 00:13:35 -04:00
Sven Eberhardt 3797b07f29 Add IDList EditorProp. 2016-06-07 00:13:01 -04:00
Sven Eberhardt f44cb9fa62 Qt Editor: Fix script errors on empty selection 2016-06-06 23:26:20 -04:00
Sven Eberhardt 16e31098b4 Qt Editor: Improve proplist and array display/editing
* Add/Remove element buttons
* Display customization of user delegates
2016-06-06 01:54:05 -04:00
Nicolas Hake 49a98e54a5 Add test for 57a35bf fix
So it turns out that the fix stops the engine from crashing, but it
still doesn't seem to generate valid code - Aul emits an internal error
at runtime.
2016-06-05 13:36:32 +02:00
Mark d51a8cfa6d Liquds: Liquids can be passed either as a string or as a definition 2016-06-05 12:05:48 +02:00
Mark 923ee485ec Liquid container: PutLiquid(*, nil, *) inserts maximum amount of liquid
Added unit test.
2016-06-05 12:05:42 +02:00
Sven Eberhardt 4d04135cda Fix GetPropertyBool default value when descending into prototype [Guenther] 2016-06-03 20:17:20 -04:00
Lukas Werling 6bd26b047f Fix typo 2016-06-03 23:18:44 +02:00
Lukas Werling 4920ed743f UPnP: Another try for Debian compatibility 2016-06-03 22:16:39 +02:00
Maikel de Vries 695680cb6c objects on fire inflame inflammable materials 2016-06-03 22:08:14 +02:00
Maikel de Vries 548215d448 make flames consume oil when burning 2016-06-03 22:08:14 +02:00
Lukas Werling 91e2c137d9 UPnP: Fix compatibility with Debian's old versions 2016-06-03 21:58:19 +02:00
Lukas Werling 55c52a69a5 Merge branch 'miniupnpc' (GH-23) 2016-06-03 17:21:20 +02:00
Sven Eberhardt b10da0629d Qt Editor: More EditorProps types (string, array) and attributes (EditOnSelection, DefaultEditorProp) 2016-06-03 01:20:43 -04:00
Maikel de Vries bb33abee2f foundry accepts water for loam production and has max liquid amount 2016-06-02 13:04:02 +02:00
Maikel de Vries e004006fdc add descriptions to liquid objects 2016-06-02 13:02:25 +02:00
Mark e1413a941d Producer: Commented out log output
This was there for debugging purposes only.
2016-06-01 20:42:03 +02:00
Mark 98dc6fa252 Fix Bug #1742
Fixed and tested other problems in tutorial 3 and 4, too
2016-06-01 20:40:26 +02:00
Mark 46ac671ef4 Fixed producers unit test #6
The problems here were:
- the syntax for GetComponent() was wrong.
2016-06-01 20:14:11 +02:00
Mark 10c918d4a2 Fixed producers unit test #5
The problems here were:
- the pickaxe component list returned [[Metal, 1], [Wood, 1]] instead of [[Wood, 1], [Metal, 1]]. This may be a result of the new component system with proplists; probably the components are sorted alphabetically now
2016-06-01 20:08:55 +02:00
Mark ffcbdc7fd0 Fixed producers unit test #7
The problems here were:
- the foundry cannot take 400 water from ice if it has a fill limit
- the pump cannot pump anything into the object if it has no fill limit
2016-06-01 19:10:46 +02:00
Mark ad74d44943 Foundry can be fueled by pipe.
A pipe from a pump can be connected to a foundry now, so that oil can be pumped into the foundry.
2016-06-01 19:10:42 +02:00
Nicolas Hake 2a59ece97c Merge pull request GH #22
Add OpenClonk to StrategyGame and ArcadeGame categories.
2016-06-01 10:40:12 +02:00
Lukas Werling b1b72b003a Do Linux UPnP mappings asynchronously 2016-05-31 18:23:41 +02:00
David Dormagen 092b012430 chest: stay open when empty (#1699)
This is debatable. Let's see how this feels ingame and revert it in case we don't like it.
I like it because I think it gives valuable feedback to the players (and thus can reduce frustration coming from unnecessary actions). But it might also feel like a bug to players.
2016-05-30 10:19:49 +02:00
David Dormagen 6696ee679c carry heavy: do not prevent scrolling through inventory (#1738) 2016-05-30 09:57:39 +02:00
David Dormagen 58bb6af75a barrel: prevent entrance of arbitrary objects
You could put e.g. tools into the barrel using the interaction menu. This would lead to a script error later, when the barrel did Contents()->GetLiquidType().
PS: And the RejectStack function is part of a private internal interface. I made that clear so the next one does not have to look it up again.
2016-05-30 09:56:39 +02:00
Lukas Werling dbaaec268a Change C4Network2UPnPP forward declaration to class 2016-05-29 23:39:10 +02:00
Lukas Werling 07e8c75bac Replace libupnp with miniupnpc
- The new code works with my router while libupnp didn't. :)

 - There are some unexplainable crashes in libupnp: #1640

 - Using miniupnpc seems to be less complex than libupnp.

 - Apparently, miniupnpc also works on Windows, so we may be able to use
   it for all platforms.

Disadvantage: UPnP queries aren't asynchronous anymore, but they seem to
be pretty fast (< 1 s).
2016-05-29 23:38:12 +02:00
Philipp Kern 672c5d3b9b Add OpenClonk to StrategyGame and ArcadeGame categories. 2016-05-29 09:39:17 +02:00
David Dormagen acde7c923a fix possible crash on cleaning up particles
It could happen that the objects were cleared (after evaluation screen / on section change) but a particle list would remain that would still point to an object (and would then access it).
I am not exactly sure how that could happen, because objects should clear their particle lists on removal (and thus shouldn't really need a ClearPointers).
There is a tiny chance that this points to another bug somewhere in the object removal - that's just a random guess though.

Anyway, this should fix the infamous Knüppeln crash.
2016-05-28 23:22:33 +02:00
Sven Eberhardt af2a74b6ec Qt Editor: Array editing 2016-05-28 09:30:54 -04:00
David Dormagen 2df2946016 OnInIncendiaryMaterial: check for object removal after energy loss 2016-05-27 22:19:41 +02:00
Sven Eberhardt d304b17028 Qt Editor: Editing of child proplists 2016-05-24 23:06:00 -04:00
Günther Brammer 57a35bf01b Don't crash on functions declared inside other functions
Declaring a local variable inside any function works the same way as
declaring it in top-level scope, which gets a bit weird if done inside a
function inside a constant proplist, but is at least consistent.

Thanks to Flinti for reporting this.
2016-05-25 01:06:10 +02:00
Sven Eberhardt 8a5dbdc73f Qt Editor: More shape prop storage options 2016-05-23 19:22:49 -04:00
Sven Eberhardt 747077b71b Qt Editor: Fix effect properties 2016-05-23 19:22:05 -04:00
Lukas Werling a71ca69f1d Make ingame mouse cursor size configurable
On High-DPI displays, the mouse cursor is very tiny. We'll probably want
some high-resolution cursor graphics at some point, but the current ones
scale good enough.
2016-05-23 21:14:03 +02:00
Lukas Werling 435fe98b71 SDL: Handle key repeats 2016-05-22 23:27:57 +02:00
Maikel de Vries fb60bf41b8 remove spurious comment in flagpole script 2016-05-21 13:34:35 +02:00
Maikel de Vries 3455fa24f9 add some variation to the maximum size of trees 2016-05-21 13:34:34 +02:00
Maikel de Vries 18f2b4831a add max size option to StartGrowth 2016-05-21 13:34:34 +02:00
Maikel de Vries e92e7a2e2c fix producer components call after liquid_container branch merge 2016-05-21 13:34:34 +02:00
Maikel de Vries 6c8c4c9c19 allow more components than def for Oversize objects 2016-05-21 13:34:34 +02:00
Maikel de Vries 2a731b2545 implement Components as a property lookup table 2016-05-21 13:34:34 +02:00
Maikel de Vries 62ad9eb53b reimplement components scaling with object completion 2016-05-21 13:34:34 +02:00
Maikel de Vries a81ccaab22 add function to make properties writable
Thanks to Guenther for the implementation details, documentation will follow when it is considered a stable solution.
2016-05-21 13:34:34 +02:00
Maikel de Vries 8291298af1 add script callback on completion change 2016-05-21 13:34:34 +02:00
Maikel de Vries 6794b3b630 remove object component functionality from the engine 2016-05-21 13:34:34 +02:00
Maikel de Vries 1df322b7ff adapt objects and scenarios to new component implementation 2016-05-21 13:34:34 +02:00
Maikel de Vries 4833f839d2 script implementation of GetComponent and SetComponent
This allows to remove the engine functionality and is based on the property Components = [[def1, amount1], [def2, amount2], ...]. Follow up commits will remove the engine functionality.
2016-05-21 13:34:33 +02:00
Maikel de Vries c40edd3fbd remove duplicate moss object in Experimental.ocd 2016-05-21 13:34:33 +02:00
Maikel de Vries accd897b91 rename NoComponentMass to NoMassFromContents
This had nothing to with components, and risk of backwards compatibility is minor.
2016-05-21 13:34:33 +02:00
Maikel de Vries 00d5a06ec0 remove option to display components in old style menus 2016-05-21 13:34:33 +02:00
Maikel de Vries dff30d60f5 removed undefined constants C4MN_Extra_MagicValue and C4MN_Extra_MagicValue from docs 2016-05-21 13:34:33 +02:00
Maikel de Vries fcd3678748 remove unused function ComponentAll 2016-05-21 13:34:33 +02:00
Maikel de Vries 183ab4c4a0 remove unused function ComposeContents 2016-05-21 13:34:33 +02:00
Maikel de Vries 5841b55f7e remove unused function GetNeededMatStr 2016-05-21 13:34:33 +02:00
David Dormagen c820dac7c3 classic menu style: only show count if applicable
Otherwise, it would show "0x" for stuff where the count did not matter.
2016-05-21 13:19:49 +02:00
Nicolas Hake 3fd1187833 Don't overload CompileNewFunc with rvalue reference parameters
We don't need to pass the C4ValueNumbers* as a rvalue reference, and
doing so needs const qualifiers on MSVC.
2016-05-21 12:56:57 +02:00
Günther Brammer 5941fdc391 docs: Update de.po with the current english texts 2016-05-16 18:50:32 +02:00
Günther Brammer d23ffde361 Merge script branch 2016-05-15 19:21:26 +02:00
Günther Brammer 6763f2b5c7 Silence complaints about missing functions in EffectCall (#1736)
All the other effect callbacks silently ignored missing functions, either
by using the Call variant that doesn't complain about it, or checking for
the missing function themselves.
2016-05-15 19:20:43 +02:00
Günther Brammer ef515cc3c7 Script: Prototypes for CreateEffect should inherit from Effect
This makes the special effect properties useable without the "this." prefix,
makes the various useful global functions available as well as
effect-specific functions.
2016-05-15 15:22:42 +02:00
Günther Brammer a12b5e5ad7 docs: Enable navigation to cells in a table 2016-05-15 15:20:08 +02:00
Günther Brammer a4680868d8 docs: Scroll to the desired position in the page when navigating 2016-05-15 15:20:08 +02:00
Günther Brammer 0559a93f88 Script: CreateEffect effects do not get their target in callbacks
They can use the Target property instead.
2016-05-15 15:20:08 +02:00
Günther Brammer 3aa6978c4e Script: Effects have their target as a property "Target" 2016-05-15 15:17:18 +02:00
Günther Brammer c0d32f8f4e Remove redundant target parameters from effect implementation 2016-05-15 15:17:17 +02:00
Günther Brammer 6aaf7cd2ef Store a pointer to the effect target in the effect itself 2016-05-15 15:17:17 +02:00
Günther Brammer 3e5d982475 Allow modifications to Scenario local vars from /script 2016-05-15 15:17:17 +02:00
Günther Brammer 408ac90cd7 Scenario effects: Use Scenario and not Scenario->GetPrototype() as this() 2016-05-15 15:17:17 +02:00
Günther Brammer f927717458 CreateEffect initializes the name of the new effect
Effects with prototypes were supposed to inherit their names from the
prototype, but the effect prototypes are also supposed to get their names
from ParentKeyName, which is not inherited. Maybe that'll change, but for
now this matches how old effects work.
2016-05-15 15:17:17 +02:00
Günther Brammer 5c6a805fd5 Add move constructor to C4Value 2016-05-15 15:17:17 +02:00
Günther Brammer c2edd9b6fd Add noexcept to the Std*Buf move constructors
Apparently this is recommended so that a std::vector actually uses the
move constructor. In any case, the second parameter wasn't used, so this is
a nice simplification as well.
2016-05-15 15:17:16 +02:00
Günther Brammer 9e8d644a26 StdAdaptors: Make mkParAdapt(mkPtrAdaptNoNull(), Par1, Par2) work
Employ variadic template arguments and more rvalue references for this.
Sadly, StdParameterAdapt itself is even more complicated, since it has to
store the parameters instead of just forwarding them, so the limit is still
two parameters. But that's twice as much as before in many cases.
2016-05-14 22:59:59 +02:00
Nicolas Hake 8e18a3fc96 Change (int)0 to nil where deprecated 2016-05-13 17:13:34 +02:00
Nicolas Hake 511e3bbb36 Aul: Deprecate implicit conversion from 0 to object/proplist/def/string
Instead of (int)0, nil should be used to signify "no object" etc.
2016-05-13 16:28:45 +02:00
Nicolas Hake 370a1dd3d1 Aul: Re-enable parameter type checking after AST rewrite 2016-05-13 16:22:37 +02:00
Nicolas Hake 3217fbf55b C4AulScriptFunc::AddPar: Accept type in addition to name
This way, we don't have to first add the parameter and then set the type
afterwards via internal members.
2016-05-13 16:22:00 +02:00
Nicolas Hake eca8f2cce8 Aul: && returns either parameter, not bool 2016-05-13 16:20:17 +02:00
Nicolas Hake 43c6f946dd Aul: Split assignment op from standard BinOp
Assignment was special-cased everywhere, so it can just as well get a
separate AST node.
2016-05-13 13:50:29 +02:00
Nicolas Hake daf3424e63 Delete some commented-out legacy function parameters 2016-05-13 13:14:23 +02:00
Nicolas Hake 092a23c2f7 Aul: Parse scripts into an AST, then generate bytecode from that
This commit contains a fairly substantial rewrite of the C4Script code
generator. Instead of generating bytecode while parsing the script,
we're now parsing the script into a syntax tree, and have any further
processing happen on that instead of the raw source.

At this time, the code generator emits the same bytecode as the old
parser; there are several optimization opportunities that arise from the
new possibility to emit code out of order from its specification by the
author.

Compared to the old compiler, this one is still rather deficient when
dealing with incorrect code; it's also not emitting several warnings
that used to be diagnosed.
2016-05-12 19:43:48 +02:00
Nicolas Hake 78e5f8528d C4PropList::GetParent: make const 2016-05-12 18:47:53 +02:00
Nicolas Hake be2fdaaae3 C4Particles: Fix build with MSVC memory tracing 2016-05-12 18:47:52 +02:00
David Dormagen 771bd802f0 particles: re-added missing intialization of ibo_size
Thanks to ck, who noticed. Apparently it got lost when reverting some changes back and forth for testing, because I had one revision where I didn't need it anymore but I reverted most of that.
2016-05-12 10:03:02 +02:00
Nicolas Hake 13e02bb418 C4Random: Fix build with MSVC memory tracing 2016-05-11 17:15:47 +02:00
Nicolas Hake 5872b5e8ae C4AulFunc::GetFullName: make const 2016-05-11 17:15:47 +02:00
Nicolas Hake 10abb1bbdb Remove unused C4AUL_CodeBufSize 2016-05-11 17:15:47 +02:00
Nicolas Hake a100b93e7f DEBUG_BYTECODE_DUMP: Allow setting from build system 2016-05-11 17:15:47 +02:00
Nicolas Hake 16641d3841 C4AulScriptFunc::DumpByteCode: properly align BCC names
The old code just appended eight spaces when the type of the BCC was
shorter than eight chars.
2016-05-11 17:15:47 +02:00
David Dormagen a20b7834c0 OneMillionParticles.ocs: removed some randomness in the amount of particles in the final test
It's easier to compare runs this way.
2016-05-10 22:29:30 +02:00
David Dormagen 6bacdfcbb6 particles: fixed some particles not rendering under certain conditions
Some particles were visibly missing. The reason was apparently that the VAO was initialized with an IBO that was yet too small (because not all particles were created yet).
To be honest, I don't know why the IBO needs to be rebound as the identifier itself does not change(?) but maybe OpenGL optimizes some stuff and needs the size fixed?

Steps to reproduce: In OneMillionParticles.ocs, make Test3 be the first test (otherwise the IBO would have been large enough). You would now not see all of the fireworks.

The issue was introduced in e13cda4bd0
2016-05-10 22:26:34 +02:00
David Dormagen 29333ef87a particles: initialize primitive restart index IBO lazily
Otherwise the IBO is created from scratch for every particle that is e.g. created in a for loop. This is extremely slow and unnecessary.
The symptoms was that OneMillionParticles appeared to 'freeze' on the non-batch creation test. (Hint: it didn't freeze, it just took forever).
2016-05-10 21:46:32 +02:00
Nicolas Hake 26334cb4d7 Aul: Join AB_INT + AB_Neg 2016-05-09 12:33:59 +02:00
Nicolas Hake 34556e3e81 Aul: Join AB_STRING+AB_ARRAYA to AB_PROP 2016-05-09 12:33:58 +02:00
Nicolas Hake f2bf34ff3e Add missing semicolons to CreateEffect tests 2016-05-09 12:33:56 +02:00
Nicolas Hake 33f7fb935f C4AulCompiler: Rename iStack to stack_height 2016-05-09 12:33:51 +02:00
Nicolas Hake 41000a8f9a C4AulCompiler: Rename pLoopStack to active_loops 2016-05-09 12:21:33 +02:00
Nicolas Hake d0dbe05876 C4AulCompiler: Rename fJump to at_jump_target
You have no idea how much I hate systems hungarian.
2016-05-09 12:21:33 +02:00
Nicolas Hake f0b4ef46a5 GetStackValue: Remove "default: /* unreachable */"
Without an explicit default case, the compiler can warn about unhandled
enum values inside the switch.
2016-05-09 12:21:33 +02:00
Nicolas Hake 7a135a060f C4AulParse: Take GetTokenName out of public interface 2016-05-09 12:21:33 +02:00
Nicolas Hake 0a3b31e735 C4AulParse::AddVarAccess: Move to C4AulCompiler 2016-05-09 12:21:33 +02:00
Nicolas Hake 0342711cd4 C4AulCompiler: Take GetStackValue out of public interface 2016-05-09 12:21:33 +02:00
Nicolas Hake 792e12adad C4AulCompiler: Split into separate file 2016-05-09 12:21:33 +02:00
Nicolas Hake c8d71d47c0 C4CodeGen: Rename to C4AulCompiler
I need to split up C4CodeGen into smaller parts, and having the bit that
actually generates the bytecode named C4CodeGenCodeGen would be silly.
2016-05-09 12:21:33 +02:00
Nicolas Hake 86729ea536 Declare C4AulBCC as class instead of struct
The C++ standard says that it doesn't matter whether you forward declare
something as struct or class and then define it using the other keyword.
Unfortunately MSVC adds those keywords to its name mangling scheme,
which breaks things.
2016-05-09 12:21:33 +02:00
Lukas Werling 042e3c9602 SDL: Fix crash when opening resolution selector 2016-05-07 22:03:25 +02:00
Lukas Werling 9fa16c5e14 SDL: Enable multisampling
Unfortunately, there doesn't seem to be an easy way to apply
multisampling changes in SDL. As a workaround, a message requesting the
player to restart the game is shown.
2016-05-07 12:25:11 +02:00
Lukas Werling 1919d81f9d SDL: Implement FlashWindow for X11 2016-05-07 00:33:26 +02:00
Julius Michaelis 30bb12164b gtk_window_set_urgency_hint 2016-05-05 22:20:52 +02:00
Günther Brammer 69427a484a C4AulParse: Check for function names after '->' with the helper function 2016-05-05 02:47:17 +02:00
Günther Brammer 994cb52cea C4AulParse: Don't escape spaces in bytecode dumps of strings 2016-05-05 02:38:36 +02:00
Günther Brammer 99f704fbb8 Script: Prevent writes to constant arrays 2016-05-05 02:10:41 +02:00
Günther Brammer 06b5f0e5ce convert_cr_to_oc: Don't bother writing out empty Script.c 2016-05-03 02:13:14 +02:00
kpone33 77e5fb7acf Added Offshore to Music.ocg 2016-05-01 20:06:07 +02:00
Lukas Werling c9aa07ee60 Add more documentation for Mod() (#1735) 2016-05-01 19:52:22 +02:00
Mark 4f9d8afa93 Merge branch 'liquid_container'
Added liquid objects for acid, lava, water and the new material oil. Expanded power system unit test and added some more unit tests for the producer system and liquid containers.
2016-05-01 19:44:33 +02:00
Mark 7d5d97b0d6 Merge remote-tracking branch 'origin/master' into liquid_container 2016-05-01 19:43:10 +02:00
Lukas Werling dd48a759d7 Add mathematical modulo helper function Mod(a, b) 2016-05-01 19:25:12 +02:00
Lukas Werling 60e9383a42 Improve seeding of UnsyncedRandomRng 2016-05-01 19:21:09 +02:00
Mark b96b183007 Merge 'master' into liquid_container 2016-05-01 18:54:38 +02:00
Maikel de Vries 3907281933 fix script error when striking sword (#1731) 2016-05-01 16:54:05 +02:00
Mark 853af2c155 Merge 'master' into liquid_container 2016-05-01 08:43:05 +02:00
Günther Brammer 9741af42fd Replace all usages of the old local variables list with properties 2016-05-01 00:28:37 +02:00
Günther Brammer 7792acdff0 Script: Check for functions before keywords
This unifies the lookup for local variables and functions. Its slightly
awkward that global functions can overload if and Par now, but local
variables already could.
2016-05-01 00:28:37 +02:00
Günther Brammer 30f7457d89 Remove unused macros leftover from removed script features 2016-05-01 00:28:37 +02:00
Günther Brammer b8f2d0ca87 Script: Repeat the parser error message when executing a broken function 2016-05-01 00:28:37 +02:00
Günther Brammer 17b18da26c Make bytecode dump work again
Dumping the bytecode before adding EOFN while depending on that to signal
the end isn't such a hot idea.
2016-05-01 00:28:37 +02:00
Maikel de Vries f4ae76454b rename player control callback for specified id's to silence warning
It is better to have different names for different callbacks.
2016-04-29 21:51:58 +02:00
Günther Brammer 904bf78d68 Don't crash when deserializing an effect with object command target (#1730) 2016-04-29 00:16:20 +02:00
Günther Brammer 4092911349 Move code generation into its own class 2016-04-28 03:25:47 +02:00
Günther Brammer b00b8554ab Merge branch script 2016-04-28 03:25:44 +02:00
Günther Brammer d45ac946fe Add C4AulParseError constructor and cease reusing it for warnings
The nontrivial code that formats the position is now a function of
C4AulParse used by both warnings and errors.
2016-04-28 02:59:12 +02:00
Nicolas Hake a8f4bd3960 C4AulParseError: Avoid the second string parameter
While I'm not a big fan of hiding flow control in a function, Error()
handles formatting and saves me from calling FormatString().getData() a
lot.
2016-04-28 02:59:12 +02:00
Günther Brammer 4b43576f83 Script: Complain about some attempts to Call nonexistant function again
This code got lost in the function pointer rewrite.
2016-04-28 02:59:12 +02:00
Nicolas Hake 072661239d GRBroadcast: Don't noisily fail when a callback function does not exist
Since GRBroadcast calls all goal and rule objects and the scenario,
there is a high likelyhood that not all of them implement whatever
arbitrary callback is called. Instead of throwing script errors about
calling undefined functions, just swallow that error and continue.
2016-04-28 02:59:12 +02:00
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
Maikel de Vries 08668ef988 do not reset last item for quick switch when selecting same slot twice 2016-04-27 21:15:37 +02:00
Lukas Werling 11904c0217 Fix Q doing nothing initially
Both the initial “selected” and “last” inventory slots were initialized
to 0, making Q useless. Many melees give more than one item to the
player, filling up from the first slot. Having Q switch to the second
slot initially is better than doing nothing, which will never happen
later on.
2016-04-27 19:02:54 +02:00
Sven Eberhardt 881534bee0 Qt Editor: Shape properties 2016-04-25 16:17:10 -04:00
Maikel de Vries 3f085a0532 balance grenade launcher projectiles
Decrease their mass to prevent too much damage when having a direct hit plus explosion. Also decrease the impact of the iron bomb explosion a bit to make it less overpowered.
2016-04-25 21:27:22 +02:00
Maikel de Vries f5a9412a35 clean up iron bomb and shrapnel scripts 2016-04-25 21:27:22 +02:00
Lukas Werling c349254d8b Remove C4Particles.h include from C4Object.h
This reduces the number of files indirectly including PCG from ~50 to 7.
2016-04-25 21:24:27 +02:00
Lukas Werling e33066a4f2 Rename SafeRandom() to UnsyncedRandom() 2016-04-25 17:32:23 +02:00
Lukas Werling e734f15117 Remove RNG implementation from C4Random.h 2016-04-25 17:28:04 +02:00
Lukas Werling aeabe28d82 Remove AsyncRandom() script function
We couldn't think of any reason you'd want to use this over regular
Random() in script.
2016-04-25 17:18:07 +02:00
Maikel de Vries 92334f5f4c take into account container velocity in shockwaves
This ensures reliable flint jumping when using dynamite, ironbomb, powderkeg, etc.
2016-04-24 20:33:44 +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
Nicolas Hake 19a3d43558 Fix definition of explicitly sized enums 2016-04-24 15:20:28 +02:00
Nicolas Hake baad3aef3c C4ScriptHost: add const proplist accessor
This accessor does not need to be virtual itself, because we don't want
people to override it; it calls the nonconst accessor anyway, which is
virtual.
2016-04-24 14:01:23 +02:00
Nicolas Hake 96223f154c C4ValueMapNames: mark GetItemNr const
It doesn't change anything, so callers don't need a nonconst object.
2016-04-24 14:01:23 +02:00
Nicolas Hake 607eb8e246 Aul tests: Test conditionals 2016-04-24 14:01:23 +02:00
Nicolas Hake 2eba2e72f3 Aul tests: Test parameter passing 2016-04-24 14:01:23 +02:00
Nicolas Hake 79b6d993df Aul tests: Test nested loops, loop control statements 2016-04-24 14:01:23 +02:00
Nicolas Hake d21f75829d Aul tests: stop GMock from complaining about uninteresting log calls 2016-04-24 14:01:23 +02:00
Nicolas Hake caf44e2473 Remove specious space from Aul operator table 2016-04-24 14:01:23 +02:00
Nicolas Hake 8f9cbc88f7 Update the .natvis
for nicer display of function names and Aul bytecode.
2016-04-24 14:01:23 +02:00
Nicolas Hake 770be2dafe Aul: Allow AB_ERR to carry more detailed error information 2016-04-24 14:01:23 +02:00
Nicolas Hake 367f58b1cc C4AulParseError: Enable creation from host and source pointer
Instead of having a C4AulParseError constructor read the location data
from the parse state, allow explicit construction from a known location.
2016-04-24 14:01:23 +02:00
Nicolas Hake cfdb1142b8 Move C4AulParse declaration into separate header 2016-04-24 14:01:23 +02:00
Maikel de Vries 3c267bb7dc making buying in flagpole work when flag is in non-nil object layer 2016-04-24 13:21:16 +02:00
Lukas Werling 5471fe6cff Fix randomness in particles with identical properties
Several issues:

 - The RNG wasn't copied with the value provider (which is always
   copied), resulting in unseeded RNGs.

 - Separate PCG streams with the same seed start with identical values.
   As particles often draw only a single value, we just always advance
   the RNG a bit to make the streams diverge.

 - The C++ specification requires a <= b for its distributions, but that
   wasn't guaranteed by the particle startValue/endValue.
2016-04-23 23:29:36 +02:00
Maikel de Vries cea685f7ea fix flickering wealth entries for non-first players 2016-04-23 22:20:01 +02:00
Mark 72c7e4dd87 Merge remote-tracking branch 'origin/master' into liquid_container 2016-04-23 11:10:26 +02:00
Maikel de Vries 06e8df86ca fix FacetBase typos 2016-04-22 23:27:33 +02:00
Maikel de Vries f46f38511a add function to determine if ironbomb and dynamite are fusing 2016-04-22 23:27:33 +02:00
Sven Eberhardt bc32456ac1 Fix crash on Random(0) 2016-04-22 16:44:35 -04:00
Lukas Werling b0c1d819af Reduce game list refresh limit to 1 second 2016-04-22 10:50:03 +02:00
Nicolas Hake 8e11bbfd4c Add pcg headers to IDEs 2016-04-22 00:15:30 +02:00
Nicolas Hake 02c8dc970a pcg: Make MSVC compatible
Still passes all tests of the test suite except for the tests for
a particular class size, which is an odd thing to test for anyway.
2016-04-22 00:15:12 +02:00
Lukas Werling 0fefc7abae Merge branch 'pcg' 2016-04-21 20:47:34 +02:00
Lukas Werling e6a39392dd Use PCG for C4Particle 2016-04-21 20:39:40 +02:00
Lukas Werling febc5f91bd Replace rand() with SafeRandom() 2016-04-20 22:42:00 +02:00
Lukas Werling 1f5dc0aec6 Add test scenario for Random() performance 2016-04-20 22:42:00 +02:00
Lukas Werling 1f9c15e388 Allow MapZoom values smaller than 5 2016-04-20 22:42:00 +02:00
Lukas Werling 7005eae55d Use PCG as random number generator 2016-04-20 22:42:00 +02:00
Sven Eberhardt f41d3b8869 Fix out-of-bounds memory access in C4Team [sphalerite] #1717 2016-04-19 21:16:47 -04:00
Lukas Werling 250bbf9aa2 Hot Ice: Make use of LoadScenarioSection improvements 2016-04-18 23:05:13 +02:00
Lukas Werling abf32cf00b LoadScenarioSection: Allow reloading the current section 2016-04-18 23:03:35 +02:00
Lukas Werling 4a9553bd20 Fix LoadScenarioSection() resetting the Random seed 2016-04-18 22:57:38 +02:00
Nicolas Hake 598f9c10a0 MSVC: Use incremental LTCG
Incremental LTCG tries to reuse compiled functions from previous links,
which speeds up link times quite a lot.
2016-04-18 13:50:17 +02:00
Nicolas Hake f09d26e39f Merge PR 20: Make memory allocation/deallocation more consistent 2016-04-18 13:49:37 +02:00
Linus Heckemann 042161a627 Fix subsequent deallocation to use free too 2016-04-17 22:56:36 +01:00
David Dormagen cdcb9a5a53 power display: made text GUI_FitChildren
.. so that small resolutions do not lead to even smaller scrollbars next to the power information. It's still not very aesthethic when it's multiline (because it's just so much text) but now it doesn't look horribly broken at least.
2016-04-17 22:28:34 +02:00
David Dormagen 60b9558b56 script GUIs: fixed clipping over parent's boundaries (#1718)
The window would always use its very own rectangle for clipping - bad luck if it was larger than the parent.
Now children can only additionally restrict the parent rectangle (which defaults to the whole screen at root).
2016-04-17 22:28:34 +02:00
Linus Heckemann 25fd930242 Fix some malloc/free mismatches
Discovered with valgrind. Previously, some memory that later gets freed using
free(...) (in StdBuf::Clear) was allocated with new char[...] rather than
malloc, in which case delete[] should be used to free them.
2016-04-17 20:13:33 +01:00
Maikel de Vries 85a6cdbef7 do not apply line transform to grapple hook 2016-04-17 18:11:26 +02:00
Nicolas Hake 8ffc1ab8cb Apply DrawTransform to meshes too
This will make lighting look weird again for meshes flipped via FlipDir.
Avoid doing that until we implement FlipDir for meshes via an internal
MeshTransform.
2016-04-17 17:56:56 +02:00
Maikel de Vries b7a8b3067f correctly stop use control when clonk is attached (#1590) 2016-04-17 15:13:10 +02:00
Maikel de Vries 21b7d86535 allow windbag usage while hanging on balloon 2016-04-17 14:51:30 +02:00
Maikel de Vries 1210cb7c67 invert balloon deflate controls to be more natural 2016-04-17 14:51:02 +02:00
Maikel de Vries d6e19026be fix balloon pushing by windbag (#1709) 2016-04-17 14:49:41 +02:00
Maikel de Vries 21a861fabb unstuck living object from placed wallkits (#1716) 2016-04-17 11:38:52 +02:00
Maikel de Vries 34491fbd0d fix reset of wealth when a player rejoins after game start in worlds 2016-04-17 10:38:30 +02:00
Sven Eberhardt f594737d7e Fix Definition() call order to prevent possible sync loss. 2016-04-16 23:00:31 -04:00
Sven Eberhardt 4e7df72c4c Editor Props: Invincibility and player color. 2016-04-16 22:05:38 -04:00
Sven Eberhardt 901399f5c2 MSVC compile warning fix 2016-04-16 22:05:37 -04:00
Sven Eberhardt c0228be4e7 Qt Editor: More editor property types and functionality 2016-04-16 22:05:35 -04:00
Maikel de Vries fbc797aac9 fix double grapple hook 2016-04-16 16:59:40 +02:00
Maikel de Vries 0686fdb2fc fix shift of buy menu entries when clicking an entry 2016-04-16 15:38:34 +02:00
Maikel de Vries fd36babdfd add vine to aerobatics and gem grabbers 2016-04-13 22:04:16 +02:00
Maikel de Vries 4d5630ab06 fix branch mesh transformation 2016-04-13 22:03:35 +02:00
Maikel de Vries 790a2fbfcc vine: spread leaf particles when being grabbed 2016-04-12 23:53:46 +02:00
Maikel de Vries 100b87af1a add leaf particle 2016-04-12 23:53:46 +02:00
Mark cf81014785 Fix: Corrected commit "Vendor: allow rebuy"
The parameter is an object, but should be an id. This was not detected at runtime.

Fix for commit 89718f35a4
2016-04-12 06:46:06 +02:00
Mark 8fea6827f5 Fix: Corrected commit "Vendor: allow rebuy"
The parameter is an object, but should be an id. This was not detected at runtime.

Fix for commit 89718f35a4
2016-04-12 06:25:22 +02:00
Mark e12dce093a Fix trees growing underground 2016-04-11 22:22:21 +02:00
Mark 8d4f6399aa Bugfix: Trees seed wrongly.
The trees actually seeded at a very wrong place in case the property "Confinement" was not set: The area.x, area.y, area.w, area.h coordinates were specified as global coordinates, but were used as offset coordinates in PlaceVegetation.

This leads to the trees seeding underground, too, unfortunately.
2016-04-11 22:14:20 +02:00
Mark 9cb261aac8 Bugfix: Trees seed wrongly.
The trees actually seeded at a very wrong place in case the property "Confinement" was not set: The area.x, area.y, area.w, area.h coordinates were specified as global coordinates, but were used as offset coordinates in PlaceVegetation.

This leads to the trees seeding underground, too, unfortunately.
2016-04-11 22:12:51 +02:00
Mark b6b5f5a79f Merge branch 'master' into liquid_container 2016-04-11 21:23:28 +02:00
Mark 89718f35a4 Vendor: Allow rebuy
Added a callback QueryRebuy(int for_player, object base) in the vendor library. If an object that will be sold returns true in that function then the object will not be added to the base material of the selling player.
Currently the only objects that are sellable are Diamond, GoldBar, Nugget, Ruby. They cannot be rebought, just as in the previous implementation.
2016-04-11 21:21:41 +02:00
Mark 43d6fcd231 Plant: Extracted a function for plant reproduction.
The existing Seed() places plants with a random chance. This makes testing the placement tiresome, so the actual placing part was moved to the new function DoSeed().
2016-04-11 21:21:38 +02:00
Maikel de Vries 66c71b4ab8 add vine as new vegetation object
still missing: proper graphics, leave particles which fall off
2016-04-11 21:10:04 +02:00
Maikel de Vries 9bb2de333a fix and improve grabbing onto ropeladders 2016-04-11 21:04:51 +02:00
Armin Burgmeier 0580132d81 Fix the build on Linux
With NULL, the function call was ambiguous. Use nullptr to choose the overload
taking a pointer and not the one taking an integer.
2016-04-10 13:27:16 -07:00
Armin Burgmeier d04c4a16ae Fix comparing strings of different lengths
Strings should not compare equal if they only share a common prefix.
2016-04-10 13:22:56 -07:00
Armin Burgmeier 208cb12b2e Fix crash on shutdown
a) make sure the context is deselected on destruction, so that
   CStdGL::Clear() destructor doesn't try to deselect a non-existing context.
b) Calling Clear() in CStdGLCtx::~CStdGLCtx() does only call
   CStdGLCtx::Clear(), even though Clear() is virtual. The reason is that by
   the time the CStdGLCtx destructor is executed, the CStdGLCtxQt part of the
   object has already been destructed. Therefore, make CStdGLCtx::Clear() safe
   to be run without the context ever having been initialized, and explicitly
   call CStdGLCtxQt::Clear() in CStdGLCtxQt::~CStdGLCtxQt(). This is certainly
   not the most elegant way to handle this, but it should do the job for now.
2016-04-10 12:06:57 -07:00
Armin Burgmeier cf708a7cb1 Some cleanup in CStdGLCtxQt 2016-04-10 12:06:57 -07:00
Maikel de Vries fe0440f881 reduce size of shipyard to better fit in the landscape 2016-04-10 18:00:24 +02:00
Maikel de Vries 797ce5f589 fix basement solidmask for large widths 2016-04-10 17:03:30 +02:00
Maikel de Vries 1ae5e601e4 add blast sound variations by K-Pone 2016-04-10 13:09:25 +02:00
Maikel de Vries be96d62868 move ejection pop sound to structures subfolder 2016-04-10 12:26:34 +02:00
Maikel de Vries 6bcd8fd596 implement uncash sound for buying at the vendor library 2016-04-10 12:21:41 +02:00
Maikel de Vries 97f316a35a fix debug build 2016-04-10 09:48:42 +02:00
Sven Eberhardt 2a2fc68e3f Qt Editor: Add user properties 2016-04-09 14:29:02 -04:00
Maikel de Vries 79beb8de47 compactify buy menu entries a little
This prevents unnecessary scrolling and there was a unused little whitespace.
2016-04-08 22:09:22 +02:00
Mark 1d288575ee Stackable: Unit test for extra-slot items containing stacks. 2016-04-08 22:04:24 +02:00
Mark 14d695f0cb Lorry: Fix dumping of liquid objects
Dumping liquids with the lorry was one of the funnier new ideas, but it looked bad. Now the effect is awesome.
2016-04-08 21:31:52 +02:00
Maikel de Vries 43c7e92fd8 show no power need rule in flagpole interaction menu overview 2016-04-08 21:30:29 +02:00
Mark 8ece91193f ObjectInteractionMenu: UnitTest for QueryRejectDeparture, part2 2016-04-08 21:13:42 +02:00
Mark 16d0f263df ObjectInteractionMenu: Unit test for QueryRejectDeparture 2016-04-08 21:04:46 +02:00
Maikel de Vries 0d1b68dc39 balance item components and values 2016-04-08 19:17:53 +02:00
Mark 2f472fce09 ObjectInteractionMenu: Prototype for transfer of liquid items. 2016-04-08 17:32:54 +02:00
Mark 8582dcf4c2 ObjectInteractionMenu: Test for transferring inventory to the same object.
This is a case that will usually not occur, but it may be useful for sorting stackable items in an object.
2016-04-08 17:15:31 +02:00
Nicolas Hake aa06b3b6f6 C4AulParse: Drop unused ATT_STAR
ATT_STAR has been rolled into ATT_OPERATOR and is no longer used
anywhere.
2016-04-07 20:52:31 +02:00
Nicolas Hake f7c29c93e8 Tests: Add index of current test to script name for better errors 2016-04-07 20:52:30 +02:00
Nicolas Hake 3c12dafd5f MSVC: Update .natvis visualizer information 2016-04-07 20:52:29 +02:00
Nicolas Hake f963a398aa Define NORETURN annotation for MSVC 2016-04-07 20:52:28 +02:00
Maikel de Vries fbb365fd65 fix playing sounds in vendor library 2016-04-07 19:27:27 +02:00
Maikel de Vries 13f0f584e8 fix not scaling with holding loaded musket (#1711) 2016-04-07 19:10:38 +02:00
Mark 733d5ccca8 Surrounding: ContentsCount() works with ID now 2016-04-07 17:32:34 +02:00
Mark 69467d3c70 Found unused function 2016-04-07 17:29:40 +02:00
Mark 7be17fba71 ObjectInteractionMenu: Test for construction site 2016-04-07 17:29:14 +02:00
Mark 43f42dcf7f ObjectInteractionMenu: Unit test for transferring objects with extra slots 2016-04-07 06:40:48 +02:00
Lukas Werling 83f3efb5da Hot Ice: Change default configuration to small/explosive/7 2016-04-06 23:10:56 +02:00
Lukas Werling dbe913aeab Hot Ice: Leading team has to win last round to win 2016-04-06 21:45:02 +02:00
Lukas Werling be9bdc6c14 Hot Ice: Fix victory timeout 2016-04-06 21:45:02 +02:00
Lukas Werling 0d21b0b12d Hot Ice: Fix movement/fire carrying over from previous round 2016-04-06 21:45:02 +02:00
Mark 020b3fa9af Expanded test to other sources 2016-04-06 21:25:37 +02:00
Mark b62acf2c8d ObjectInteractionMenu: Unit test for single arrows getting stacked
This revealed a bug: Transferring single arrows to the surrounding with the "transfer all button" leaves single arrows in the environment, instead of actual stacks.
Transferring them with single clicks stacks the arrows though.
2016-04-06 21:05:17 +02:00
Mark 49be2c63fd ObjectInteractionMenu: Fixed unit tests.
The trick was that the Clonk does not exit the object right away, but gets a drop command instead. Furthermore, it was confusing that the Collection2-callback never actually happens in this situation.
2016-04-06 20:43:09 +02:00
Lukas Werling de98bbef46 Fix compile errors on Linux/SDL 2016-04-06 19:17:52 +02:00
Mark 9a24838e78 ObjectInteractionMenu: Repeat first test for different sources 2016-04-06 17:07:45 +02:00
Mark 7293c23cf5 ObjectInteractionMenu: Added unit test 2016-04-06 06:55:06 +02:00
Mark dfbeec20f8 ObjectInteractionMenu: More sensible use of the variables/if-clause
The original implementation is ok, but why check the value if it would not change anyway? In the new implementation the variable lives only where it can actually change, and so does the if-clause.
2016-04-05 21:09:04 +02:00
Mark fbfdcaf932 ObjectInteractionMenu: Extracted sounds 2016-04-05 20:59:00 +02:00
Mark 2fc89201ce ObjectInteractionMenu: Renamed variables
Variables have the same names in both functions.
2016-04-05 20:55:04 +02:00
Mark dc0c8b7361 ObjectInteractionMenu: Extract functions for transferring items
Transfer of items from one container to another is handled differently between the following actions: a) select items for transfer in the inventory box; b) transfer all items with the transfer-all-arrows.

This should be made consistent, especially since action a) seems to have an unnecessary special case (marked with TODO).

As a first step the methods were simply extracted.
2016-04-05 20:49:40 +02:00
Nicolas Hake d0c800d27a Scripted landscape: Always release surfaces back to C4Landscape
Even when scripted landscape generation fails, C4Landscape wants its
surfaces back to work with whatever landscape may have been created from
Map.bmp.
2016-04-05 13:50:49 +02:00
Mark d474b0dd6e Merge remote-tracking branch 'origin/master' into liquid_container 2016-04-05 06:29:54 +02:00
Mark c607e3e4c2 Merge commit '0795d088d1f82e8d4158e4fa859bbe69e0c4c875' into liquid_container
Conflicts:
	planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c

Unit tests still pass!
2016-04-05 06:29:08 +02:00
Nicolas Hake f9dfcd1f71 Update all copyright notices for 2016 2016-04-05 06:18:43 +02:00
Nicolas Hake 1444d3d778 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-05 06:14:25 +02:00
Nicolas Hake 2ced63de25 Fix mape build 2016-04-05 06:14:11 +02:00
Sven Eberhardt 879d501592 Merge remote-tracking branch 'remotes/origin/qteditor' into qteditor
Conflicts:
	src/editor/C4ConsoleQtPropListViewer.cpp
	src/editor/C4ConsoleQtPropListViewer.h
	src/script/C4ValueArray.cpp
2016-04-04 19:34:02 -04:00
Nicolas Hake 1e1532ef8a Darwin: What the hell does "#import" do anyway? 2016-04-04 23:27:50 +02:00
Maikel de Vries 0795d088d1 stack objects with extra slots in menu iff slot contents can be stacked 2016-04-04 22:23:34 +02:00
Maikel de Vries 1615284bd1 fine tune weapons and items in aerobatics 2016-04-04 22:23:34 +02:00
Maikel de Vries 255429d3e0 make setting loaded public in musket and grenade launcher 2016-04-04 22:23:34 +02:00
Maikel de Vries ca265103bb do not stack loaded weapons with unloaded ones 2016-04-04 22:23:34 +02:00
Sven Eberhardt 98c36e5955 Qt Editor: Implement setting of properties 2016-04-03 23:46:58 -04:00
Sven Eberhardt e8f48fd53e Qt Editor: Win32 build fixes 2016-04-03 23:46:20 -04:00
Nicolas Hake 9dddf289db Merge branch 'master' into qteditor 2016-04-03 21:06:32 +02:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake 5134a0a0a4 Fix mape build 2016-04-03 20:24:42 +02:00
Mark 1f303ac331 Merge remote-tracking branch 'origin/master' into liquid_container 2016-04-03 20:16:55 +02:00
Maikel de Vries 202f2c49df fix snowing for cloud 2016-04-03 19:11:00 +02:00
Nicolas Hake 267bb1c3f1 Landscape: Make script-edited maps work again 2016-04-03 17:23:00 +02:00
Nicolas Hake 5c0d8a9ce6 Landscape: Make script-generated maps work again
...by actually storing the result of the generator somewhere.
2016-04-03 17:02:41 +02:00
Nicolas Hake ebfacb928d GLSL: Improve line information in error messages
Instead of making the user count lines from the shader log, we'll now
emit #line directives and a file number->name mapping to make it easier
to figure out which file and line the error message comes from.
2016-04-03 16:17:39 +02:00
Nicolas Hake 3641509462 Mesh rotation: Keep rendered mesh inside shape 2016-04-03 13:37:04 +02:00
Nicolas Hake de1d00eb68 Meshes: Enable reload for custom material shaders 2016-04-03 13:37:03 +02:00
Nicolas Hake ccadd2bec3 C4Object: Remove some unimplemented func declarations 2016-04-03 13:24:28 +02:00
Nicolas Hake 0537df5f23 C4Object: Move C4Def.h dep out of header
C4Def is only ever used as a pointer inside C4Object.h, so we don't need
to include C4Def.h from it.
2016-04-03 13:24:26 +02:00
Nicolas Hake 735f9cc06b C4Landscape: Pull everything private out of the header
Since LTCG is enabled now, we don't have to define every function inside
the headers for ~xXx super speed xXx~, which means we can strip the
headers down to their bare minimum and reduce interdependencies and
therefore recompilation times by a lot.
2016-04-03 13:24:24 +02:00
Nicolas Hake 9e9c5d0c06 CMake/MSVC: Interpolate the right variable into CMAKE_CXX_FLAGS_DEBUG
Instead of discarding all previous debug CXXFLAGS and replacing them
with generic ones, actually interpolate CMAKE_CXX_FLAGS_DEBUG into a
value to assign to CMAKE_CXX_FLAGS_DEBUG.
2016-04-02 02:41:50 +02:00
Nicolas Hake 893d4e295b C4Landscape: Set dynamic mode when map was successfully generated
...instead of when it failed to generate.
2016-04-01 14:38:47 +02:00
Nicolas Hake 0c6fee1442 CMake: Enable LTCG/LTO 2016-03-31 23:05:00 +02:00
Nicolas Hake d3d41721f0 CMake: Disable plain "Release" builds
Having a build type that's called "Release" makes people thing they
should use it when they want optimized builds. They shouldn't. They
should be using RelWithDebInfo instead, so at least trying to debug
errors isn't entirely futile.
2016-03-31 23:01:37 +02:00
Nicolas Hake 3922e7c5ee CMake: Stop the OC_*_FLAGS song and dance
CMake handles adding un-cached flags properly, so we don't have to force
flags into the cache.
2016-03-31 23:01:36 +02:00
Nicolas Hake 0abef8dac5 Remove "High-res landscape" option
We're requiring shaders for everything else we render, so there's no
point in having a shader-free landscape renderer around.
2016-03-31 19:22:17 +02:00
Nicolas Hake 33b8d404a5 GL: Add "frameCounter" uniform
Add the current frame counter as a uniform variable to the shaders, so
people can use it to do time-based animation.
2016-03-31 01:44:44 +02:00
Nicolas Hake cd0032ccf0 Do mesh rotation outside of DrawTransform
Mesh rotation needs to happen as part of the MeshTransform so lighting
is applied correctly. DrawTransform applies after lighting which made
rotated meshes look weird.
2016-03-31 01:19:58 +02:00
Clonkonaut fe4132309a Added a few more interaction menu buttons to the cable cars, animation to the station. 2016-03-30 00:55:49 +02:00
Mark b00290f5f7 Vendor: Added parameter for the base that is selling the object.
This way the barrel can sell its contents, leaving behind an empty barrel.
2016-03-29 20:11:41 +02:00
Mark bc9538200c Merge branch 'master' into liquid_container 2016-03-29 20:06:14 +02:00
Mark 7e74baac55 Refactoring: Construction site takes materials, not the constructor
The functionality of taking construction materials from a clonk and lorries was extracted to a separate function and moved from the constructor to the construction site. This is a little bit of an esthetic decision, but it is also useful for my project that has a spacebar-interaction which takes construction materials from the clonk without the need to open the inventory menu.
2016-03-29 18:56:10 +02:00
Clonkonaut fb761fbd58 Removed parentheses after 'this'. 2016-03-29 18:17:05 +02:00
Sven Eberhardt 370b9cf898 Qt Editor: Disable vsync to avoid laggy viewports 2016-03-28 23:10:10 -04:00
Mark 7110882813 Vendor: Extracted functions for ejection of contents
In certain overloads of the object I want to be able to not eject contents, or eject only certain objects. The default behaviour of ejecting ALL contents whenever someone buys something is annoying in certain structures, such as a marketplace.
2016-03-28 22:33:58 +02:00
Mark 44b643d1e3 Fix error when opening resource goal description 2016-03-28 22:33:48 +02:00
Lukas Werling 6eecf34e18 Build with SDL/Qt instead of GTK per default
This is necessary to make the autobuild server build the relevant Qt
editor code on Linux while we're on the qteditor branch.
2016-03-28 22:14:00 +02:00
Lukas Werling a12e485458 Qt Editor: Add scroll bars to the viewports 2016-03-28 22:07:43 +02:00
Clonkonaut e6093ee2fc Fixed possible access of a removed zap (#1665). 2016-03-28 19:21:29 +02:00
Maikel de Vries 6bdbc5b5c7 add InsertVertex script function to insert a vertex at arbitrary position 2016-03-28 17:36:00 +02:00
Maikel de Vries 12ae155015 GetVertex: return nil for invalid vertex index and improve documentation 2016-03-28 17:36:00 +02:00
Sven Eberhardt 9294d8b9dc Qt Editor: Fix title and icon
Using the .ico needs a plugin that is not always loaded.
2016-03-26 23:55:28 -04:00
Lukas Werling a79d5d1802 Fix openclonk-server build on Windows 2016-03-26 23:26:52 +01:00
Lukas Werling f2b6897065 Qt Editor: Fix broken icons 2016-03-26 23:22:51 +01:00
Lukas Werling baf54a88b9 Fix assertion when comparing strings of different lengths 2016-03-26 21:59:46 +01:00
Lukas Werling ca88a0a52a Implement new Linux editor todos 2016-03-26 21:43:37 +01:00
Lukas Werling ea36b4f4a0 CMake: Add a QT_EDITOR_SOURCES list 2016-03-26 21:42:24 +01:00
Lukas Werling 6d9aef33c2 Merge branch 'qteditor-sdl' into qteditor 2016-03-26 20:57:10 +01:00
Lukas Werling f8dc58e0ed Remove Windows editor rendering hacks (untested) 2016-03-26 20:54:26 +01:00
Lukas Werling 61e97ee87e Fix zooming not working in the editor 2016-03-26 20:40:09 +01:00
Lukas Werling f9190cd1ea Fix keyboard input for Qt editor/SDL
The SDL port used to define a separate set of key codes differing from
the usual ones. The SDL codes are now translated to make the Qt input
easy.

This also fixes a broken keycode for the '0' key.
2016-03-26 20:29:07 +01:00
Lukas Werling 30dd360a57 Update the Qt rendering widget periodically 2016-03-26 19:03:16 +01:00
Sven Eberhardt dc7259bb1e Qt Editor: Allow opening of user path from welcome page 2016-03-26 14:02:40 -04:00
Mark f0cfeeaf09 Merge remote-tracking branch 'origin/master' into liquid_container 2016-03-26 13:16:50 +01:00
Sven Eberhardt b3712ace97 qt editor: Add "Editor" button to startup main menu 2016-03-26 02:15:15 -04:00
Sven Eberhardt f2daa51fa7 Qt Editor: Add "Welcome" dock widget 2016-03-26 01:36:40 -04:00
Armin Burgmeier fca5106a33 FoW rendering: reset to previous framebuffer instead of default one
The QOpenGLWidget is set up to render into a custom framebuffer, and by
resetting to render into the default framebuffer, we don't draw anything in
the buffer that is actually going to be displayed by the widget.
2016-03-25 17:29:23 -07:00
Clonkonaut 2db254b948 Updates cable cars / lorries with new graphics by pluto. Made everything work again. Integrated control into the interaction menu.
Still needs a lot of work but I'm getting there.
2016-03-26 00:14:20 +01:00
Armin Burgmeier b6e573296a CStdGLCtxQt: share with Qt's global share context
This allows the OpenGL context that Qt creates for QOpenGLWidget to use the
GL objects that we created beforehand.
2016-03-25 14:17:16 -07:00
Armin Burgmeier 56545dc5f3 Fix crash when constructing C4ConsoleQtDefinitionListViewer 2016-03-25 14:16:43 -07:00
Mark 96c84a5bcd Deleted outdated Library_BarrelFiller
Barrels get filled by liquid objects now, you just have to insert liquid objects into the container.
2016-03-25 20:01:38 +01:00
Mark ab5d92117a Refactoring: Added parameter for container in CreateLiquid() 2016-03-25 19:44:36 +01:00
Mark 52542d7977 Refactoring: Liquids: Removed GetLiquidID() and changed CreateLiquid()
CreateLiquid() can be called from definition context now, to create a certain amount of liquid.
2016-03-25 19:34:36 +01:00
Mark 1c1ea38efa Renamed the liquids IDs
Omitted the prefix "Liquid_".
2016-03-25 19:11:55 +01:00
Mark ed75112715 Move liquids to the folder Items\Resources 2016-03-25 19:11:34 +01:00
Mark af2e4de6a1 Improved display of the connection status of pipes 2016-03-25 18:55:22 +01:00
Mark 96468023cf Fix line not updating on disconnect 2016-03-25 18:51:18 +01:00
Mark dd99b2c4c3 Fixed line break 2016-03-25 18:28:10 +01:00
Mark c0245be627 Merge: Changes from merge conflict 2016-03-25 17:20:54 +01:00
Mark dd7bf3e89e Merge remote-tracking branch 'origin/master' into liquid_container
Conflicts will be merged in the next commit:
	planet/Objects.ocd/Items.ocd/Tools.ocd/Pipe.ocd/PipeLine.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Tools.ocd/Pipe.ocd/Script.c
2016-03-25 17:15:39 +01:00
Mark db061b5cad Refactoring: Simplified script.
Unit tests still pass.
2016-03-25 16:31:17 +01:00
Mark a34eea41dc Power: Fixed unit test 21 2016-03-25 16:24:43 +01:00
Mark c0b783c976 Power: Fix unit test 20 2016-03-25 16:13:11 +01:00
Mark 6b7dc6015d Liquids: Fix liquids entering Clonks 2016-03-25 16:12:02 +01:00
Mark 74ce1ea8ac Stackable: Unit test for barrel entering Clonks via interaction menu 2016-03-25 15:16:03 +01:00
Mark b491260fac Refactoring: Producers: Removed another special case from IsCollectionAllowed()
This special case was handled by the fact that liquid items are components anyway, and the ice object is handled differently.
2016-03-24 22:26:09 +01:00
Mark 0ef237988e Refactoring: Producers: Removed special case in IsCollectionAllowed()
The special case can be handled in RejectCollect(). Unit tests passed.
2016-03-24 22:20:55 +01:00
Mark ff89f337de Refactoring: Producers: Readability
Renamed some parameters and variables
2016-03-24 22:16:08 +01:00
Mark 9298d27719 Producers: New test for collection 2016-03-24 22:04:53 +01:00
Mark 29870b5e6d Producers: Code formatting 2016-03-24 21:28:09 +01:00
Mark 1f25fa2679 Producers: Additional unit tests 2016-03-24 21:20:49 +01:00
Mark e3a991bb86 Producers: Additional unit tests 2016-03-24 20:45:48 +01:00
Mark 898530ed37 Producers: Additional unit tests 2016-03-24 19:40:34 +01:00
Mark 9645b4afe9 Producers: Additional unit tests 2016-03-24 19:17:21 +01:00
Mark fc3d6a69f0 Producers: More unit tests for basic operation
Added tests for adding to the queue and clearing the queue. The other tests are dummies for now. Found out that the parameter 'abort' in ClearQueue() was never used.
2016-03-24 18:27:23 +01:00
Mark 18ad5894e2 Producers: Producers can convert ice to water
This special case is a relic, because I do not know whether this is actually a use case that is required in a scenario. All unit tests in the producers test pass now.
2016-03-24 16:19:15 +01:00
Sven Eberhardt 1613885f47 Qt Editor: Use qt resource to set icon 2016-03-23 22:56:17 -04:00
Sven Eberhardt 9690174007 Qt Editor: Fix windows includes 2016-03-23 18:20:23 -04:00
Mark 332b899c54 Barrel: Fixed barrel liquid ejection
The barrel did not eject liquids with the correct angle when using the barrel, because the parameters were not used by the liquids.
2016-03-23 20:18:08 +01:00
Mark 02b8cf8422 Barrel: Fixed barrel getting filled with liquids
Barrels was not updating, and caused an error when getting filled with liquid.
2016-03-23 20:11:23 +01:00
Lukas Werling 43177e8951 Fix rain failing to insert material 2016-03-23 16:02:36 +01:00
Maikel de Vries 26f030f18a remove airship solid mask in aerobatics after intro has finished 2016-03-23 15:24:38 +01:00
Lukas Werling 7d1109cef7 Merge branch 'weather' (close GH-12) 2016-03-23 13:35:07 +01:00
Lukas Werling 634ec69052 Fix invisible water splash particles 2016-03-23 13:32:44 +01:00
Lukas Werling c9c64a942e Improve rain drop performance 2016-03-23 13:32:43 +01:00
Lukas Werling a309f91af0 Cloud: Improve smoking condition (e.g. lava hits water) 2016-03-23 13:32:43 +01:00
Lukas Werling cb64c83bd5 Add Cloud::SetVisualRainStrength for adjusting particle rain strength 2016-03-23 13:32:43 +01:00
Lukas Werling c0275011b3 Add sound (by ala) for water and acid rain 2016-03-23 13:32:36 +01:00
Lukas Werling f5ce3dc12b Cloud: Performance optimizations around particles 2016-03-23 13:30:13 +01:00
Lukas Werling f88d0659da Add real snow to snowing cloud 2016-03-23 13:24:18 +01:00
Lukas Werling 7661b13ba6 Move particle proplist definitions to global Particles.c 2016-03-23 13:24:18 +01:00
Lukas Werling 292418a964 Add Randrian's rain hit effects 2016-03-23 13:24:18 +01:00
Lukas Werling 021ecb0b2e Integrate Randrian's rain particles into Cloud.ocd 2016-03-23 13:24:18 +01:00
Lukas Werling 4f72a276af Import Randrian's rain particles 2016-03-23 13:23:14 +01:00
Sven Eberhardt b1ac208249 Qt Editor: Add "File->New" menu entry 2016-03-22 23:08:05 -04:00
Maikel de Vries d6b963d321 remove unused LineMaxDistance property 2016-03-22 22:26:46 +01:00
Maikel de Vries 9d026da0a2 acid drilling: use new max length for pipes 2016-03-22 22:15:31 +01:00
Maikel de Vries bf1b65c8bd fix loam usage bar margins 2016-03-22 22:12:36 +01:00
Maikel de Vries 7693276a48 implement max length for pipe and show it in inventory HUD 2016-03-22 22:09:02 +01:00
Maikel de Vries dc1e828cfb add callback OnLineChange when line changes its vertices or vertex positions 2016-03-22 21:53:32 +01:00
Lukas Werling a52da814fa Play short rumble when a Clonk gets hurt 2016-03-22 20:19:08 +01:00
Maikel de Vries fc008241cd rename LineBreak callback to OnLineBreak 2016-03-22 18:58:55 +01:00
Lukas Werling acc04b2398 Improve default Use/Throw angles when not aiming 2016-03-22 18:56:31 +01:00
Lukas Werling fac684a973 Fix crosshair being visible initially 2016-03-22 17:13:21 +01:00
Lukas Werling 4290038909 Move all viewport drawing to QOpenGLWidget::paintGL
Unfortunately, this still doesn't fix rendering. Note that the paintGL()
isn't called periodically yet, only when resizing the window.
2016-03-22 16:50:38 +01:00
Lukas Werling eefa8749a8 Fix viewport Zoom getting set to NaN 2016-03-22 16:49:39 +01:00
Lukas Werling b30860112a Use regular Use instead of UseDelayed for gamepads 2016-03-21 18:45:42 +01:00
Lukas Werling f63f4b9ab3 Use regular Throw instead of ThrowDelayed for gamepads
There is no need to delay throwing as aiming is now possible at any time
using the analog stick.
2016-03-21 18:45:42 +01:00
Lukas Werling b8c8bf825c Crosshair: Use analog stick input properly
- Crosshair doesn't work with a dpad anymore. Supporting dpads adds
   unnecessary complexity, as a gamepad user with dpad will never be
   competitive with mouse users.

 - Crosshair isn't bound to item usage anymore, but will always show
   when the analog stick is outside of a deadzone.

Future planned feature: Also use the actual strength to allow
distance input in addition to direction. This is used heavily by
Knüppeln.c4s.
2016-03-21 18:45:42 +01:00
Lukas Werling 93dcb1d729 Improve gamepad assignments
- Add assignments for switching interaction and pickup targets (just
   like the keyboard control).

 - Remove double assignments of the sticks for walking and aiming. The
   left stick is now exclusively for walking and the right stick
   exclusively for aiming.
2016-03-21 18:45:42 +01:00
Lukas Werling 0afa589286 Replace all usage of "bool released" with "int status" 2016-03-21 18:45:42 +01:00
Lukas Werling 19caa65b7b Merge branch 'sdl-gamecontroller' (pull request GH-17) 2016-03-21 16:39:28 +01:00
Lukas Werling 21fd0805d0 Merge branch 'gtk-mousegrab' (pull request #18) 2016-03-21 16:27:24 +01:00
Lukas Werling e1eb62a552 Fix warnings about overridden functions 2016-03-20 21:16:52 +01:00
Lukas Werling 75f62e52f2 Make Qt editor work with the SDL engine
Viewport rendering doesn't quite work yet, though.
2016-03-20 21:16:52 +01:00
Lukas Werling 08d7c9dcea Implement GetShiftWParam() with Qt 2016-03-20 21:16:52 +01:00
Sven Eberhardt a3cdfa3221 Qt Editor: Add shadow to landscape brush circle
To be more visible e.g. when drawing snow or in front of a white sky
2016-03-20 11:35:20 -04:00
Maikel de Vries 8d2ab69d03 make GetDefinition work on string parameter
This can be useful to check if a definition is loaded, ideally the implementation is moved to the engine.
2016-03-20 09:15:35 +01:00
Sven Eberhardt 3f7d68ff2c Qt Editor: Sort objects in object creator by name 2016-03-19 14:40:23 -04:00
Sven Eberhardt ed0647866e Qt Editor: Add preview for new object placement 2016-03-19 14:40:22 -04:00
Mark 8298bc789f Producers: Unit test for continued production
Made test 7 more specific: Production must be halted, material must stay.
2016-03-19 11:49:50 +01:00
Mark 3ad6cb2177 Producers: Unit test for halted production 2016-03-19 11:41:49 +01:00
Lukas Werling b64b4e8574 Compilation fixes for Linux 2016-03-18 21:34:21 +01:00
Lukas Werling b50a059350 Hot Ice: Add a countdown before the round begins 2016-03-18 18:11:17 +01:00
Mark 274379ddc3 Producers: Fixed unit test 5
Added unit test 6 for fuel objects that do not behave correctly. Fuel should always return the current fuel amount if not parameter is passed.
2016-03-18 17:44:51 +01:00
Mark d06f62398c Object Interaction Menu: Implementation should be discussed
There is one special case in the object interaction menu that should be handled by stackable already. Marked it with "TODO".
2016-03-18 17:20:00 +01:00
Mark 1d8163e3f2 Producers: Unit tests for fuel objects 2016-03-18 17:18:33 +01:00
Mark 2e3a984b20 Producers: Fixed objects with liquid need
Liquids are handled as objects now, so that the function GetLiquidNeed() in the objects is obsolete. Adjusted the collection function accordingly.
2016-03-18 06:35:44 +01:00
Mark a224d62791 Stackable: Unit test for initialization
The earth object did not include _inherited(...) in the Construction() callback. Thus it was not initialized as a stackable object correctly. Fortunately the other stackable objects did not have this problem.
Nonetheless I added a unit test, so that we can identify similar problems in the future.
2016-03-18 06:30:16 +01:00
Sven Eberhardt 4f70fdbfc8 Qt Editor landscape drawing fixes and improvements. Add brush size preview. 2016-03-18 00:26:14 -04:00
Mark 992c3cd074 Producers: Modified unit test 2016-03-17 22:43:31 +01:00
Mark a95694ea23 Bugfix: Earth is not initialized properly.
This bug did previously not appear, because the stack count did always return a minimum of 1. May add unit test with all stackable items later.
2016-03-17 22:42:49 +01:00
Mark a24ec9f0ac Producers: Basic unit test 2016-03-17 21:51:35 +01:00
Mark 49fdd59362 Refactoring: Stackable: Moved callback CollectFromStack()
The callback happens in every call to MergeWithStacksIn() now, instead of RejectEntrance(). Otherwise the following use case does not work: Liquid enters crew/building and fills the contained barrels. Added a unit test for that use case. Stackable unit tests still pass.
2016-03-17 18:43:08 +01:00
Mark a2700890ce Refactoring: Unit test for liquid containers uses doTest()
This is more readable and failures can be identified more easily.
2016-03-17 18:13:40 +01:00
Mark 8749300622 Fix unit tests: Some code adjustments were forgotten in the other commits. 2016-03-16 22:44:48 +01:00
Mark 7febb8fd91 Refactoring: Stackable: The size of stacks can be limited by a container now.
The function RejectEntrance() has two more callbacks to the object it should enter:
- CollectFromStack(object stack): The object can grab items from the stack, before the stack tries to merge with stacks in the object. This is necessary for barrels, so that a large liquid stack can fill an empty barrel.
- RejectStack(object stack): This is called after the stack is merged. Currently, the stack merging counts as handled only if the stack is removed. This callback allows the object to still reject the stack, for example if it accepts only one item, such as the barrel does.
2016-03-16 22:43:44 +01:00
Mark ac8d40418c Refactoring: Stackable: Renamed TryPutInto() to MergeWithStacksIn()
The previous name suggested that the object actually gets put into another object. In fact it merges the stack count with other stacks, and it does not only try to (and reverts the state if it fails), but it actually changes other objects even if the function returns false.
2016-03-16 18:19:55 +01:00
Mark e1cde6a92e Stackable: Better explanation of TryPutInto() 2016-03-16 07:00:54 +01:00
Mark 918baf3c11 Stackable: Documentation 2016-03-16 06:52:59 +01:00
Sven Eberhardt 645520c7af Qt Editor: Fix viewport focus and keyboard handling. 2016-03-15 22:58:41 -04:00
Clonkonaut dc74a2301f Mooq: Fixed mesh rotation. 2016-03-14 12:07:46 +01:00
Mark 176856e276 Refactoring: Stackable: Moved HUD notifications to a separate function.
It should be OK that the new function calls OnInventoryChange() in Clonks on destruction now.
2016-03-11 17:10:41 +01:00
Mark a61eac6ff3 Refactoring: Stackable: Reenabled recursive stacking into items
This got removed by accidet (checking if the object was added to another stack seemed logical). However, this whole function does not really make sense. It returns true if the object got removed only. That means that the object would not enter the other object anyway.
Removed the UpdateStackDisplay(), because that happens in TryAddToStack() if the count changes, anyway.
2016-03-11 07:03:22 +01:00
Mark b40e44340c Stackable: Reverted some tests.
Checked the tests against the original implementation. Turns out that the implementation was recursive for finite stacks after all!
2016-03-10 17:41:22 +01:00
Mark 0759c59bf1 Stackable: Fixed remaining unit tests 2016-03-10 17:29:42 +01:00
Mark 2e8ed77f56 Stackable: Fixed unit test 17
The test simply had a wrong expectation.
2016-03-10 17:20:45 +01:00
Mark 862c4ad312 Stackable: Fixed unit test 12 and 13
The test expects what the method does. Added original expected behavior in comments, because this was the use case example.
2016-03-10 07:03:29 +01:00
Mark f0aa3fafc7 Stackable: Fix unit test 8
The test now expects what the functions actually do. Put the previously expected behavior in comments
2016-03-10 06:56:05 +01:00
Mark 674145dc48 Refactoring: Stackable: Fix unit test 5
Added documentation for Stack(); Stack() does not stack on top of itself anymore.
2016-03-10 06:41:34 +01:00
Mark 969469190e Refactoring: Stackable: Replaced 'count' with GetStackCount()
This is possible, because the function returns the actual count now.
2016-03-10 06:25:04 +01:00
Mark 25408b4367 Refactoring: Stackable: Simplified TakeObject() even further
The check whether the stack is infinite happens in DoStackCount(), too.
2016-03-10 06:17:07 +01:00
Mark ea3c5ad920 Refactoring: Stackable: Simplified TakeObject()
The part where the stack count is reduced behaves the same as DoStackCount(); The stack display is updated in SetStackCount()/DoStackCount() respectively, so that line can be removed.
2016-03-10 06:14:49 +01:00
Mark 556454fcf4 Stackable: Fix unit test 14
The function IsInfiniteStackCount() now returns an actual boolean value, instead of nil.
2016-03-10 06:11:14 +01:00
Sven Eberhardt f6ce50e9e7 Qt Editor: Use qt widgets for viewports 2016-03-10 00:07:17 -05:00
Maikel de Vries 0b1011ff8f Merge branch 'lluchs-hotice-rounds' 2016-03-09 21:49:47 +01:00
Maikel de Vries d0ee605728 Merge branch 'hotice-rounds' 2016-03-09 21:47:44 +01:00
Lukas Werling 2236d4fa4a Hot Ice: Allow scrolling while waiting for the next round 2016-03-09 21:29:42 +01:00
Lukas Werling 3b039f8342 Hot Ice: Add scoreboard 2016-03-09 21:08:14 +01:00
Maikel de Vries 21c5f63d44 wipf: dig free is covered with earth (#1703) 2016-03-09 20:54:43 +01:00
Mark 76a0860a68 Refactoring: Stackable: Infinite stacks are not removed when taking the whole stack
Also made IsInfiniteStackCount() runtime-overloadable
2016-03-09 16:39:30 +01:00
Mark 114ad2697e Refactoring: Stackable: A stack can never contain 0 items
Stacks with 0 or less items are always removed. GetStackCount() returns the actual stack count now, which should always be positive.
2016-03-09 06:59:46 +01:00
Mark 0ea8894dbd Comment out logging in stackable 2016-03-09 06:32:12 +01:00
Mark b16e94d51d Stackable: Unit test for use case #2 with infinite objects 2016-03-09 06:30:49 +01:00
Lukas Werling d2836bb70a Hot Ice: Add option for multiple rounds 2016-03-09 00:32:02 +01:00
Mark 2dd6bbdaf4 Stackable: More unit tests for infinite object 2016-03-08 22:53:27 +01:00
Mark 350088525c Refactoring: Stackable: Use InitialStackCount() where it makes sense 2016-03-08 06:57:53 +01:00
Mark d8a68f5655 Stackable: Unit test for stacking finite and infinite objects 2016-03-08 06:48:34 +01:00
Mark dc84a1a5e2 Refactoring: Stackable: IsInfiniteStackCount() instead of count_is_infinite
The interface should be used instead of the internal variable, in case something gets renamed.
2016-03-07 17:49:11 +01:00
Mark fe5e1bc581 Stackable: Unit test for infinite stack count, basics.
Found a bug: An infinite stack gets removed if you take the entire stack at once.
2016-03-07 17:47:49 +01:00
Mark 45fbc64254 Stackable: Remove obsolete objects. 2016-03-07 06:53:08 +01:00
Mark c7fc982d3e Stackable: Unit tests for the use cases from the stackable documentation. 2016-03-07 06:40:27 +01:00
Mark 8573ed9745 Stackable: Unit test for deeply nested extra-slot objects 2016-03-07 06:13:44 +01:00
ckanibal 8f31ae22bf Make Windows build great again! 2016-03-07 00:58:23 +01:00
Mark df04c2c9c1 Stackable: Unit test 9
Stack objects into a container with non-extra-slot containers.
2016-03-06 21:44:57 +01:00
Mark 4101dc7600 Stackable: Additional test scenarios for unit test 8 2016-03-06 21:30:57 +01:00
Mark d86fe2549d Stackable: Unit test for TryPutInto() with empty containers.
First part of a series of tests. TryPutInto() has to be tested with several container types.
2016-03-06 21:04:28 +01:00
Sven Eberhardt 63bbba06bb Qt Editor: Add missing creator files 2016-03-06 13:17:14 -05:00
Sven Eberhardt 80549ca2cc Qt Editor: Add object creator 2016-03-06 13:06:29 -05:00
Maikel de Vries 21cbf97562 fix contact calls and borderbound for mooq 2016-03-06 10:45:02 +01:00
Maikel de Vries d768e9e256 fix playing mooq sounds and move sounds to Sound.ocg 2016-03-06 10:37:29 +01:00
Mark e92f5b6bf9 Stackable: Better logging in unit test
Also corrected some minor details in the test logic, related to InitialStackCount() and MaxStackCount().
2016-03-06 06:49:57 +01:00
Clonkonaut 5801a2f133 Mooq: Applied Script Guidelines. 2016-03-05 19:02:27 +01:00
jok21 0f1b9c0891 Mooq Particle Change 2016-03-05 19:02:26 +01:00
jok21 a89ee8e51b MooqSounds 2016-03-05 19:02:25 +01:00
jok21 4c4a590ac8 Mooq 2016-03-05 19:02:23 +01:00
Maikel de Vries 9b39f2b18c fix ShuffleArray
When taking a random element from the copy, also consider the last element.
2016-03-05 17:27:20 +01:00
Maikel de Vries 1862161708 eject structure contents on destruction 2016-03-05 16:40:33 +01:00
Maikel de Vries 5acf34c2ba allow larger font sizes for exotic monitor configurations (#1695)
This can be still improved depending on the monitors dpi and select automatically a font that fits best to the dpi.
2016-03-04 21:07:42 +01:00
Mark 258f3d3b3b Stackable: Unit tests for Stack() and TryAddToStack() 2016-03-04 17:46:24 +01:00
David Dormagen 4465236d1b interaction menu: added contents count to "Inventory" (#1697)
..I am open to discuss the exact design of this.
2016-03-04 08:18:20 +01:00
Mark ec35a11013 Stackable: More unit tests
Tests for CalcValue() and TakeObject(). Testing the behaviour in combination with containers that have an extra slot is necessary.
2016-03-04 06:57:47 +01:00
Mark e8b6fda751 Stackable: Unit test
First unit tests for the stackable library
2016-03-03 23:01:52 +01:00
Mark a785ca83da Stackable: Added InitialStackCount()
For things such as the liquid object that starts with 1 item in the stack, so that the Construction() function does not have to be overloaded.
2016-03-03 22:13:27 +01:00
Mark 96e59a0626 Failed attempt at unit test nr. 6 2016-03-03 22:10:10 +01:00
Mark 3c05d53b3a Liquid objects: Added unit test 5 2016-03-03 17:20:58 +01:00
Mark 1786f5b3d9 Liquid objects: Fix unit test, Stackable
Addedv debugging logs, will remove them once all unit tests work. The stackable library function "TryPutInto" was changed slightly.
2016-03-03 17:10:43 +01:00
Mark cbe8bbd8e8 Removed authors Ringwaul and ST-DDT from liquid container
They were not involved in the current script
2016-03-03 17:07:37 +01:00
David Dormagen c6dd261d05 Surrounding helper: added ContentsCount overload
..which is a pre-requisite to showing the current / max. contents count in the interaction menu.
2016-03-03 10:46:11 +01:00
Sven Eberhardt 74b3983f7f Fix some Qt editor crashes
Fix use-after-delete on proplists by item view and crash on recursive execution of message processing.
2016-03-03 00:13:39 -05:00
Mark a7ed516c39 Refactoring: Liquid container
The liquid container library was severely reduced by the changes that the liquid objects bring. The remaining unit tests nearly work.
2016-03-01 22:29:35 +01:00
Mark afc8797b2f Fix steam engine 2016-03-01 19:54:55 +01:00
Mark f78890142c Refactoring: Fuel
Added parameter to 'GetFuelAmount' that specified how much fuel is requested from this object. Oil is now fuel and only the needed amount is removed instead of removing the entire stack when a producer requests fuel.
2016-03-01 17:29:24 +01:00
Mark 072f599cdb Refactoring fuel: Removed the 'get_partial' parameter.
This was used inconsistently and without regard to correctness, so it is better removed altogether. In case of incomplete objects, the incomplete object always returns the reduced amount.
2016-03-01 17:19:39 +01:00
Mark 4f19651f0e Removed liquid need objects 2016-03-01 06:58:16 +01:00
Mark 4f51a75a20 Removed fuel object
Need for a fuel burner library is evident
2016-03-01 06:55:02 +01:00
Mark 3591681f32 Liquid objects: Removed check liquid logic from producer
The liquid objects cannot be converted from one to another. The fuel object will be removed again, it does not make sense that "burnt fuel" can be transferred from one object to another.
2016-03-01 06:47:12 +01:00
Günther Brammer b54ddc7663 Merge branch script 2016-03-01 03:04:17 +01:00
Mark 0536520bc8 Refactoring: Liquid object stackable
Made the liquid object stackable again. Will replace component amounts in the next step.
2016-02-29 21:40:45 +01:00
Nicolas Hake fe91cec2b7 Merge remote-tracking branch 'github/pull/14' 2016-02-29 14:05:45 +01:00
Mark 7561779d8c Producers handle fuel and liquid with liquid objects 2016-02-27 15:04:37 +01:00
Mark a524e7db2c Added comment 2016-02-27 14:43:24 +01:00
Mark 0a77b58b6a Steam Engine: Use fuel as liquid, finished
The pump was blocked, because the steam engine did not insert enough material
2016-02-27 14:35:38 +01:00
Mark 7a1b7d6258 Merge 'master' into liquid_container 2016-02-27 12:51:11 +01:00
Mark 7894fb0fc6 Steam Engine: Use fuel liquid, Work in progress 2016-02-27 12:41:46 +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
Mark 8f7d823633 Steam Engine: Replace fuel_amount with GetFuelAmount() where possible 2016-02-26 23:30:17 +01:00
Mark 52884fb685 Removed liquid container logic from pump.
Previously, sharing the logic made sense, because both objects used variables to store the liquid. Now, the liquid container stores liquid in an object - this is not desirable in the pump because it would create and remove objects for no good reason (only so that it has a virtual liquid storage) every time it pumps. Consequently, liquid objects cannot enter a pump anymore.
2016-02-26 23:17:38 +01:00
Mark fa0af84686 Fixed pump 2016-02-26 23:03:52 +01:00
Mark 351e61832c Liquid Container: Fixed liquid objects remaining in existence after test. 2016-02-26 22:38:38 +01:00
Mark af8e681ec8 Liquid Container: Let liquid object handle removing liquids 2016-02-26 22:11:11 +01:00
Mark 8a49ae10c0 Liquid Container: Removed logging 2016-02-26 22:06:04 +01:00
Mark 1acdfd4c1a Liquid object: Fixed unit test 3 2016-02-26 21:56:52 +01:00
Lukas Werling 2d4747029d Make analog axis strength symmetrical (0 to 2^15 - 1) 2016-02-26 20:40:07 +01:00
Mark 55401f88e3 Liquid object: Fixed unit test 12
Added test for filling an empty barrel partially
2016-02-26 15:42:54 +01:00
Mark 79df36eb6b Liquid object: Refactored object entering system.
Unit test 3 still fails, because the functions are not runtime overloadable. Test 12 fails, because liquid transfer does not work correctly yet. This fill be fixed in the next checkin.

Added debug logging, this has to be removed again later.
2016-02-26 15:19:41 +01:00
Lukas Werling 3a4e667f4d Implement mouse grabbing for GTK on X11 (#1637)
The same thing should somehow also be possible using gdk_device_grab(),
but I couldn't get it to work properly.
2016-02-25 18:21:53 +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
Lukas Werling e52bf6962b Fix gamepads only working after game start
This affected all platforms other than SDL.
2016-02-23 20:20:41 +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
Lukas Werling 8811356141 Make C4GamePadControl manage all controllers
The available gamepads are distributed automatically among players.

This also implements controller hot-plugging: It is possible to start a
game without a controller and plug it in later, and to reconnect a
controller after plugging it out.
2016-02-23 17:06:59 +01:00
Sven Eberhardt 771a333e21 Qt Editor: Add effects to object list view + fixes
Also remove cache of C4Values and use callbacks on object and effect deletion instead.
2016-02-21 22:23:42 -05: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
Lukas Werling 9e0143b998 Remove gamepad ids from key codes
We want one gamepad key mapping to work with multiple gamepads, so
including the id there doesn't make sense.

Additionally, the gamepad id may change during the game (controller
hot-plugging).
2016-02-21 18:27:02 +01:00
Lukas Werling 9f69c650d6 Use icons for all controller buttons
The icons currently only show Xbox 360 controller labeling. The icon set
also includes icons for PlayStation controllers, so we could extend this
in the future.
2016-02-21 18:27:02 +01:00
Lukas Werling 9e9505fdf3 Add and update documentation for all control changes 2016-02-21 18:27:02 +01:00
Lukas Werling 7155ff90eb Implement controller rumbling
New script functions:
 - PlayRumble(int plr, int strength, int length)
 - StopRumble(int plr)
2016-02-21 18:27:01 +01:00
Lukas Werling 046cacc26c Remove unused and unimplemented gamepad functions
- GamePadControl::AnyButtonDown
 - GamePadOpener::SetGamePad
2016-02-21 18:27:01 +01:00
Lukas Werling aa42d1deb7 Make controller button strings nicer
This also removes the controller id from the control definitions,
instead defaulting to 0. This doesn't change anything for now as we only
had definitions for controller 0 anyways.
2016-02-21 18:27:01 +01:00
Lukas Werling 24622f3a9c Update main menu GUI gamepad control bindings
It is now possible to control all GUI menus using the left stick or the
dpad, along with the A and B buttons on the controller.

This also doubles the button emulation dead zone to make navigating the
menus with the stick easier.
2016-02-21 18:26:44 +01:00
Lukas Werling 985f1b99e5 Make GetPlayerControlState() query the current controller state
To keep compatibility with scripts which expect only binary buttons,
this adds a third parameter to the function which enables the new
functionality.

Bonus /script to test the controller stick x axis:

    Schedule(GetCursor(), "Message(\"%d / %d\", GetPlayerControlState(0, CON_Left, true), GetPlayerControlState(0, CON_Right, true))", 10, 100000000)

Note that the values will be inconsistent if multiple analog sticks are
bound to the same control, as values from one stick will overwrite those
from the other one. This can happen even if you move only one stick.
2016-02-21 18:26:44 +01:00
Lukas Werling 1147d1a154 Fix openclonk-server build
SDL usage is masked with HAVE_SDL checks so it should work without SDL,
but SDL has to be linked when it's available.
2016-02-21 18:26:43 +01:00
Lukas Werling 8dd1450e94 Implement "gamepad stick moved" events for analog input
Analog moved events are only sent once per control frame.
2016-02-21 18:26:18 +01:00
Mark af6a31c489 Merge remote-tracking branch 'master' into liquid_container 2016-02-20 21:17:59 +01:00
Mark 862e69655e Liquid object: Test for liquid leaving the container 2016-02-20 21:10:41 +01:00
Mark 7cc88bd909 Liquid Object: Simplified transfer into liquid container.
Unfortunately, now the object is not actually transferred, but removed, and a new one is created or an existing one is filled in the liquid container. The logic could use a rework actually, because everything was more clear when the container stored things in variables.
2016-02-20 21:00:48 +01:00
Mark 9e46d752a9 Liquid Object: Unit test for entering liquid containers
The tests handles the entrance of liquid objects into the container. Will look to simplify the script in the next commit.
2016-02-20 20:14:19 +01:00
David Dormagen 63655f2763 global func Decay: some cleanups & added 'delay' parameter for decay speed 2016-02-20 17:57:55 +01:00
Mark d0cf26490e Removed unused function from erroneous merge 2016-02-20 17:31:26 +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
Mark 2dd09fc8bd Liquid Object: Dispersing contents is a function of the liquid object now, instead of the barrel
The object now also disperses if it exits a liquid container
2016-02-20 17:08:55 +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
Mark 8698aa25cf Object Interation Menu: Request displayed amount from objects
The special handling of the stackable library was moved from the interaction menu to that library. The reasoning behind this is that the menu should not have to know each and every object, but the objects should tell the menu how they are displayed.
Liquids are displayed by their liquid count now. It would be even better, if the max. capacity would be displayed without having to hover the description field.
2016-02-19 15:19:41 +01:00
Mark 8c578931bb Liquid Object: Replaced liquid container logic
The liquid container now stores liquid objects, instead of volume and liquid type. Liquid objects can have be of a specific type, such as Liquid_Water, Liquid_Oil, etc..., but they can also just stay Library_Liquid for other liquids.
The liquid container logic has become more complex now, but still works as before. Transferring liquids to other objects may still need some improvements:
- at the moment, transferring liquids between liquid containers is possible
- maybe liquids objects, such as oil, can enter a liquid container while another liquid is in that container already - will need a unit test for that
- transferring liquid from a liquid container to a structure or crew member should be possible (but is not yet), if the target is not a liquid container but contains liquid containers
2016-02-19 06:53:44 +01:00
Sven Eberhardt a4d28c383b Qt Editor: Implement object list view 2016-02-18 00:11:35 -05:00
Sven Eberhardt e0e09133d6 Qt Editor: Add some string translations. 2016-02-18 00:10:30 -05:00
Mark 9a2b8449ec Liquid objects: No stackable library 2016-02-17 06:49:53 +01:00
Mark 91adb6140a Fix/merge from rebase: BarrelIntake as property 2016-02-16 21:16:32 +01:00
Mark e2689ad1c3 Prototype: Liquid objects as menu icon
It seems that real objects would be nicer.
2016-02-16 21:08:23 +01:00
Mark 1cf04d24c5 Liquid objects: Enter liquid containers only 2016-02-16 21:08:18 +01:00
Mark 9b17e41900 Liquid objects: Adjusted producer 2016-02-16 21:08:14 +01:00
Mark e39dbe48db Prototype: Liquid objects
Stackable liquid objects, as a prototype for storing liquids
2016-02-16 21:08:09 +01:00
Mark da87ac2d69 Bugfix: Called wrong function 2016-02-16 21:08:04 +01:00
Mark ae9736c18b Move liquid libraries to sub-folder LiquidControl 2016-02-16 21:08:00 +01:00
Mark 7707c7237e Producer: Liquid can be extracted from the producer itself 2016-02-16 21:07:55 +01:00
Mark 1dbb81554d Refactoring: Removed the flagpole from power system test #21 2016-02-16 21:07:50 +01:00
Mark 651f5c806b Refactoring: Steam engine liquid extraction
The steam engine treats barrels the same as itself when it comes to extracting liquids. This removes the need for the callback OnFuelRemoved() in the barrel, as well as the stupid definition call from the barrel to the steam engine.
2016-02-16 21:07:46 +01:00
Mark 734987cd8d Steam engine: Reduced duplicate code 2016-02-16 21:07:41 +01:00
Mark fb397618df Failsafe barrel names 2016-02-16 21:07:36 +01:00
Mark 6f7152eba6 Fixed bug in barrel stacking and added a unit test for this use case 2016-02-16 21:07:31 +01:00
Mark 8e692a25c4 Use property instead of function for barrel intake 2016-02-16 21:07:17 +01:00
Mark acc5f26eca Cleanup
Removed reference to ST-DDT in the tank library, since his code was completely removed. Moved functions in steam engine. Fixed typo in DefCore.txt
2016-02-16 21:04:16 +01:00
Mark 1f54927aee Unit test for line connections 2016-02-16 21:04:11 +01:00
Mark be8fd0833c Oil-burning steam engine
The steam engine can burn oil as fuel now. Added test to power system unit test. Still needs support for actually getting oil into the engine.
Fixed a bug in LiquidContainer that would return no liquid if the entire contents are removed. Added unit test for said bug.
Fixed overspilling of connected liquid containers. Pump no longer counts as a liquid container/tank, so that it still spills liquid if no drain is connected.
2016-02-16 21:04:06 +01:00
Mark a0fb0473b3 Barrels function as fuel now.
The steam engine does not remove the barrels, it just empties them. Made power system unit test 19 end if both pumps are pumping, this seems to be the intention of the unit test. Added power system unit test 20: Steam engine fueled by oil barrels.
2016-02-16 21:04:01 +01:00
Mark cce260a9a7 Refactoring: Steam engine
Made the steam engine interface more modular, removing duplicate code. Added a callback when refilling fuel that allows the objects not to be removed. This is important for barrels, because barrels will just empty their contents, they should not vanish!
2016-02-16 21:03:57 +01:00
Mark 07b242d6b1 Barrels accept oil 2016-02-16 21:03:52 +01:00
Mark 0c873a1950 Material: Oil
Added the material, does not burn yet, has no value in the game for now
2016-02-16 21:03:48 +01:00
Mark e985ffbd45 Changed pipe interface
- connect / disconnect callbacks do not include the line anymore
- the drain and source pipes are set to the pipe now, instead of the line
2016-02-16 21:03:43 +01:00
Mark 611655a9ce Removed comments 2016-02-16 21:03:38 +01:00
Mark 2099146839 Adjusted unit test so that it works with the new interface 2016-02-16 21:03:34 +01:00
Mark 06f3e26ad5 Bugfix: Errors in UnitTest upon destruction of the pipe 2016-02-16 21:03:29 +01:00
Mark d6f600bbd2 Bugfix: Message displayed above clonk, instead of connected structure 2016-02-16 21:03:24 +01:00
Mark e99ab4471a Refactoring: Completely remodeled pipe interface
Pipes can connect to nearly anything now. The connecting object is responsible for rejecting the connection.
2016-02-16 21:03:20 +01:00
Mark 4d2a661763 Analysis: Pipe object
The pipe object is very convoluted at the moment. Worked out some requirements for the object and will implement many things in a clean way.
2016-02-16 21:03:15 +01:00
Mark 5c83545900 Refactoring: Replaced pump internal liquid storage with library function calls
The pump actually stores liquid until it can pump. This may not be desired, but it was like that before my changes already. This probably is better than having it drop excess material at the pump.
2016-02-16 21:03:10 +01:00
Mark 30352e422e Refactoring: Replaced pump pipe variables with library function calls 2016-02-16 21:03:06 +01:00
Mark 9c28cb978a Analysis for refactoring 2016-02-16 21:03:01 +01:00
Mark 371fdaeaa6 Refactoring: Pump interface names
The pump uses the same function names as the liquid tank now. This is a preparation for the consolidation of the two.
2016-02-16 21:02:56 +01:00
Mark e1627a2619 Pump liquids to liquid containers
The pump can transfer liquids to and from liquid containers now. Changed the material storage from material index to material name now, because liquid containers may contain fantasy liquids, too. The pipe cannot output such imaginary liquids though, so only transfer between compatible containers is possible.
2016-02-16 21:02:51 +01:00
Mark 427cacfbba Bugfix: Insert at wrong object 2016-02-16 21:02:46 +01:00
Mark 7b573691a4 Bugfix: Wrong menu entry in pump 2016-02-16 21:02:41 +01:00
Mark cc2b0aa15b Connection in Liquid Tank
The liquid tank can connect and deconnect lines properly now
2016-02-16 21:02:37 +01:00
Mark 97bdd342fc Refactoring: Pump, pipe, better menu handling
The pipe can be connected from the interaction menu now, too. Expanded the disconnection logic, because more problems arise when the pipe can still be connected to other structures - it would be sufficient to remove the line, but that could be annoying:
- if the pipe is connected to a container, then you can disconnect the pipe from that liquid tank and it will still be connected to the pump
- if you disconnect the pipe from the pump, then it will disconnect from the liquid tank as well

Maybe this is confusing to the user, we can still kick that out later again.
2016-02-16 21:02:32 +01:00
Mark fbdd5eeb09 Refactoring: Pimp, Pipe, SteamEngine
Now it is possible to connect lines from a pump to the steam engine. This is achieved by the steam engine being a liquid tank. It did not seem good to allow connection from pumps to all liquid containers (i.e. barrels). A liquid tank is also a liquid container, they share the same interface, but it is also a structure.

It is not yet possible to fill the steam engine with any liquid though, because it is not defined what kind of liquid it accepts. This will be oil in the future. Furthermore, the behaviour when the pump adds incompatible liquid is not defined yet.
2016-02-16 21:02:28 +01:00
Mark 75ebbb2851 Library: Tank
Drain and source pipes can be connected to the tank
2016-02-16 21:02:23 +01:00
Mark 94d47aa2ba Pump: Menu action constants
Replaced the hardcoded strings in the pump interaction menu with constants.
2016-02-16 21:02:18 +01:00
Mark a4058777f0 Library: Liquid Container
Added inherited-call to Construction()
2016-02-16 21:02:13 +01:00
Mark 6f557520e8 Refactoring: Renamed Set/GetLiquidName to Set/GetLiquidType 2016-02-16 21:02:09 +01:00
Mark 9a8c3f4fea Refactoring: Barrel fill with liquid
The function had some crazy checks and delegation, now everything is in one function
2016-02-16 21:02:04 +01:00
Mark 9d17cff91e Refactoring: Removed old barrel functions
Replaced old barrel functions with the liquid container library calls
2016-02-16 21:01:59 +01:00
Mark 2f5cc035b6 Library: Liquid Container
Added unit test.
2016-02-16 21:01:55 +01:00
Mark b64a0e852a Library: Liquid Container
Added a new library for liquid containers that is based on the original barrel script.

Library_LiquidContainer
- Extracted the interface from the barrel. The function names and argument types are not final yet.
- Fixed an inconsistency in the script: There were two ways of determining whether a barrel is suited
   for a material. Either by name, or material index.
- renamed argument names to "liquid_name" for liquids, "amount" for quantities, so that the code is more easily understandable
- replaced comparison 'fill level > 0' with 'is not empty?'
- moved storage variables to a local proplist, so that names do not clash
- Ordered the methods by application and documented each section

Barrel:
- The original barrel functions delegate to Library_LiquidContainer-functions now, so that the original functionality is not disturbed. Obsolete functions are marked with "TODO: deprecated".
- Moved barrel value change to the update function
- Moved hit sound effect to separate function
- Replaced uses of the magic number '3' with a runtime-overloadable call to GetBarrelIntakeY()
- Replaced comparison 'fill level > 0' with 'is not empty?'

MetalBarrel:
- Adjusted the hit function. The difference between this and the normal barrel is the hit sound and material position. These should be constants or functions, instead of magic numbers
- Moved hit sound effect to separate function
- Removed the Hit()-function, because the hit sound is played in a separate function now
- With this change the y-offset of the barrel checking for other liquids on a hit is now 3 instead of 7. This should be ok, because the barrels have the same dimensions, it seemed strange that they would have different offsets
2016-02-16 21:01:50 +01:00
Mark 35604ec1ac Pump interface:
The pump gets the interfaces ExtractMaterialFromSource and InsertMaterialAtDrain that allow for overloading the pumping process
2016-02-16 21:01:46 +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
Mark c73993d442 Prototype: Liquid objects as menu icon
It seems that real objects would be nicer.
2016-02-16 18:41:19 +01:00
Mark bb74e69fa4 Liquid objects: Enter liquid containers only 2016-02-16 18:14:54 +01:00
Mark bd0923d057 Liquid objects: Adjusted producer 2016-02-16 18:14:32 +01:00
Mark fb627f3024 Prototype: Liquid objects
Stackable liquid objects, as a prototype for storing liquids
2016-02-16 06:57:26 +01:00
Mark 5200dcf724 Bugfix: Called wrong function 2016-02-16 06:29:01 +01:00
Mark 3481f5e830 Move liquid libraries to sub-folder LiquidControl 2016-02-16 06:16:34 +01:00
Mark 190eacb5f0 Producer: Liquid can be extracted from the producer itself 2016-02-16 06:13:38 +01:00
Sven Eberhardt 2af22ee824 New editor (Qt-based)
Work in progress. So far only for Windows.
2016-02-15 08:38:06 -05: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
Lukas Werling 937ddaf722 Update key code strings for game controllers
With the SDL_GameController interface, buttons and axes have actual
names we can refer to. This also allows for advanced mappings using both
sticks (this probably needs script changes) as well as the triggers.
2016-02-13 23:28:00 +01:00
Nicolas Hake ad01c2e48f Fix NULL deref when deserializing CustomNode AnimationNodes (GH #13) 2016-02-13 23:22:21 +01:00
Günther Brammer c9c8b0c408 Move modifier key masks to the keycode definitions 2016-02-13 22:36:41 +01:00
Günther Brammer 544c1cbb4b CMake: Remove unused HAVE_X11_KEYSYM_H 2016-02-13 22:36:41 +01:00
Nicolas Hake ec0055f260 Link to terminfo or one of its compat libraries in add'n to readline
Unmodified readline relies on, but doesn't link to, a termcap library.
Several Linux distributions patch this, but others don't; to avoid build
failures, we'll just link to a library that provides termcap symbols
even though we don't use them ourselves. Fixes Github #15.
2016-02-13 22:15:35 +01:00
Nicolas Hake acafce33b0 CMake: Use target_compile_definitions instead of setting the property 2016-02-13 21:56:34 +01:00
Lukas Werling bd3f020068 Replace Joystick controls with SDL GameController 2016-02-13 21:03:19 +01:00
Lukas Werling 9c840724f2 Re-enable gamepad controls 2016-02-13 18:42:23 +01:00
Sven Eberhardt a69958554f Melting Castle: Add IceWallKit spawn
To promote more waling attacks and walling defenses.
2016-02-13 10:43:42 -05:00
Lukas Werling 97f06fd0cd Fix openclonk-server build 2016-02-12 22:40:55 +01:00
Günther Brammer c332fe940b Merge branch 'sdl-mouse' 2016-02-12 21:11:21 +01:00
Lukas Werling 24ef8b43af Grab the mouse while in-game (#1637)
This only implements this for the SDL port for now.
2016-02-12 21:09:40 +01:00
Günther Brammer 92217e51e0 GLX: Use gdk instead of XLib to make glXCreateContextAttribsARB not exit 2016-02-12 20:39:39 +01:00
Günther Brammer 0c0c64642a Remove unused #define in C4AulParse 2016-02-12 17:15:46 +01:00
Sven Eberhardt ba3160c4c3 Fix crash when console window creation fails 2016-02-11 23:35:38 -05:00
Lukas Werling f505b31032 SDL: Fix mouse button handling
- The right mouse button didn't work at all.

 - The left mouse button stopped working when clicking multiple times
   without moving the cursor.
2016-02-11 22:29:10 +01:00
Lukas Werling 392b7bab72 SDL: Add support for the mouse wheel
Fixes #0001682
2016-02-11 22:17:42 +01:00
Mark 5224eb5b18 Goal Resource: Variable amounts of exploitation
It is possible to set the amount of resources to be extracted with an additional parameter in SetResource() now. The default amount to be extracted is 95 percent, which is the same behaviour as before the changes.
2016-02-11 22:16:19 +01:00
Mark 3993a41cea Goal Resource: Code comments
Some more fine tuning, code comments.
2016-02-11 22:04:22 +01:00
Mark 03d4662811 Goal Resource: Readability
Made the lines more readable.
2016-02-11 21:56:14 +01:00
Mark f122346241 Goal Resource: exploitable_units
Renamed mat_cnt. Will make the lines more readable in the next commit.
2016-02-11 21:50:50 +01:00
Mark 9fa4632a48 Goal Resource: ExploitableObjectCount()
Extracted the division by blast_ratio to a function. This should help again when expanding to diggable materials.
2016-02-11 21:42:19 +01:00
Mark a4d2edd0d2 Goal Resource: ObjectCount2MaterialCount()
Deciphered what some of the functions are good for, since the original code is kind of cryptic. This should help again when expanding to diggable materials.
2016-02-11 21:35:59 +01:00
Mark 50b4d6bae8 Goal Resource: AvailableObjectCount()
Replaced the ObjectCount() calls with a function. This should make it easier to expand the script to diggable materials later.
2016-02-11 21:20:13 +01:00
Mark d9e75aaaba Goal Resource: Improved variable names
Renamed indices, removed unused variables.
2016-02-11 21:06:38 +01:00
Mark 5c2dcf41a3 Goal Resource: Improved variable names
Extracted functions that were used multiple times and use consistend naming for material.
2016-02-11 21:02:16 +01:00
Maikel de Vries b7766780c5 fix plane for several C4D_None objects which where C4D_Structure before 2016-02-10 22:40:44 +01:00
David Dormagen 77bdc8e841 disallow collection via shift when contained (#1677) 2016-02-10 18:12:09 +01:00
Lukas Werling 29491ec3b7 Replace lots of empty parameters with proplist for Sound() 2016-02-10 13:31:16 +01:00
Lukas Werling 4ca5d2bb40 Add variants of Sound(At) taking a proplist for options 2016-02-10 13:14:06 +01:00
Mark bfb3d0cc8b Refactoring: Removed the flagpole from power system test #21 2016-02-10 06:22:38 +01:00
Mark 7a3be2dd62 Refactoring: Steam engine liquid extraction
The steam engine treats barrels the same as itself when it comes to extracting liquids. This removes the need for the callback OnFuelRemoved() in the barrel, as well as the stupid definition call from the barrel to the steam engine.
2016-02-10 06:21:13 +01:00
Nicolas Hake 5f895c14fc Materials: Fix misspelling of "Incendiary" (#1680)
The wrong spelling will still be accepted as a material value, as long
as no value with the correct spelling exists.
2016-02-09 23:45:02 +01:00
Nicolas Hake 6f669e7b49 Merge remote-tracking branch 'github/pull/11' 2016-02-09 22:18:49 +01:00
David Dormagen 91391c64af draw global particles on plane 900
Previously, global particles would be drawn even in front of Plane 1000+ (GUI) objects. Additionally, it was impossible to specify particles that were supposed to always be in front of all other particles (e.g. fog, clouds, emulated FoW, ...).
Now, you can attach particles to an object on plane 901+ and have them be in front of everything else.
2016-02-09 20:43:23 +01:00
Maikel de Vries 99d5a7c8c9 lorry: play a sound when dumping contents 2016-02-09 19:33:30 +01:00
Mark 514eae0102 Steam engine: Reduced duplicate code 2016-02-09 18:49:09 +01:00
Mark f0a1e41ac2 Failsafe barrel names 2016-02-09 18:30:50 +01:00
Mark 80fda5ae0d Fixed bug in barrel stacking and added a unit test for this use case 2016-02-09 06:43:38 +01:00
Armin Burgmeier 582cba01ed Build Fix 2016-02-08 21:28:44 -08:00
Mark c135c2da37 Use property instead of function for barrel intake 2016-02-09 06:27:42 +01:00
Nicolas Hake 43aa11623a Fix off-by-one error in FoW renderer (#1678)
The FoW renderer would try drawing to texture coordinates one pixel
too high (i.e. if the texture was 256 pixels high, it would draw to
pixels with 1 <= y <= 256 instead of 0..255).
2016-02-08 22:58:18 +01:00
Nicolas Hake a204439f80 C4FontLoader: Stop manually managing memory
Instead of implementing a dynamically growable array with new and delete
and memcpy like cavemen, we'll use a vector of smart pointers.
2016-02-08 22:58:17 +01:00
Maikel de Vries 47d6f2d75a disable contact calls for dead bats (#1676) 2016-02-08 21:25:43 +01:00
Maikel de Vries 159dbf071f make ContactCalls a property instead of DefCore entry
This allows for useful runtime changes, like disabling contact calls when an animal dies.
2016-02-08 21:25:43 +01:00
Mark b0153fbc51 Cleanup
Removed reference to ST-DDT in the tank library, since his code was completely removed. Moved functions in steam engine. Fixed typo in DefCore.txt
2016-02-08 20:54:26 +01:00
Mark cc113a560b Unit test for line connections 2016-02-08 17:45:32 +01:00
Nicolas Hake 3fb3f45a35 MSVC: Disable non-conforming conversion from string literal to char*
C++11 forbids conforming compilers from performing the deprecated
conversion from a string literal to non-const char* or wchar_t*. Most
compilers however still do it by default because not doing it breaks
lots of legacy code. We don't have any of this legacy code anymore, so
we can disable the conversion.
2016-02-08 17:36:50 +01:00
Nicolas Hake 142b7ea7c3 RegCreateKeyEx: Pass NULL as lpClass
The lpClass parameter isn't used, and it is valid to pass NULL for it.
It is, however, not valid to pass a string literal, because the
conversion to nonconst char* has been deprecated in C++ for a long time
and doesn't exist anymore in C++11.
2016-02-08 17:36:50 +01:00
Nicolas Hake d5dbcb71da ShowGfxErrorDialog: Fix handle leak
CreateProcessW will return a handle the main thread and a process handle
to the child process. These handles must be closed to avoid a resource
leak.
2016-02-08 17:36:50 +01:00
Nicolas Hake 3d9b322f51 Fix incorrect CreateProcessW call
Quoth MSDN: "The Unicode version of this function, CreateProcessW, can
modify the contents of this string. Therefore, this parameter cannot be
a pointer to read-only memory (such as a const variable or a literal
string). If this parameter is a constant string, the function may cause
an access violation."

It can, however, be NULL, which does the right thing automatically.
2016-02-08 17:36:50 +01:00
Nicolas Hake 64a5388d4d C4Surface: Remove broken "support" for split textures
Most code already didn't handle textures larger than GL_MAX_TEXTURE_SIZE
and only used the first one in case of a split texture.
2016-02-08 17:36:50 +01:00
Nicolas Hake 7b04914fc4 C4Surface: Make dbg_index unsigned int instead of int*
It seems like an odd decision to add a layer of indirection to this,
especially since it's just a pointer to int instead of a pointer to a
larger structure.
2016-02-08 17:36:50 +01:00
Nicolas Hake 059e9e7060 C4Surface: Explicitly mark copy ctor/assignment op deleted 2016-02-08 17:36:50 +01:00
Maikel de Vries 3e5bec1ffd tutorial 7: add interaction to call the airship (#1595) 2016-02-08 17:32:30 +01:00
Maikel de Vries c4c8362ef8 tutorial 3: ensure progress if sawmill is completed in a diffent way (#1674)
for example if the pieces of rock are put into the site one by one.
2016-02-08 15:27:58 +01:00
Maikel de Vries a88a890960 tutorial 7: explain cycling through multiple interactions (#1599) 2016-02-08 15:27:58 +01:00
Maikel de Vries 0d358ce45b tutorial 4: make sure player hacks out ore at the right location (#1675) 2016-02-08 15:27:58 +01:00
Maikel de Vries 04877e33da do not test permeable solid mask on the elevator case in master
This messes up so many things as one could have expected. Instead we do the sensible thing and enable it only in the test scenario. For future reference all sequences involving an elevator and NPC clonks are broken with this feature.
2016-02-08 15:27:58 +01:00
Maikel de Vries 933314165b tutorial 2: fix confusing formulation for dropping items (#1633) 2016-02-08 15:27:58 +01:00
Maikel de Vries 8128b8db33 tutorial 2: improve message to make loam bridge (#1634) 2016-02-08 15:27:58 +01:00
David Dormagen 76f971e9d9 interaction highlight: limit highlight's Plane for objects behind the Clonk
Otherwise, a catapult might appear to shine through the Clonk. This might look odd.
For objects in front the the Clonk, the GUI-Plane is kept.
2016-02-08 12:35:42 +01:00
David Dormagen c6da7d54aa interaction highlight: create selector particle with a slight delay
Only on first selection, though.
http://forum.openclonk.org/topic_show.pl?pid=31112#pid31112
2016-02-08 12:31:54 +01:00
Mark 3e71b81e5f Oil-burning steam engine
The steam engine can burn oil as fuel now. Added test to power system unit test. Still needs support for actually getting oil into the engine.
Fixed a bug in LiquidContainer that would return no liquid if the entire contents are removed. Added unit test for said bug.
Fixed overspilling of connected liquid containers. Pump no longer counts as a liquid container/tank, so that it still spills liquid if no drain is connected.
2016-02-08 08:32:27 +01:00
Nicolas Hake 5fe327663f Fix signed int overflow in BltAlpha (#1661)
The red color channel calculation could overflow into the sign bit,
which is undefined behavior. At least one compiler takes advantage of
this and assumes it cannot happen, resulting in incorrect results.

BltAlphaAdd looks similar, but does in fact not have this bug because it
shifts the color channel far enough that multiplication can't overflow.
2016-02-08 02:39:54 +01:00
Nicolas Hake 4fdafbc78a Move StdColors.h ref from C4Surface.h to files that actually need it
C4Surface.h doesn't require anything from StdColors.h, so there's no
reason to reference the latter there.
2016-02-08 02:13:18 +01:00
Sven Eberhardt c9d3cd7417 Add MeltingCastle team melee 2016-02-07 17:21:14 -05:00
Maikel de Vries 1ebdc31182 add tutorial 6
Still intro, outro and some NPCs missing.
2016-02-07 21:29:27 +01:00
Maikel de Vries 2a4fa85583 tutorials: fix some descriptions and control strings 2016-02-07 21:29:27 +01:00
Sven Eberhardt 8273dcdf45 Fix cargo attachment vertex in balloon 2016-02-07 14:49:05 -05:00
Sven Eberhardt 3d3e848aeb Target balloon: Allow deployment of any items. 2016-02-07 14:27:51 -05: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 ef032c60fa ItemSpawn: Simplify script, add team-only spawns, add scenario saving and add sound on collection.
The script now just sets visibility per player (VIS_Select) instead of creating one dummy object per player. It also uses the object directly instead of indirecting everything through an effect (the effect couldn't be used on other objects anyway).
2016-02-07 12:21:13 -05:00
Mark b6476330d4 Barrels function as fuel now.
The steam engine does not remove the barrels, it just empties them. Made power system unit test 19 end if both pumps are pumping, this seems to be the intention of the unit test. Added power system unit test 20: Steam engine fueled by oil barrels.
2016-02-07 17:13:03 +01:00
Sven Eberhardt 79897ce777 Move ItemSpawn from Aerobatics to main Objects. 2016-02-07 10:43:24 -05:00
Mark 1940791e8a Refactoring: Steam engine
Made the steam engine interface more modular, removing duplicate code. Added a callback when refilling fuel that allows the objects not to be removed. This is important for barrels, because barrels will just empty their contents, they should not vanish!
2016-02-07 16:29:15 +01:00
Mark 46fceea0e0 Barrels accept oil 2016-02-07 16:03:51 +01:00
David Dormagen 28ffc3d3b1 Library_Constructor: use normal single-use instead of holding-use
..because the library wasn't actually USING the holding callback at all. And it had/has its own CON_Aim hackery anyway. No need for the control-library internal CON_Aim stuff then (I could imagine this might just lead to issues at some point).
2016-02-07 10:47:33 +01:00
David Dormagen d9760cdab6 controls: properly set noholdingcallbacks to false when using ControlUseStart (#1327)
Otherwise the situation could arise where you used a ControlUseStart object (the wallkit) but noholdingcallbacks was still set to true (because e.g. you used a hammer before). Then you would not be able to move the preview.
This is described in a comment to the referenced bug.
2016-02-07 10:47:33 +01:00
David Dormagen 59739b5cf6 script GUIs: do not catch mouse-up without prior mouse-down (#1327)
Otherwise, you could open a menu on mouse-down, which would then block the mouse-up event. The control system (not the script but the engine!) would then never know that the button was released and issue a key event with repeated=1 when you pressed the button the next time.
This could lead to issues.
2016-02-07 10:47:33 +01:00
Maikel de Vries 148b217003 jet stream: do not attempt to move stuck objects 2016-02-07 10:24:36 +01:00
Maikel de Vries a44b759472 snap digging angle to straight lines with 5 degree margin 2016-02-07 10:24:36 +01:00
Maikel de Vries 978b236596 clean up shovel script 2016-02-07 10:24:36 +01:00
Maikel de Vries 145b902f65 correctly handle SetDir for the catapult
Ideally the script is fully changed to correctly use dir.
2016-02-07 10:19:11 +01:00
Maikel de Vries 0a928d4a11 tutorials: various small fixes 2016-02-07 10:19:11 +01:00
Sven Eberhardt 1e5b04e2d1 WallKit preview: Add function to update independent of position. 2016-02-06 23:53:45 -05:00
Sven Eberhardt d213115103 Add function to CTF flag to disable pickup.
To be used by scenarios that use the flag differently.
2016-02-06 22:45:53 -05:00
Sven Eberhardt 775533a8da Catapult and cannon: Add functions to rotate instantly.
Useful for scenario designers.
2016-02-06 22:45:14 -05:00
Sven Eberhardt 439b1f481c Register Objects.c script as global constant to make it accessible from outside 2016-02-06 21:12:22 -05:00
Sven Eberhardt 43451a4242 HotIce: Lower spawn position on explosive mode with small islands 2016-02-06 20:40:44 -05:00
Günther Brammer b129e5f210 gtk: Remove unused variable 2016-02-06 23:48:13 +01:00
Günther Brammer 23d34f75ec Remove some dead graphics code 2016-02-06 23:46:58 +01:00
Günther Brammer 2434b22b20 Improve SDL2 OpenGL context error message 2016-02-06 23:46:58 +01:00
Mark 3e85cdce92 Material: Oil
Added the material, does not burn yet, has no value in the game for now
2016-02-06 23:22:00 +01:00
Mark ecff731d96 Changed pipe interface
- connect / disconnect callbacks do not include the line anymore
- the drain and source pipes are set to the pipe now, instead of the line
2016-02-06 23:12:26 +01:00
Mark e08e8fbb51 Removed comments 2016-02-06 22:50:43 +01:00
Sven Eberhardt 44121a00eb MAPALGO_Scale: Fix scaling coordinates for common case of blitting scaled surfaces from one surface to another. 2016-02-06 16:10:34 -05:00
Günther Brammer 4b4b8781a0 Make GTK+ and SDL2 work together
If the gamepad code initialized the SDL video subsystem, GTK+ crashed in
libX11. Or something along those lines.

Making the optional subsystems using SDL for gamepads and audio use
SDL_InitSubSystem and only the SDL Application port do the full SDL_Init
is the proper way to do things in any case.
2016-02-06 21:12:56 +01:00
Sven Eberhardt 623f838799 Add sounds: Hits::BucketHit*, Structures::DoorOpen*, Structures::DoorClose* by ala 2016-02-06 14:37:18 -05:00
Günther Brammer 32d8d0db76 Finish the update from SDL_Mixer to SDL2_Mixer 2016-02-06 17:28:15 +01:00
Mark 33c35d1de4 Adjusted unit test so that it works with the new interface 2016-02-06 09:07:18 +01:00
Mark 58650c5b6e Bugfix: Errors in UnitTest upon destruction of the pipe 2016-02-06 09:06:50 +01:00
Mark aa61a14d3d Bugfix: Message displayed above clonk, instead of connected structure 2016-02-06 08:28:02 +01:00
Mark ec6f26ddd0 Refactoring: Completely remodeled pipe interface
Pipes can connect to nearly anything now. The connecting object is responsible for rejecting the connection.
2016-02-05 23:17:31 +01:00
Mark 1603f23514 Analysis: Pipe object
The pipe object is very convoluted at the moment. Worked out some requirements for the object and will implement many things in a clean way.
2016-02-05 06:58:00 +01:00
Mark 8378580491 Refactoring: Replaced pump internal liquid storage with library function calls
The pump actually stores liquid until it can pump. This may not be desired, but it was like that before my changes already. This probably is better than having it drop excess material at the pump.
2016-02-05 06:42:55 +01:00
Mark f02dc7cd95 Refactoring: Replaced pump pipe variables with library function calls 2016-02-05 06:34:50 +01:00
Mark 0407ad71c4 Analysis for refactoring 2016-02-05 06:31:49 +01:00
Mark f5681434dc Refactoring: Pump interface names
The pump uses the same function names as the liquid tank now. This is a preparation for the consolidation of the two.
2016-02-05 06:22:26 +01:00
Mark 1ca0484f21 Pump liquids to liquid containers
The pump can transfer liquids to and from liquid containers now. Changed the material storage from material index to material name now, because liquid containers may contain fantasy liquids, too. The pipe cannot output such imaginary liquids though, so only transfer between compatible containers is possible.
2016-02-04 22:58:06 +01:00
Mark 910cf0011d Bugfix: Insert at wrong object 2016-02-04 22:23:52 +01:00
Mark 74ae56b056 Bugfix: Wrong menu entry in pump 2016-02-04 22:19:00 +01:00
Mark 788324c077 Connection in Liquid Tank
The liquid tank can connect and deconnect lines properly now
2016-02-04 22:18:40 +01:00
Mark affb034b86 Refactoring: Pump, pipe, better menu handling
The pipe can be connected from the interaction menu now, too. Expanded the disconnection logic, because more problems arise when the pipe can still be connected to other structures - it would be sufficient to remove the line, but that could be annoying:
- if the pipe is connected to a container, then you can disconnect the pipe from that liquid tank and it will still be connected to the pump
- if you disconnect the pipe from the pump, then it will disconnect from the liquid tank as well

Maybe this is confusing to the user, we can still kick that out later again.
2016-02-04 21:37:33 +01:00
Mark 016922fa2c Refactoring: Pimp, Pipe, SteamEngine
Now it is possible to connect lines from a pump to the steam engine. This is achieved by the steam engine being a liquid tank. It did not seem good to allow connection from pumps to all liquid containers (i.e. barrels). A liquid tank is also a liquid container, they share the same interface, but it is also a structure.

It is not yet possible to fill the steam engine with any liquid though, because it is not defined what kind of liquid it accepts. This will be oil in the future. Furthermore, the behaviour when the pump adds incompatible liquid is not defined yet.
2016-02-04 18:25:19 +01:00
Mark 65bc68af3e Library: Tank
Drain and source pipes can be connected to the tank
2016-02-03 06:58:41 +01:00
Günther Brammer fdbad8fe83 Simplify the test for loop end in parameter parsing
Instead of storing in fDone whether the token is a ')', make that the loop
condition.
2016-02-02 02:57:50 +01:00
Günther Brammer f1b99aa355 Avoid pushing and popping an unused parameter with ... 2016-02-02 02:57:49 +01:00
Günther Brammer 6a6c0d8b0b Optionally warn about too many parameters in -> calls, too
While at it, only consult the right function for direct calls, not any
other function with the same name.
2016-02-02 02:57:49 +01:00
Günther Brammer b2c263bd0e Don't mark the condition of do-while as a jump target without a continue
In contrast to the other loops, where the condition is always jumped to.
2016-02-02 02:57:49 +01:00
Günther Brammer 00f013d59e Optimize accessing the same variable as was just now set 2016-02-02 02:57:49 +01:00
Günther Brammer b7eff7f55f Set jump target flag for bytecode added after MakeSetter removed one
Also avoid removing the original bytecode if it is DUP, LOCALN or GLOBALN.
This way, setting the jump target flag can be avoided in some cases.
2016-02-02 02:57:49 +01:00
Günther Brammer 532b47ed27 Optimize do; while(!...) from two bytecodes to one
This revealed that the code for setting Par.i was wrong before, but didn't
matter because the jump target for all CONDN was set afterwards. But the
jumptarget for COND was set directly, and must be adjusted to account for
the bytecode that gets optimized away.
2016-02-02 02:57:49 +01:00
Günther Brammer 168ac8bb40 Remove pointer to start of variables from function context
It pointed always to Pars + Func->GetParCount(). The only users were
VARN_CONTEXT, which can be replaced with PARN_CONTEXT that way, and
FOREACH_NEXT, where the parser can do the math and simply give a number
relative to the current stack position, like regular variable usages do.
2016-02-02 02:57:48 +01:00
Günther Brammer 45003d55fb Guard against script stack overflow on the first script call, too
This can happen when an engine function is made to call a script function
when the stack is almost exhausted. Since there was nothing catching that
exception, it'd mean a program abort. Move the bulk of the exception
handler to the outer Exec function, and only keep the saving of the exact
code position in the inner one.

While at it, simplify the pushing of the parameters to simply push the
right amount of parameters instead of pushing ten and then popping the
excess. Also move the creation of dummy parameters for DirectExec into
DirectExec().
2016-02-02 02:57:48 +01:00
Günther Brammer 5bb3d7cb77 Use a null C4ScriptHost to parse DirectExec code
This mostly makes Parse_Expression use the case for functions in proplists
instead of the other for local variable lookup.
2016-02-02 02:57:48 +01:00
Günther Brammer ac9106d197 Remove some unused and unsound C4Value operators 2016-02-02 02:57:48 +01:00
Günther Brammer 39d04360c4 Add some const (C4StringTable::FindString) 2016-02-02 02:57:48 +01:00
Günther Brammer 87689d9f49 Move the global proplist from a member of ScriptEngine to an ancestor
While at it, denumerate the global proplist. Not that it contains anything
to denumerate, but someday it might?
2016-02-02 02:57:48 +01:00
Günther Brammer 6f98fb2e66 Remove C4AulScript class
It isn't needed to hold engine functions anymore, because those are just
put into C4PropLists.
2016-02-02 02:57:47 +01:00
Günther Brammer 9dafc6424b Make the ScriptEngine not a C4AulScript
Every script has its own C4ScriptHost, the ScriptEngine doesn't use
anything from C4AulScript.
2016-02-02 02:57:47 +01:00
Günther Brammer 473415bafa Stop using virtual functions to distinguish profiling all or some functions 2016-02-02 02:57:47 +01:00
Günther Brammer 9742a404ff Move Script Parser warning function to C4ScriptHost 2016-02-02 02:57:47 +01:00
Günther Brammer a6020197d7 Move script string table to C4ScriptHost
The string table in C4AulScriptEngine was never loaded.
2016-02-02 02:57:47 +01:00
Günther Brammer d3890f8c99 Remove empty C4AulScript::Clear()
The virtual call was only made from ~C4AulScript, and the deriving classes
already called their own Clear() from their own destructors.
2016-02-02 02:57:47 +01:00
Günther Brammer b21acff0c7 Move Scriptparser State into C4ScriptHost 2016-02-02 02:57:46 +01:00
Günther Brammer 2fe0beebdb Move contents of src/gamescript into other directories
C4Effect will get moved into the ScriptEngine, and just three source files
is a bit too little for one directory.
2016-02-02 02:57:46 +01:00
Günther Brammer 593e0319fd Show script stacktraces when GameCallEx causes a script error 2016-02-02 02:57:46 +01:00
Günther Brammer 2ebd1a98ad Script: Functions in constant proplists can access their properties 2016-02-02 02:57:46 +01:00
Günther Brammer f757706e68 Make the C4Script tokenizer context-independant 2016-02-02 02:57:46 +01:00
Günther Brammer 9193c8938b Retire the split between Parse_Expression and Parse_Expression2
In earlier C4Script versions, there were multiple variants of expressions,
all followed by the same operator options, but nowadays everything is more
uniform.
2016-02-02 02:57:46 +01:00
Günther Brammer c444f85bae Add more C4Script tests
This time exercising some code I managed to break by adding more
optimizations.
2016-02-02 02:57:45 +01:00
Günther Brammer 1e8dafd75d Fix Translate AulTest when compiling without string deduplication 2016-02-02 02:57:45 +01:00
Mark 11e7536b19 Pump: Menu action constants
Replaced the hardcoded strings in the pump interaction menu with constants.
2016-02-01 18:08:55 +01:00
Mark d9853d9758 Library: Liquid Container
Added inherited-call to Construction()
2016-02-01 06:41:15 +01:00
Mark 8c883937d4 Refactoring: Renamed Set/GetLiquidName to Set/GetLiquidType 2016-02-01 06:39:21 +01:00
Mark dbf1f0326f Refactoring: Barrel fill with liquid
The function had some crazy checks and delegation, now everything is in one function
2016-02-01 06:28:17 +01:00
Mark 9ee44b39ed Refactoring: Removed old barrel functions
Replaced old barrel functions with the liquid container library calls
2016-02-01 06:28:09 +01:00
Mark 64f7b4152e Library: Liquid Container
Added unit test.
2016-02-01 06:27:35 +01:00
Mark f810f210be Library: Liquid Container
Added a new library for liquid containers that is based on the original barrel script.

Library_LiquidContainer
- Extracted the interface from the barrel. The function names and argument types are not final yet.
- Fixed an inconsistency in the script: There were two ways of determining whether a barrel is suited
   for a material. Either by name, or material index.
- renamed argument names to "liquid_name" for liquids, "amount" for quantities, so that the code is more easily understandable
- replaced comparison 'fill level > 0' with 'is not empty?'
- moved storage variables to a local proplist, so that names do not clash
- Ordered the methods by application and documented each section

Barrel:
- The original barrel functions delegate to Library_LiquidContainer-functions now, so that the original functionality is not disturbed. Obsolete functions are marked with "TODO: deprecated".
- Moved barrel value change to the update function
- Moved hit sound effect to separate function
- Replaced uses of the magic number '3' with a runtime-overloadable call to GetBarrelIntakeY()
- Replaced comparison 'fill level > 0' with 'is not empty?'

MetalBarrel:
- Adjusted the hit function. The difference between this and the normal barrel is the hit sound and material position. These should be constants or functions, instead of magic numbers
- Moved hit sound effect to separate function
- Removed the Hit()-function, because the hit sound is played in a separate function now
- With this change the y-offset of the barrel checking for other liquids on a hit is now 3 instead of 7. This should be ok, because the barrels have the same dimensions, it seemed strange that they would have different offsets
2016-02-01 06:23:44 +01:00
Mark 8bd61635dc Pump interface:
The pump gets the interfaces ExtractMaterialFromSource and InsertMaterialAtDrain that allow for overloading the pumping process
2016-01-28 06:30:14 +01:00
Lukas Werling 68f727e030 Fix Windmill sounds being stereo (by ala) 2016-01-27 20:31:34 +01:00
Lukas Werling f8e16686d8 Tweak sound making on Windmill
- Don't make sounds while the wheel is stopped.

 - Make less sounds while the wheel is turning fast.

 - Make less sounds overall.
2016-01-27 16:40:17 +01:00
3681 changed files with 213966 additions and 48853 deletions

View File

@ -1 +1,2 @@
node: $Format:%H$
date: $Format:%ci$

49
.gitignore vendored
View File

@ -5,6 +5,7 @@ deps
*.o
/openclonk
/openclonk-server
/netpuncher
/c4group
/c4script
*.a
@ -17,7 +18,7 @@ C4Version.h
Makefile
C4Include.h.gch
intermediate
build*
/build*
CMakeScripts
CMakeFiles
CMakeCache.txt
@ -29,16 +30,20 @@ CPackSourceConfig.cmake
editor-icons.h
oc-icon.h
NativeToolsExport.cmake
engine-resource.c
tests/CTestTestfile.cmake
# Documentation
*.pyc
docs/online
docs/chm
docs/sdk-de
docs/sdk/content.xml
docs/*.mo
docs/doku.pot
docs/Functions.txt
node_modules
/docs/online
/docs/chm
/docs/sdk-de
/docs/sdk/content.xml
/docs/*.mo
/docs/doku.pot
/docs/Functions.txt
/docs/lunr.js
# Visual studio files
openclonk.opensdf
@ -55,6 +60,10 @@ planet/fmod.dll
planet/cmake_install.cmake
planet/clonk.sln
planet/clonk.ilk
*.ipdb
*.iobj
openclonk.VC.db
openclonk.VC.VC.opendb
build
planet/clonk.app
@ -75,6 +84,16 @@ openclonk.ilk
*.vcxproj
*.vcxproj.filters
/ipch
.vs/
c4group_autogen/
c4script_autogen/
libc4script_autogen/
libmisc_autogen/
libopenclonk_autogen/
netpuncher_autogen/
openclonk-server_autogen/
openclonk_autogen/
thirdparty/blake2/blake2_autogen/
# Temporary files created by Microsoft Visual Studio
*.ncb
@ -115,6 +134,7 @@ openclonk.layout
openclonk.sdf
openclonk.cbp
tests/openclonk_unittest.cbp
tests/openclonk_unittest.sln
# MacOSX saved searches
*.savedSearch
@ -124,10 +144,19 @@ WindowsGamesExplorer.xml
# Mape
./mape
/mape
mape-icons.h
mape-resource.c
tests/openclonk_unittest.sln
# Packed groups created directly in root path
/*.oc*
# QMake stuff
*_automoc.cpp
moc_*.cpp
qrc_resource.cpp
ui_C4ConsoleQt*.h
resource.qrc.depends
*.exp
qt.conf

84
.travis.yml 100644
View File

@ -0,0 +1,84 @@
# thanks to http://stackoverflow.com/questions/29312015/building-with-more-than-one-version-of-a-compiler for the template
language: cpp
dist: trusty
sudo: required # for Qt libraries. Additionally, the virtualization builds are more stable and have better single core performance.
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'build-essential', 'cmake3', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'libgtest-dev']
env:
- CCOMPILER=gcc-4.9
- CXXCOMPILER=g++-4.9
- TYPE=Debug # somehow, the linking fails for release builds. If someone could fix that, that would be great.
- BSYS="Unix Makefiles#make -k"
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: ppa:beineri/opt-qt596-trusty
packages: ['g++-5', 'build-essential', 'cmake3', 'libpng-dev', 'libjpeg-dev', 'libfreetype6-dev', 'libglew-dev', 'libreadline-dev', 'libsdl2-dev', 'qt59base', 'libalut-dev', 'libvorbis-dev', 'libopenal-dev', 'libdw-dev', 'libgtest-dev', 'ninja-build']
env:
- CCOMPILER=gcc-5
- CXXCOMPILER=g++-5
- TYPE=RelWithDebInfo
- CXX_FLAGS="-fdiagnostics-color -I/usr/include/AL"
- BSYS="Ninja#ninja -k30" PCH=on
- UPLOAD_SNAPSHOT=1
- CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr -DWITH_AUTOMATIC_UPDATE=ON -DWITH_APPDIR_INSTALLATION=ON"
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
packages: ['clang-3.8', 'build-essential', 'cmake3', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'ninja-build', 'libc++-dev', 'libc++1', 'libgtest-dev']
env:
- CCOMPILER=clang-3.8
- CXXCOMPILER=clang++-3.8
- CXX_FLAGS="-stdlib=libc++ -fcolor-diagnostics"
- TYPE=Debug
- BSYS="Ninja#ninja -k30"
before_install:
- for t in test mock; do wget https://github.com/google/google$t/archive/release-1.7.0.tar.gz -Og$t.tgz && tar xvf g$t.tgz; done
install:
- '[ -e /opt/qt59/bin/qt59-env.sh ] && source /opt/qt59/bin/qt59-env.sh || echo building without Qt'
before_script:
- export CXX="$CXXCOMPILER" CC="$CCOMPILER"
- export C4REVISION_BRANCH="$TRAVIS_BRANCH"
- >
cmake
-G"${BSYS/\#*/}"
-DCMAKE_BUILD_TYPE="$TYPE"
-DCMAKE_CXX_FLAGS="$CXX_FLAGS"
-DUSE_GCC_PCH=${PCH:-off}
-DGTEST_ROOT=$PWD/googletest-release-1.7.0
-DGMOCK_ROOT=$PWD/googlemock-release-1.7.0
$CMAKE_FLAGS
.
script:
- ${BSYS/*#/} all netpuncher tests aul_test
# TODO: Remove SKIP_IPV6_TEST once Travis generally adds ::1 as loopback address.
- SKIP_IPV6_TEST=1 ./tests/tests
- ./tests/aul_test
after_success:
- >
[ "$UPLOAD_SNAPSHOT" = 1 ] &&
echo "Creating AppImage..." &&
tools/create_appimage.sh &&
echo "Uploading snapshot..." &&
tools/upload_snapshot.sh OpenClonk-x86_64.AppImage OpenClonk-x86_64.AppImage.zsync ||
echo "Snapshot creation has failed"

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
Copyright (c) 2009-2015, The OpenClonk Team and contributors
Copyright (c) 2009-2016, The OpenClonk Team and contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above

View File

@ -1,15 +1,17 @@
<Engine and Tools>
Sven Eberhardt (Sven2)
Armin Burgmeier (Clonk-Karl)
Günther Brammer (Günther)
Nicolas Hake (Isilkor)
Armin Burgmeier (Clonk-Karl)
Lukas Werling (Luchs)
Martin Plicht (Mortimer)
Julius Michaelis (JCaesar)
Peter Wortmann (PeterW)
Julius Michaelis (Caesar)
<Scripting and Content>
Maikel de Vries (Maikel)
David Dormagen (Zapper)
Mark Haßelbusch (Marky)
Felix Wagner (Clonkonaut)
Bernhard Bonigl (Boni)
@ -26,11 +28,8 @@ Martin Strohmeier (K-Pone)
<Administration>
Tobias Zwick (Newton)
<Thanks to our package maintainers>
Benedict Etzel (B_E), Philipp Kern (pkern), Kevin Zheng and more
<Special Thanks to Contributors>
Martin Adam (Win), Florian Graier (Nachtfalter), Mark Haßelbusch (Marky), Merten Ehmig (pluto), Benjamin Herr (Loriel), Armin Schäfer, Pyrit, Philip Holzmann (Batman), Alexander Semeniuk (AlteredARMOR), Andriel, Peewee, Oliver Schneider (ker), Fabian Pietsch, Manuel Rieke (MrBeast), Felix Riese (Fungiform), Carl-Philip Hänsch (Carli), Sebastian Rühl, Gurkenglas and many more:
Luchs, Asmageddon, mizipzor, Tim Blume, Apfelclonk, Sven-Hendrik Haase, Lauri Niskanen (Ape), Daniel Theuke (ST-DDT), Russell, Stan, TomyLobo, Clonkine, Koronis, Johannes Nixdorf (mixi), grgecko, Dominik Bayerl, Misty de Meo, Lorenz Schwittmann, hasufell, Jan Heberer, dylanstrategie, Checkmaty, Faby
Also, big thanks to Matthes Bender and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source.
Contributors for OpenClonk 8.0: George Tokmaji (Fulgen), Martin Adam (Win), Merten Ehmig (pluto), Florian Graier (Nachtfalter), Philip Holzmann (Foaly), Dominik Bayerl (Kanibal), Linus Heckemann (sphalerite), Pyrit, Armin Schäfer, Tushar Maheshwari, jok, Tarte, Philip Kern (pkern), Arne Schauf (NativeException), Matthias Mailänder, marsmoon
Previous contributors: Tim Blume, Sven-Hendrik Haase, Carl-Philip Hänsch (Carli), Jan Heberer, Benjamin Herr (Loriel), Lauri Niskanen (Ape), Johannes Nixdorf (mixi), Misty de Meo, Fabian Pietsch, Manuel Rieke (MrBeast), Felix Riese (Fungiform), Sebastian Rühl, Oliver Schneider (ker), Lorenz Schwittmann, Alexander Semeniuk (AlteredARMOR), Daniel Theuke (ST-DDT), Andriel, Apfelclonk, Asmageddon, Checkmaty, Clonkine, dylanstrategie, Faby, grgecko, Gurkenglas, hasufell, Koronis, mizipzor, Peewee, Russell, Stan, TomyLobo
Also thanks to our Linux package maintainers Benedict Etzel (B_E), Linus Heckemann (sphalerite), Philip Kern (pkern), Matthias Mailänder, Julian Ospald (hasufell), Kevin Zheng, and more
Finally, a big thanks to Matthes Bender and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source.

15
README
View File

@ -17,6 +17,7 @@ Additionally, OpenClonk depends on a number of third-party libraries:
- The OpenGL Extension Wrangler Library (http://glew.sourceforge.net/)
- FreeALUT (https://github.com/vancegroup/freealut)
- libogg and libvorbis (https://www.xiph.org/downloads/)
- Qt >= 5.7 (https://www.qt.io/download-open-source/)
OS X Specific
=============
@ -29,19 +30,13 @@ Linux Specific
==============
For building OpenClonk on Linux, you need the following libraries in addition
to the ones listed above:
- GTK+ 3.4 or greater (http://www.gtk.org)
- SDL 2.0 (https://www.libsdl.org/download-2.0.php)
- libGL (http://www.mesa3d.org/)
- SDL 1.2 (http://www.libsdl.org/download-1.2.php)
- SDL_mixer 1.2 (http://www.libsdl.org/projects/SDL_mixer/release-1.2.html)
- libupnp
- OpenAL Soft >= 1.13 (https://github.com/kcat/openal-soft)
- miniupnpc (http://miniupnp.free.fr/)
- libxrandr
Most distributions should provide these dependencies via their packaging
system. For Debian based distributions, you will need these packages:
build-essential cmake imagemagick libfreetype6-dev libgl1-mesa-dev
libglew-dev libgtk-3-dev libjpeg-dev libpng-dev libsdl1.2-dev
libsdl-mixer1.2-dev libupnp-dev libxrandr-dev x11proto-core-dev
zlib1g-dev libalut0
At least gcc-4.9 is required.
system. At least gcc-4.9 is required.
Windows Specific
================

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
# Copyright (c) 2009-2018, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -22,7 +22,7 @@ SET(C4PROJECT_URL "http://${C4PROJECT_DOMAIN}.${C4PROJECT_TLD}")
SET(C4ENGINENAME "OpenClonk")
SET(C4ENGINENICK "openclonk")
SET(C4XVER1 8)
SET(C4XVER1 9)
SET(C4XVER2 0)
# Set this variable to any string for pre-release versions, like "alpha" or

32
appveyor.yml 100644
View File

@ -0,0 +1,32 @@
version: "{build}"
pull_requests:
do_not_increment_build_number: true
shallow_clone: true
cache: ..\openclonk-cache
image: Visual Studio 2017
configuration: RelWithDebInfo
platform:
- x64
install:
- ps: "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-Install.ps1"
before_build:
- ps: "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-BeforeBuild.ps1"
build:
project: ../openclonk-build/openclonk.sln
parallel: true
verbosity: minimal
# The after_build and test_script scripts need to be called in a real
# powershell instance because they call into the MSBuild API, which has issues
# finding its data files when called from AppVeyor's powershell host, because
# it attempts to read the application config instead of the registry to find
# them (starting with MSBuild 15, which ships with Visual Studio 2017).
after_build:
- cmd: powershell -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-AfterBuild.ps1"
test_script:
- cmd: powershell -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-Test.ps1"
deploy: off

View File

@ -0,0 +1,89 @@
# The MIT License (MIT)
#
# Copyright (c) 2018 Nathan Osman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
find_package(Qt5Core REQUIRED)
# Retrieve the absolute path to qmake and then use that path to find
# the windeployqt and macdeployqt binaries
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
if(WIN32 AND NOT WINDEPLOYQT_EXECUTABLE)
message(FATAL_ERROR "windeployqt not found")
endif()
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
if(APPLE AND NOT MACDEPLOYQT_EXECUTABLE)
message(FATAL_ERROR "macdeployqt not found")
endif()
# Add commands that copy the required Qt files to the same directory as the
# target after being built as well as including them in final installation
function(windeployqt target)
# Run windeployqt immediately after build
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
--verbose 0
--no-compiler-runtime
--no-angle
--release-with-debug-info
--no-translations
\"$<TARGET_FILE:${target}>\"
COMMENT "Deploying Qt..."
)
# windeployqt doesn't work correctly with the system runtime libraries,
# so we fall back to one of CMake's own modules for copying them over
# Doing this with MSVC 2015 requires CMake 3.6+
if((MSVC_VERSION VERSION_EQUAL 1900 OR MSVC_VERSION VERSION_GREATER 1900)
AND CMAKE_VERSION VERSION_LESS "3.6")
message(WARNING "Deploying with MSVC 2015+ requires CMake 3.6+")
endif()
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
get_filename_component(filename "${lib}" NAME)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
copy_if_different "${lib}" \"$<TARGET_FILE_DIR:${target}>\"
COMMENT "Copying ${filename}..."
)
endforeach()
endfunction()
# Add commands that copy the required Qt files to the application bundle
# represented by the target.
function(macdeployqt target)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
\"$<TARGET_FILE_DIR:${target}>/../..\"
-always-overwrite
COMMENT "Deploying Qt..."
)
endfunction()
mark_as_advanced(WINDEPLOYQT_EXECUTABLE MACDEPLOYQT_EXECUTABLE)

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
# Copyright (c) 2009-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -95,7 +95,7 @@ else()
if (NOT HAVE_ALEXT)
message(STATUS "Warning: Found OpenAL but no extensions (alext.h). Sound modifiers will be disabled.")
endif()
elseif(SDLMixer_FOUND)
elseif(SDL2Mixer_FOUND)
set(Audio_TK "SDL_Mixer")
endif()
endif()
@ -113,11 +113,11 @@ if(Audio_TK STREQUAL "OpenAL")
set(Audio_INCLUDE_DIRS ${Audio_INCLUDE_DIRS} ${Alut_INCLUDE_DIRS})
endif()
elseif(Audio_TK STREQUAL "SDL_Mixer")
__FINDAUDIO_FINDSDLMIXER()
if(SDLMixer_FOUND)
find_package(SDL2Mixer)
if(SDL2Mixer_FOUND)
set(Audio_FOUND TRUE)
set(Audio_LIBRARIES ${SDLMixer_LIBRARIES})
set(Audio_INCLUDE_DIRS ${SDLMixer_INCLUDE_DIRS})
set(Audio_LIBRARIES ${SDL2Mixer_LIBRARIES})
set(Audio_INCLUDE_DIRS ${SDL2Mixer_INCLUDE_DIRS})
endif()
elseif(Audio_TK STREQUAL "none")
set(Audio_FOUND TRUE)

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011-2015, The OpenClonk Team and contributors
# Copyright (c) 2011-2017, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -18,12 +18,23 @@
# DBGHELP_LIBRARIES, the libraries needed to use DbgHelp.
# DBGHELP_FOUND, If false, do not try to use DbgHelp.
find_path(DBGHELP_INCLUDE_DIR NAMES dbghelp.h PATH_SUFFIXES include)
set(DBGHELP_NAMES ${DBGHELP_NAMES} dbghelp)
find_library(DBGHELP_LIBRARY NAMES ${DBGHELP_NAMES})
# MSVC knows how to find the Windows SDK on its own, and replicating that
# in CMake is very tricky, especially with the SDK's layout changing
# occasionally. So instead we'll just leave it to MSVC to do correctly.
if(MSVC AND NOT DEFINED DBGHELP_INCLUDE_DIR AND NOT DEFINED DBGHELP_LIBRARY)
set(DBGHELP_INCLUDE_DIR "")
set(DBGHELP_LIBRARY "dbghelp")
set(DBGHELP_FOUND TRUE)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBGHELP DEFAULT_MSG DBGHELP_LIBRARY DBGHELP_INCLUDE_DIR)
if(NOT DBGHELP_FOUND)
find_path(DBGHELP_INCLUDE_DIR NAMES dbghelp.h PATH_SUFFIXES include)
set(DBGHELP_NAMES ${DBGHELP_NAMES} dbghelp)
find_library(DBGHELP_LIBRARY NAMES ${DBGHELP_NAMES})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBGHELP DEFAULT_MSG DBGHELP_LIBRARY DBGHELP_INCLUDE_DIR)
endif()
if(DBGHELP_FOUND)
set(DBGHELP_LIBRARIES ${DBGHELP_LIBRARY})

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2014-2015, The OpenClonk Team and contributors
# Copyright (c) 2014-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -19,11 +19,8 @@
# Use pkg-config if possible instead of doing guesswork like the default CMake module does
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND AND NOT APPLE)
if(PKG_CONFIG_FOUND)
set(_ft_pkgconfig_args "")
if(FREETYPE_FIND_REQUIRED)
set(_ft_pkgconfig_args "${_ft_pkgconfig_args}REQUIRED ")
endif()
if(FREETYPE_FIND_QUIET)
set(_ft_pkgconfig_args "${_ft_pkgconfig_args}QUIET ")
endif()

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2015, The OpenClonk Team and contributors
# Copyright (c) 2015-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2015, The OpenClonk Team and contributors
# Copyright (c) 2015-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011-2013, The OpenClonk Team and contributors
# Copyright (c) 2011-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -26,6 +26,13 @@ ENDIF (READLINE_INCLUDE_DIR)
FIND_PATH(READLINE_INCLUDE_DIR readline.h PATH_SUFFIXES readline)
# Unmodified readline depends on symbols from termcap without explicitly
# linking to it. Several distributions patch this to make it link against
# terminfo from ncurses or another termcap library, but some don't. To avoid
# having to run link tests, we'll just look for and use any termcap providing
# library.
FIND_LIBRARY(TERMCAP_LIBRARY NAMES tinfo termcap ncursesw ncurses cursesw curses)
SET(READLINE_NAMES readline libreadline)
FIND_LIBRARY(READLINE_LIBRARY NAMES ${READLINE_NAMES} )
@ -35,10 +42,13 @@ INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(READLINE DEFAULT_MSG READLINE_LIBRARY READLINE_INCLUDE_DIR)
IF(READLINE_FOUND)
SET( READLINE_LIBRARIES ${READLINE_LIBRARY} )
if(TERMCAP_LIBRARY)
set(READLINE_LIBRARIES ${READLINE_LIBRARY} ${TERMCAP_LIBRARY})
else()
set(READLINE_LIBRARIES ${READLINE_LIBRARY})
endif()
ELSE(READLINE_FOUND)
SET( READLINE_LIBRARIES )
ENDIF(READLINE_FOUND)
MARK_AS_ADVANCED( READLINE_LIBRARY READLINE_INCLUDE_DIR )
MARK_AS_ADVANCED( READLINE_LIBRARY TERMINFO_LIBRARY READLINE_INCLUDE_DIR )

View File

@ -17,9 +17,19 @@
# SDL2_LIBRARIES - a list of libraries to link against to use SDL2
# SDL2_FOUND - if false, SDL2 cannot be used
find_path(SDL2_INCLUDE_DIR SDL.h PATH_SUFFIXES SDL2 HINTS ENV SDL2DIR)
find_path(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES SDL2 include
)
mark_as_advanced(SDL2_INCLUDE_DIR)
find_library(SDL2_LIBRARY SDL2 HINTS ENV SDL2DIR)
find_library(SDL2_LIBRARY
SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib
)
mark_as_advanced(SDL2_LIBRARY)
include(FindPackageHandleStandardArgs)

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2012-2015, The OpenClonk Team and contributors
# Copyright (c) 2012-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -31,22 +31,16 @@ if(WIN32)
SET(UPNP_FOUND TRUE)
SET(UPNP_STYLE "Win32")
else()
find_path(UPNP_INCLUDE_DIR NAMES upnp.h PATH_SUFFIXES upnp)
set(UPNP_NAMES ${UPNP_NAMES} upnp)
set(THREADUTIL_NAMES ${THREADUTIL_NAMES} threadutil)
set(IXML_NAMES ${IXML_NAMES} ixml)
find_path(UPNP_INCLUDE_DIR NAMES miniupnpc.h PATH_SUFFIXES miniupnpc)
set(UPNP_NAMES ${UPNP_NAMES} miniupnpc)
find_library(UPNP_LIBRARY NAMES ${UPNP_NAMES})
find_library(THREADUTIL_LIBRARY NAMES ${THREADUTIL_NAMES})
find_library(IXML_LIBRARY NAMES ${IXML_NAMES})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP DEFAULT_MSG UPNP_LIBRARY THREADUTIL_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR)
if(UPNP_FOUND)
set(UPNP_LIBRARIES ${UPNP_LIBRARY} ${THREADUTIL_LIBRARY} ${IXML_LIBRARY})
if(UPNP_LIBRARY)
SET(UPNP_FOUND TRUE)
set(UPNP_LIBRARIES ${UPNP_LIBRARY})
set(UPNP_INCLUDE_DIR ${UPNP_INCLUDE_DIR})
set(UPNP_STYLE "libupnp")
set(UPNP_STYLE "miniupnpc")
endif()
endif()
mark_as_advanced(UPNP_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR)
mark_as_advanced(UPNP_LIBRARY UPNP_INCLUDE_DIR)

View File

@ -1,76 +0,0 @@
#Copied from http://www.mail-archive.com/cmake@cmake.org/msg04394.html which copied it from the rosengarden project
#see also: http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Precompiled-Headers.html
MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
# Prepare environment
GET_FILENAME_COMPONENT(_name ${_input} NAME)
SET(_pchdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_targetName}_pch.dir")
MAKE_DIRECTORY(${_pchdir})
SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
SET(_includeput "${_pchdir}/${_name}")
SET(_output "${_includeput}.gch")
# Assemble the compiler command with which future stuff will be built
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) # Don't worry: CMake won't use any of the R/D/RWDI/MSR vars if the build type is not defined
if(CMAKE_CXX_COMPILER_ARG1) # please, know what you're doing if you rely on this...
STRING(STRIP ${CMAKE_CXX_COMPILER_ARG1} _ccache_tweak)
SET(_ccache_tweak "\"${_ccache_tweak}\"")
endif()
SET(_compiler_FLAGS ${_ccache_tweak} ${CMAKE_CXX_FLAGS} ${${_flags_var_name}})
if(CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
LIST(APPEND _compiler_FLAGS "-D_DEBUG")
endif()
endif()
GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS)
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE})
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS)
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE})
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
FOREACH(item ${_directory_flags})
LIST(APPEND _compiler_FLAGS "-I\"${item}\"")
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
STRING(REPLACE "\"" "\\\"" _directory_flags ${_directory_flags}) # Welcome to escape hell. Replace " with \"
LIST(APPEND _compiler_FLAGS ${_directory_flags})
SEPARATE_ARGUMENTS(_compiler_FLAGS)
list(REMOVE_DUPLICATES _compiler_FLAGS)
# Add a target with the pch
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND "${CMAKE_CXX_COMPILER}"
${_compiler_FLAGS} -x c++-header -o ${_output} ${_source}
IMPLICIT_DEPENDS CXX ${_source}
)
FILE(WRITE "${_pchdir}/${_name}" "#ifdef __cplusplus\n#warning Precompiled header not used. Turn off or fix!\n#endif") # This file is added so the cc-units don't stumble over not being able to include the file
ADD_CUSTOM_TARGET(${_targetName}_pch DEPENDS ${_output})
ADD_DEPENDENCIES(${_targetName} ${_targetName}_pch)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-include ${_includeput}")
ENDMACRO(ADD_PRECOMPILED_HEADER)

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2012-2013, The OpenClonk Team and contributors
# Copyright (c) 2012-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -28,6 +28,33 @@ function(git_get_changeset_id VAR)
OUTPUT_VARIABLE GIT_STATUS
)
string(REGEX MATCH "^[MADRC ][MD ]" WORKDIR_DIRTY "${GIT_STATUS}")
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "rev-parse" "--git-path" "index"
OUTPUT_VARIABLE GIT_INDEX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
"${GIT_INDEX}"
)
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "show" "--format=%ci" "-s" "HEAD"
OUTPUT_VARIABLE GIT_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(DEFINED ENV{C4REVISION_BRANCH})
set(GIT_BRANCH "$ENV{C4REVISION_BRANCH}")
else()
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "symbolic-ref" "--short" "HEAD"
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_RESULT EQUAL 0)
set(GIT_BRANCH "unknown")
endif()
endif()
endif()
endif()
if (NOT C4REVISION)
@ -44,9 +71,19 @@ function(git_get_changeset_id VAR)
string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION)
endif()
unset(revlength)
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.git_archival" C4REVISION_TS
LIMIT_COUNT 1
REGEX "date: .+"
)
string(SUBSTRING "${C4REVISION_TS}" 6 -1 GIT_TIMESTAMP)
set(GIT_BRANCH "unknown")
endif()
if(WORKDIR_DIRTY)
set(C4REVISION "${C4REVISION}+")
set(WORKDIR_DIRTY 1)
endif()
set(${VAR} "${C4REVISION}" PARENT_SCOPE)
set(${VAR}_DIRTY ${WORKDIR_DIRTY} PARENT_SCOPE)
set(${VAR}_TS "${GIT_TIMESTAMP}" PARENT_SCOPE)
set(${VAR}_BRANCH "${GIT_BRANCH}" PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,37 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2018, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
#
# "Clonk" is a registered trademark of Matthes Bender, used with permission.
# See accompanying file "TRADEMARK" for details.
#
# To redistribute this file separately, substitute the full license texts
# for the above references.
# GCC6 doesn't work well with CMake while cross-compiling. See bugs:
# https://gitlab.kitware.com/cmake/cmake/issues/16291
# https://gitlab.kitware.com/cmake/cmake/issues/16919
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
function(HANDLE_GCC_CROSS_INCLUDE_PATHS _lang _gcc_lang_flag)
set(_compiler "${CMAKE_${_lang}_COMPILER}")
set(_compile_flags "${CMAKE_${_lang}_FLAGS}")
separate_arguments(_compile_flags UNIX_COMMAND "${_compile_flags}")
execute_process(
COMMAND ${_compiler} ${_compile_flags} -v -E -x ${_gcc_lang_flag} /dev/null
OUTPUT_QUIET
ERROR_VARIABLE _compiler_output
)
if ("${_compiler_output}" MATCHES "#include <\\.\\.\\.> search starts here:\n *(.*)\nEnd of search list\\.")
string(REGEX REPLACE "[\n ]+" " " _search_list "${CMAKE_MATCH_1}")
separate_arguments(_search_list)
foreach(_directory ${_search_list})
get_filename_component(_fixed_component "${_directory}" REALPATH)
set(_resolved_list ${_resolved_list} "${_fixed_component}")
endforeach()
set(CMAKE_${_lang}_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_${_lang}_IMPLICIT_INCLUDE_DIRECTORIES} ${_resolved_list} PARENT_SCOPE)
endif()
endfunction()

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2013, The OpenClonk Team and contributors
# Copyright (c) 2013-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
# Copyright (c) 2009-2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -23,13 +23,7 @@ git_get_changeset_id(C4REVISION)
# Get year
############################################################################
IF(CMAKE_HOST_UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE)
ELSEIF(CMAKE_HOST_WIN32)
EXECUTE_PROCESS(COMMAND "cscript.exe" "//nologo" "${CMAKE_CURRENT_SOURCE_DIR}/tools/get_current_year.vbs" OUTPUT_VARIABLE DATE)
ENDIF()
STRING(REGEX REPLACE "(.+)\n" "\\1" YEARFIXED "${DATE}")
SET(C4COPYRIGHT_YEAR ${YEARFIXED})
STRING(TIMESTAMP C4COPYRIGHT_YEAR "%Y")
############################################################################
# Build version strings

View File

@ -2,8 +2,8 @@
/* Generate minidumps on crash */
#cmakedefine HAVE_DBGHELP 1
/* Define to 1 if you have the <direct.h> header file. */
#cmakedefine HAVE_DIRECT_H 1
/* Use backward-cpp to print stack traces on crash */
#cmakedefine HAVE_BACKWARD 1
/* The backtrace function is declared in execinfo.h and works */
#cmakedefine HAVE_EXECINFO_H 1
@ -11,9 +11,6 @@
/* Define to 1 if you have the <history.h> header file. */
#cmakedefine HAVE_HISTORY_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine HAVE_IO_H 1
@ -23,9 +20,6 @@
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H 1
/* Define to 1 if your stdlib has std::make_unique */
#cmakedefine HAVE_MAKE_UNIQUE 1
/* Define to 1 if you have the <poll.h> header file. */
#cmakedefine HAVE_POLL_H 1
@ -41,9 +35,6 @@
/* Define to 1 if you have the <signal.h> header file. */
#cmakedefine HAVE_SIGNAL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#cmakedefine HAVE_SYS_EVENTFD_H 1
@ -68,21 +59,12 @@
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Define to 1 if your compiler supports variadic templates */
#cmakedefine HAVE_VARIADIC_TEMPLATES 1
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine HAVE_VASPRINTF 1
/* Define to 1 if you have the `__mingw_vasprintf' function. */
#cmakedefine HAVE___MINGW_VASPRINTF 1
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
#cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H 1
/* Define to 1 if you have the <X11/keysym.h> header file. */
#cmakedefine HAVE_X11_KEYSYM_H 1
/* compile without debug options */
#cmakedefine NDEBUG 1
@ -108,12 +90,13 @@
/* Enable automatic update system */
#cmakedefine WITH_AUTOMATIC_UPDATE 1
#cmakedefine WITH_APPDIR_INSTALLATION 1
/* Select an audio provider */
#define AUDIO_TK AUDIO_TK_${Audio_TK_UPPER}
#else
#define AUDIO_TK AUDIO_TK_NONE
#endif
#endif // USE_CONSOLE
#define AUDIO_TK_NONE 0
#define AUDIO_TK_OPENAL 1
@ -121,3 +104,13 @@
/* Include OpenAL extensions (alext.h) for sound modifiers */
#cmakedefine HAVE_ALEXT 1
/* Path to data directory */
#ifdef WITH_APPDIR_INSTALLATION
#define OC_SYSTEM_DATA_DIR "../share/games/openclonk"
#else
#define OC_SYSTEM_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/games/openclonk"
#endif
/* Path to /proc/self/exe (Linux) or equivalent */
#cmakedefine PROC_SELF_EXE "${PROC_SELF_EXE}"

View File

@ -19,6 +19,7 @@ HHC = hhc.exe
MKDIR_P = mkdir -p
CP = cp
CP_R = cp -r
NODE = node
stylesheet = clonk.xsl
@ -29,9 +30,10 @@ sdk-dirs := $(shell find sdk -name '.*' -prune -o -type d -print)
# find all *.xml files recursively in sdk/
xmlfiles := $(sort $(shell find sdk -name '.*' -prune -o -name 'content.xml' -prune -o -name \*.xml -print))
xmlfiles-de := $(subst sdk, sdk-de, $(xmlfiles))
# misc
extra-files := $(sort $(wildcard *.css *.php *.js images/*.*))
extra-files := $(sort $(wildcard *.css *.js images/*.*) lunr.js)
extra-files-chm := $(sort $(wildcard *.css *.js images/*.*))
# Targets:
@ -46,15 +48,16 @@ sdk-de-dirs := $(subst sdk, sdk-de, $(sdk-dirs))
online-dirs := $(foreach lang, en de, $(addprefix online/$(lang)/, $(sdk-dirs) images))
online-sdk-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(htmlfiles) sdk/content.html))
online-extra-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(extra-files)))
online-index-files := $(foreach lang, en de, $(addprefix online/$(lang)/, index.json))
# For Entwickler.chm
chm-dirs := $(foreach lang, en de, $(addprefix chm/$(lang)/, . $(sdk-dirs) images))
.PHONY: all online-en chm install check clean
all: $(sdk-de-dirs) $(online-dirs) $(online-sdk-files) $(online-extra-files)
all: $(sdk-de-dirs) $(online-dirs) $(online-sdk-files) $(online-extra-files) $(online-index-files)
online-en: $(addprefix online/en/, $(sdk-dirs) images $(htmlfiles) sdk/content.html $(extra-files))
online-en: $(addprefix online/en/, $(sdk-dirs) images $(htmlfiles) sdk/content.html $(extra-files) index.json)
chm: $(sdk-de-dirs) $(chm-dirs) chm/en/Developer.chm chm/de/Entwickler.chm
@ -69,23 +72,36 @@ clean:
rm -f *.mo Entwickler.chm Developer.chm doku.pot sdk/content.xml
rm -rf online sdk-de chm
sdk/content.xml: sdk/content.xml.in $(xmlfiles) build_contents.py experimental.py
sdk/content.xml: sdk/content.xml.in $(xmlfiles) tools/build_contents.py tools/experimental.py
@echo generate $@
@python build_contents.py $(xmlfiles)
@python2 tools/build_contents.py $(xmlfiles)
chm/en/Output.hhp: $(xmlfiles) chm/en/. build_hhp.py Template.hhp
# Node dependencies for index.
node_modules/.make: package.json
npm install
@touch $@
lunr.js: node_modules/.make
$(CP) node_modules/lunr/lunr.js $@
online/en/index.json: node_modules/.make $(xmlfiles) tools/build_index.js
@$(NODE) tools/build_index.js $@ $(xmlfiles)
online/de/index.json: node_modules/.make $(xmlfiles-de) tools/build_index.js
@$(NODE) tools/build_index.js $@ $(xmlfiles-de)
chm/en/Output.hhp: $(xmlfiles) chm/en/. tools/build_hhp.py Template.hhp
@echo generate $@
@python build_hhp.py $@ Template.hhp $(xmlfiles)
chm/de/Output.hhp: $(xmlfiles) chm/de/. build_hhp.py Template.de.hhp
@python2 tools/build_hhp.py $@ Template.hhp $(xmlfiles)
chm/de/Output.hhp: $(xmlfiles) chm/de/. tools/build_hhp.py Template.de.hhp
@echo generate $@
@python build_hhp.py $@ Template.de.hhp $(xmlfiles)
@python2 tools/build_hhp.py $@ Template.de.hhp $(xmlfiles)
$(sdk-de-dirs) $(online-dirs) $(chm-dirs):
mkdir -p $@
doku.pot: $(xmlfiles) extra-strings.xml sdk/content.xml.in xml2po.py clonk.py
doku.pot: $(xmlfiles) extra-strings.xml sdk/content.xml.in tools/xml2po.py tools/clonk.py
@echo extract strings to $@
@python xml2po.py -e -m clonk -o $@ $(xmlfiles) extra-strings.xml sdk/content.xml.in
@python2 tools/xml2po.py -e -m clonk -o $@ $(xmlfiles) extra-strings.xml sdk/content.xml.in
%.po: doku.pot
@echo update $@
@ -96,9 +112,9 @@ doku.pot: $(xmlfiles) extra-strings.xml sdk/content.xml.in xml2po.py clonk.py
@echo compile $@
@msgfmt --statistics -o $@ $<
sdk-de/%.xml: sdk/%.xml de.mo xml2po.py clonk.py
sdk-de/%.xml: sdk/%.xml de.mo tools/xml2po.py tools/clonk.py
@echo generate $@
@python xml2po.py -e -m clonk -t de.mo -o $@ $<
@python2 tools/xml2po.py -e -m clonk -t de.mo -o $@ $<
define run-xslt
@echo generate $@

View File

@ -35,7 +35,12 @@
</title>
</xsl:template>
<xsl:template match="script">
<xsl:copy><xsl:apply-templates select="@*|node()" /></xsl:copy>
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy />
</xsl:for-each>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="func|const" mode="head">
<xsl:apply-templates mode="head" />
@ -336,7 +341,7 @@
</xsl:if>
<xsl:if test="position() mod 2=0"><xsl:attribute name="class">dark</xsl:attribute></xsl:if>
<xsl:for-each select="col|literal_col">
<td><xsl:apply-templates select="@colspan|node()"/></td>
<td><xsl:apply-templates select="@colspan|@id|node()"/></td>
</xsl:for-each>
</tr>
</xsl:for-each>
@ -349,16 +354,6 @@
<caption><xsl:apply-templates select="@id|node()" /></caption>
</xsl:template>
<xsl:template match="search">
<xsl:if test="not($chm)">
<form action="../search.php" method="get">
<input name="search" type="text"></input>
<input type="submit" name="func" value="Search"></input>
<input type="submit" name="fulltext" value="Fulltext"></input>
</form>
</xsl:if>
</xsl:template>
<xsl:template match="table/bitmask">
<xsl:value-of select="." />:
<input id="input" onKeyUp="Calc();" name="input" type="text">
@ -516,7 +511,7 @@
<xsl:template name="color2">
<xsl:param name="s" select="." />
<!-- the list of keywords -->
<xsl:param name="t" select="'#include|#appendto|public|private|protected|global|static|var|local|const|any|int|bool|def|effect|object|proplist|string|array|func|return|if|else|break|continue|while|for|true|false|nil|'" />
<xsl:param name="t" select="'#include|#appendto|#warning|public|private|protected|global|static|var|local|const|any|int|bool|def|effect|object|proplist|string|array|func|return|if|else|break|continue|while|for|new|true|false|nil|'" />
<xsl:param name="w" select="substring-before($t, '|')" />
<!-- text before the keyword -->
<xsl:variable name="l" select="substring-before($s, $w)" />

11685
docs/de.po

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
@font-face{
font-family: Endeavour;
src: url('/Endeavour.eot');
src: local('Endeavour'),url('/Endeavour.ttf') format("truetype");
/*src: url('/Endeavour.eot');
src: local('Endeavour'),url('/Endeavour.ttf') format("truetype");*/
}
body {
@ -243,10 +243,6 @@ ul.nav a {
text-decoration: none;
}
ul.nav a:hover, ul.nav a:hover {
background: #333 url(images/stripe-wide.gif) left repeat-x;
}
ul.nav li.switchlang img {
margin: 0;
}

View File

@ -3,19 +3,19 @@ Unfortunately, xml documents can only have one root, so there needs to be a dumm
header is an appropiate html element, so it's arbitrarily chosen.
clonk.xsl also uses it to match the processing for it. -->
<header>
<style type="text/css">@import url("http://www.openclonk.org/header/header.css");</style>
<style type="text/css">@import url("https://www.openclonk.org/header/header.css");</style>
<div id="nav_header">
<div id="nav_doclangswitch">
<a href="http://docs.openclonk.org/en/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/gb.png"/></a>
<a href="http://docs.openclonk.org/de/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/de.png"/></a>
<a href="https://docs.openclonk.org/en/sdk/" target="_top"><img src="https://forum.openclonk.org/flags/gb.png"/></a>
<a href="https://docs.openclonk.org/de/sdk/" target="_top"><img src="https://forum.openclonk.org/flags/de.png"/></a>
</div>
<div id="nav_search">
<form action="http://www.openclonk.org/header/search.php" id="nav_searchform" method="get" target="_top"><div>
<form action="https://www.openclonk.org/header/search.php" id="nav_searchform" method="get" target="_top"><div>
<input id="nav_searchInput" name="s" type="text" value="search" onfocus="if(this.value == 'search') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'search'; }"/> in the
<select name="p">
<select value="docs" name="p">
<option value="blog">blog</option>
<option value="wiki">website</option>
<option value="forum">forum</option>
@ -29,21 +29,21 @@ clonk.xsl also uses it to match the processing for it. -->
</div>
<div id="nav_logo">
<a href="http://www.openclonk.org/" target="_top"><img src="http://www.openclonk.org/header/logo.png" width="450" height="94" alt="OpenClonk"/></a>
<a href="https://www.openclonk.org/" target="_top"><img src="https://www.openclonk.org/header/logo.png" width="450" height="94" alt="OpenClonk"/></a>
</div>
<div id="nav_navigation">
<div id="nav_links">
<ul>
<li><a href="http://www.openclonk.org/" target="_top">Home</a></li>
<li><a href="http://www.openclonk.org/download/" target="_top">Download</a></li>
<li><a href="http://blog.openclonk.org/" target="_top">Blog</a></li>
<li><a href="http://forum.openclonk.org/" target="_top">Forum</a></li>
<li><a href="http://league.openclonk.org/" target="_top">League</a></li>
<li><a href="http://wiki.openclonk.org/w/C4Script_Documentation" target="_top">Docs</a></li>
<li><a href="http://wiki.openclonk.org/w/Development" target="_top">Developers</a></li>
<li><a href="http://git.openclonk.org/openclonk.git" target="_top">Repository</a></li>
<li><a href="http://bugs.openclonk.org" target="_top">Bugs</a></li>
<li><a href="https://www.openclonk.org/" target="_top">Home</a></li>
<li><a href="https://www.openclonk.org/download/" target="_top">Download</a></li>
<li><a href="https://blog.openclonk.org/" target="_top">Blog</a></li>
<li><a href="https://forum.openclonk.org/" target="_top">Forum</a></li>
<li><a href="https://league.openclonk.org/" target="_top">League</a></li>
<li><a href="https://wiki.openclonk.org/w/C4Script_Documentation" target="_top">Docs</a></li>
<li><a href="https://wiki.openclonk.org/w/Development" target="_top">Developers</a></li>
<li><a href="https://git.openclonk.org/openclonk.git" target="_top">Repository</a></li>
<li><a href="https://bugs.openclonk.org" target="_top">Bugs</a></li>
</ul>
</div>
</div>

32
docs/package-lock.json generated 100644
View File

@ -0,0 +1,32 @@
{
"name": "openclonk-docs",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"lunr": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.1.6.tgz",
"integrity": "sha512-ydJpB8CX8cZ/VE+KMaYaFcZ6+o2LruM6NG76VXdflYTgluvVemz1lW4anE+pyBbLvxJHZdvD1Jy/fOqdzAEJog=="
},
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
"requires": {
"sax": "1.2.4",
"xmlbuilder": "9.0.7"
}
},
"xmlbuilder": {
"version": "9.0.7",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
}
}
}

22
docs/package.json 100644
View File

@ -0,0 +1,22 @@
{
"name": "openclonk-docs",
"version": "1.0.0",
"description": "Developer documentation for OpenClonk",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/openclonk/openclonk.git"
},
"author": "The OpenClonk Team",
"license": "ISC",
"bugs": {
"url": "https://github.com/openclonk/openclonk/issues"
},
"homepage": "https://github.com/openclonk/openclonk#readme",
"dependencies": {
"lunr": "^2.1.6",
"xml2js": "^0.4.19"
}
}

View File

@ -56,7 +56,7 @@
<dd>
<text>Searches for a network game on the specified address and joins it. No local scenario (*.ocs) should be specified. Implies --network.</text>
</dd>
<dt id="clonkp">clonk://&lt;<em>Address</em>&gt;/</dt>
<dt id="clonkp">[open]clonk://&lt;<em>Address</em>&gt;/</dt>
<dd>
<text>Same as --join if an address is specified. If "update" is specified as an address, this will cause the engine to perform an update check instead.</text>
</dd>

View File

@ -131,14 +131,21 @@
<![CDATA[
(function() {
function navigate(url) {
var urlsplit = url.split("#");
var xhr = new XMLHttpRequest();
xhr.open('GET', url.split("#")[0]);
xhr.open('GET', urlsplit[0]);
xhr.onreadystatechange = function (e) {
if (xhr.readyState === 4) {
var d = parent.document;
var r = xhr.responseText;
d.getElementById("content").innerHTML = r.split('<div id="content">')[1];
d.title = r.slice(r.indexOf("<title>")+7, r.indexOf("</title>"));
if (urlsplit.length > 1) {
var scrolltarget = d.getElementById(urlsplit[1]);
if (scrolltarget) {
scrolltarget.scrollIntoView();
}
}
}
};
xhr.send();
@ -204,6 +211,10 @@
window.scrollTo(0, y0);
}
})();
// Collapse the index.
document.querySelector('.index > img').onclick();
]]>
</script>
<script src="../lunr.js"></script>
<script src="../search.js"></script>
</toc>

View File

@ -5,7 +5,7 @@
<doc>
<title>CNAT - Contact Attachment</title>
<h>CNAT - Contact Attachment</h>
<text>In multiple places the engine uses ContactAttachment values (a bitmask) to manage the orientation of objects and processes. For example, a vertex of an object can have the <code id="CNAT">CNAT</code> bit <em>left</em>. If that object has <emlink href="definition/defcore.html">ContactCalls</emlink> activated, the engine calls on every contact of that vertex with the landscape the object script function <em>ContactLeft</em>. CNAT values are composed of the following bits:</text>
<text>In multiple places the engine uses ContactAttachment values (a bitmask) to manage the orientation of objects and processes. For example, a vertex of an object can have the <code id="CNAT">CNAT</code> bit <em>left</em>. If that object has <emlink href="definition/properties.html">ContactCalls</emlink> activated, the engine calls on every contact of that vertex with the landscape the object script function <em>ContactLeft</em>. CNAT values are composed of the following bits:</text>
<text>
<table>
<rowh>
@ -40,6 +40,10 @@
<col>CNAT_NoCollision</col>
<col>Extra flag: non-colliding vertex</col>
</row>
<row>
<col>CNAT_PhaseHalfVehicle</col>
<col>Extra flag: Entirely suppress collisions with HalfVehicle</col>
</row>
<bitmask>CNAT</bitmask>
</table>
</text>

View File

@ -35,11 +35,6 @@
<col>Integer</col>
<col>Category of the object. Also see <emlink href="definition/category.html">object categories</emlink>.</col>
</row>
<row>
<literal_col>ContactCalls</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, Contactcalls are called in the object script.</col>
</row>
<row>
<literal_col>Width</literal_col>
<col>Integer</col>
@ -65,11 +60,6 @@
<col>Integer</col>
<col>Weight of the object. Rock 10, clonk 50, hut 1000, castle 10000.</col>
</row>
<row>
<literal_col>Components</literal_col>
<col>ID list</col>
<col>Elements from which the object is composed. Uncompleted or half grown objects will only have the respective fraction of the components.</col>
</row>
<row>
<literal_col>SolidMask</literal_col>
<col>6 integers</col>
@ -120,11 +110,6 @@
<col>4 integers</col>
<col>Position of the intake region relative to the object centre.</col>
</row>
<row>
<literal_col>FireTop</literal_col>
<col>Integer</col>
<col>Flame distance to the object's bottom line.</col>
</row>
<row>
<literal_col>Exclusive</literal_col>
<col>Integer</col>
@ -190,11 +175,6 @@
<col>Integer</col>
<col>0 or 1. The object can be scaled over 100% using DoCon.</col>
</row>
<row>
<literal_col>AttractLightning</literal_col>
<col>Integer</col>
<col>0 or 1. The object attracts lightning.</col>
</row>
<row>
<literal_col>Fragile</literal_col>
<col>Integer</col>
@ -216,7 +196,7 @@
<col>1 - 10. Determines search depth of the pathfinder algorithm (default 1). Warning: higher values may slow down the game. By setting this value you can also enable non-CrewMember objects to use pathfinding when executing commands.</col>
</row>
<row>
<literal_col>NoComponentMass</literal_col>
<literal_col>NoMassFromContents</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, the object's contents is not added to the object's total mass. This can be used to prevent small container objects from turning into killer throwing items.</col>
</row>
@ -280,6 +260,11 @@
<col>Integer</col>
<col>0 or 1. If 1 the object's pathfinding will ignore any transfer zones.</col>
</row>
<row>
<literal_col>HideInCreator</literal_col>
<col>Boolean</col>
<col>false (default) or true. If true, the definition is not shown in the object creator window of the editor. Should be used for internal definitions, libraries, etc.</col>
</row>
</table>
</text>
</part>

View File

@ -27,9 +27,9 @@
</dl>
<h id="RasterGraphics">Raster Graphics</h>
<dl>
<dt id="Graphicspng"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics.png</dt>
<dt id="Graphicspng"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics.png/Graphics.*.png</dt>
<dd>
<text>Graphics of the object. Base graphics, animation phases and a picture for display in menus are stored in a 32 bit picture with transparency channel (PNG format, 32 bit RGBA color, non interlaced).</text>
<text>Graphics of the object. Base graphics, animation phases and a picture for display in menus are stored in a 32 bit picture with transparency channel (PNG format, 32 bit RGBA color, non interlaced). An optional zoom factor for high-resolution graphics can be provided in the '*'-portion of the name.</text>
</dd>
<dt id="Overlaypng"><img height="16" src="../../images/icon_image.png" width="16"/>Overlay.png</dt>
<dd>
@ -39,7 +39,7 @@
<dd>
<text>An optional normal map for the object, where the red, green and blue components in the image correspond to the normal vectors to be used for the lighting of the object. If this file is not present, the normal vector at each pixel points straight into Z direction (outside of the screen).</text>
</dd>
<dt id="Graphicsex"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics*.png/Overlay*.png</dt>
<dt id="Graphicsex"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics*.png/Overlay*.png (Graphics*.*.png/Overlay*.*.png)</dt>
<dd>
<text>Objects can also contain alternative sets of graphics which can be selected ingame using the script command <funclink>SetGraphics</funclink>(). The name corresponds to the file name portion following "Graphics". The matching overlay is automatically selected. For more information see <funclink>SetGraphics</funclink>().</text>
</dd>

View File

@ -14,6 +14,6 @@
<text>This script turns all rotatable objects upside down.</text>
<h id="ocf_fns">OCF Constants</h>
<text>The following OCFs are defined in C4Script:</text>
<text><funclink>OCF_Alive</funclink>, <funclink>OCF_AttractLightning</funclink>, <funclink>OCF_Available</funclink>, <funclink>OCF_Chop</funclink>, <funclink>OCF_Collectible</funclink>, <funclink>OCF_Collection</funclink>, <funclink>OCF_Construct</funclink>, <funclink>OCF_Container</funclink>, <funclink>OCF_CrewMember</funclink>, <funclink>OCF_Entrance</funclink>, <funclink>OCF_Exclusive</funclink>, <funclink>OCF_Fullcon</funclink>, <funclink>OCF_Grab</funclink>, <funclink>OCF_HitSpeed1</funclink>, <funclink>OCF_HitSpeed2</funclink>, <funclink>OCF_HitSpeed3</funclink>, <funclink>OCF_HitSpeed4</funclink>, <funclink>OCF_Inflammable</funclink>, <funclink>OCF_InFree</funclink>, <funclink>OCF_InLiquid</funclink>, <funclink>OCF_InSolid</funclink>, <funclink>OCF_Living</funclink>, <funclink>OCF_NotContained</funclink>, <funclink>OCF_OnFire</funclink>, <funclink>OCF_Rotate</funclink></text>
<text><funclink>OCF_Alive</funclink>, <funclink>OCF_Available</funclink>, <funclink>OCF_Chop</funclink>, <funclink>OCF_Collectible</funclink>, <funclink>OCF_Collection</funclink>, <funclink>OCF_Construct</funclink>, <funclink>OCF_Container</funclink>, <funclink>OCF_CrewMember</funclink>, <funclink>OCF_Entrance</funclink>, <funclink>OCF_Exclusive</funclink>, <funclink>OCF_Fullcon</funclink>, <funclink>OCF_Grab</funclink>, <funclink>OCF_HitSpeed1</funclink>, <funclink>OCF_HitSpeed2</funclink>, <funclink>OCF_HitSpeed3</funclink>, <funclink>OCF_HitSpeed4</funclink>, <funclink>OCF_Inflammable</funclink>, <funclink>OCF_InFree</funclink>, <funclink>OCF_InLiquid</funclink>, <funclink>OCF_InSolid</funclink>, <funclink>OCF_Living</funclink>, <funclink>OCF_NotContained</funclink>, <funclink>OCF_OnFire</funclink>, <funclink>OCF_Rotate</funclink></text>
<author>Sven2</author><date>2002-05</date>
</doc>

View File

@ -101,7 +101,7 @@
<row id="CONNECT">
<col>DFA_CONNECT</col>
<col>Line connections</col>
<col>Only <emlink href="definition/lineconnect.html">line objects</emlink>. Connects <emlink href="script/fn/SetAction.html">target object 1</emlink> and <emlink href="script/fn/SetAction.html">target object 2</emlink>. If property LineMaxDistance is a nonzero integer, the line breaks when the target objects are further apart than the given distance.</col>
<col>Only <emlink href="definition/lineconnect.html">line objects</emlink>. Connects <emlink href="script/fn/SetAction.html">target object 1</emlink> and <emlink href="script/fn/SetAction.html">target object 2</emlink>.</col>
<col>CNAT_None</col>
</row>
<row id="PULL">

View File

@ -28,7 +28,7 @@ Stand = {
<row>
<col><code>Prototype</code></col>
<col>proplist</col>
<col></col>
<col>Deprecated. Use <funclink>SetPrototype</funclink> and <funclink>GetPrototype</funclink>.</col>
</row>
<row>
<col><code>Name</code></col>
@ -133,7 +133,7 @@ Stand = {
<row id="Plane">
<col><code>Plane</code></col>
<col>int</col>
<col>The Object's minor Z-Position. Negative values are behind the landscape, positive values before it. Use 1-399 for stuff behind Clonks, 401-999 for stuff before Clonks, and 1000+ for GUI objects.</col>
<col>The Object's minor Z-Position. Negative values are behind the landscape, positive values before it. Use 1-399 for stuff behind Clonks, 401-999 for stuff before Clonks, and 1000+ for GUI objects. Global particles are on 900.</col>
</row>
<row id="SolidMaskPlane">
<col><code>SolidMaskPlane</code></col>
@ -168,7 +168,17 @@ Stand = {
<row>
<literal_col>ContactIncinerate</literal_col>
<col>Integer</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low).</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low). Implies MaterialIncinerate.</col>
</row>
<row>
<literal_col>MaterialIncinerate</literal_col>
<col>bool</col>
<col>Incineration when submerged in incendiary material.</col>
</row>
<row>
<literal_col>FireproofContainer</literal_col>
<col>bool</col>
<col>Anything contained in this object does not catch fire when submerged in incendiary material.</col>
</row>
<row>
<literal_col>EditCursorCommands</literal_col>
@ -180,6 +190,16 @@ Stand = {
<col>Integer</col>
<col>Bit mask indicating object boundaries: stop at map sides (C4D_Border_Sides), stop at map top (C4D_Border_Top), stop at map bottom (C4D_Border_Sides), stop at object layer boundaries (C4D_Border_Layer). For example BorderBound = C4D_Border_Top | C4D_Border_Bottom.</col>
</row>
<row>
<literal_col>ContactCalls</literal_col>
<col>bool</col>
<col>True or false. If true, <emlink href="definition/cnat.html">ContactCalls</emlink> are called in the object script.</col>
</row>
<row>
<literal_col>Components</literal_col>
<col>array</col>
<col>List of definitions and counts specifying the components of an object. Example: Components = {Rock = 1, Wood = 3};</col>
</row>
</table>
</text>
</part>

View File

@ -33,6 +33,11 @@
<col>Parameter</col>
<col>Description</col>
</rowh>
<row id="Initialize">
<literal_col>Definition</literal_col>
<col></col>
<col>Called in definition context after all definitions have been loaded and before definition properties are frozen. Use this callback to initialize complex definition properties such as EditorProps or dependencies between definitions. Definition() callbacks are performed in descending order of the DefinitionPriority property or 0 if that property is not defined.</col>
</row>
<row id="Initialize">
<literal_col>Initialize</literal_col>
<col></col>
@ -48,6 +53,11 @@
<col></col>
<col>When the object is removed.</col>
</row>
<row id="EditorInitialize">
<literal_col>EditorInitialize</literal_col>
<col></col>
<col>Called after Construction and Initialize when the object is placed in the editor.</col>
</row>
<row id="Hit">
<literal_col>Hit</literal_col>
<col></col>
@ -188,15 +198,15 @@
<col>object by</col>
<col>Called before the object is hit or punched by another object. By returning <code>true</code>, QueryCatchBlow can reject physical blows.</col>
</row>
<row id="LineBreak">
<literal_col>LineBreak</literal_col>
<row id="OnLineBreak">
<literal_col>OnLineBreak</literal_col>
<col>int cause</col>
<col>When a line object is broken. cause: 0 by movement, 1 because of a missing or incomplete target object.</col>
</row>
<row id="BuildNeedsMaterial">
<literal_col>BuildNeedsMaterial</literal_col>
<col>id material_definition, int amount</col>
<col>When the object is building another object and building material is required. The parameters are the type and amount of the first needed material. If this function returns <code>true</code>, no material message is displayed above the object.</col>
<row id="OnLineChange">
<literal_col>OnLineChange</literal_col>
<col>int cause</col>
<col>When a line object is changed, that is when one of it vertices changed its position.</col>
</row>
<row id="AttachTargetLost">
<literal_col>AttachTargetLost</literal_col>
@ -333,22 +343,16 @@
<col>int player, int new_team, int old_team</col>
<col>Callback in game goal, rule, and environment objects and in the scenario script. Called when a player has successfully switch from old_team to new_team (see <funclink>SetPlayerTeam</funclink>).</col>
</row>
<row id="EditCursorSelection">
<literal_col>EditCursorSelection</literal_col>
<col></col>
<col>When object is selected in editor. Use this callback to display extra information for scenario designers.</col>
</row>
<row id="EditCursorDeselection">
<literal_col>EditCursorDeselection</literal_col>
<col>object next_selection</col>
<col>When object is deselected in editor. Use this callback to hide any information previously shown in EditCursorSelection. If deselection happens due to another object being selected, that object is passed in next_selection.</col>
<row id="OnCompletionChange">
<literal_col>OnCompletionChange</literal_col>
<col>int old_con, int new_con</col>
<col>Callback in when the completion of the object has changed (see <funclink>GetCon</funclink>, <funclink>DoCon</funclink> and <funclink>SetCon</funclink>).</col>
</row>
<row id="EditCursorMoved">
<literal_col>EditCursorMoved</literal_col>
<col>int old_x, int old_y</col>
<col>When object is moved in editor. Callback is also done when moved in non-network pause mode. old_x, old_y contains object position before movement.</col>
</row>
<row id="SaveScenarioObject">
<literal_col>SaveScenarioObject</literal_col>
<col>proplist props</col>
@ -512,6 +516,19 @@ func SaveScenarioObject(props)
</row>
</table>
</text>
<text>Properties published to the editor as EditorProps can also be saved automatically by setting the Save property of the EditorProp to a string that serves as an identifier so saved properties can be removed by derived definitions. These properties are atuomatically saved if they are different from their default value. E.g.:</text>
<code>/* Define two properties that can be set in the editor */
// foo is a property with a setter function
local foo = 42;
public func SetFoo(new_foo) { foo = new_foo; return true; }
// bar is just a property without setter
local bar = 23;
local EditorProps = {
foo = { Type="int", Set="SetFoo", Save="Foo" }; // saved as object->SetFoo(value); unless foo is 42.
bar = { Type="int", Save="Bar"; } // saved as object.bar = value; unless bar is 23.
};</code>
<text>By default, effects are not saved in scenarios. To force saving of an effect, define the Fx*SaveScen callback. For example, the fire effect saves itself like this:</text>
<code>global func FxFireSaveScen(object obj, proplist fx, proplist props)
{

View File

@ -54,6 +54,10 @@ this.Visibility = [<funclink>VIS_Enemies</funclink>]; // This is also possible (
<col><code>VIS_OverlayOnly</code></col>
<col>Only overlays will be visible, other visibility-rules still apply.</col>
</row>
<row id="VIS_Editor">
<col><code>VIS_Editor</code></col>
<col>Visible in editor (both neutral and player viewports).</col>
</row>
</table>
</text>
<related>

View File

@ -13,8 +13,6 @@
<h>Get started</h>
<text><emlink href="files.html">Game data</emlink> - Get an overview over the game data needed for the creation of custom game content.</text>
<text><emlink href="script/index.html">C4Script</emlink> - View the introduction to the script language C4Script.</text>
<h>Search the documentation</h>
<search/>
</part>
<author>Newton</author><date>2011-08</date>
</doc>

View File

@ -106,9 +106,12 @@
<col>Inflammability.</col>
</row>
<row>
<col>Incindiary</col>
<col>Incendiary</col>
<col>Integer</col>
<col>This material incinerates objects.</col>
<col>
This material incinerates objects.
<em>Note: For compatibility reasons, the misspelling &quot;Incindiary&quot; is also accepted if (and only if) no value with the correct spelling is set.</em>
</col>
</row>
<row>
<col>Corrode</col>
@ -203,7 +206,7 @@
<row>
<col>OverlayType</col>
<col>Integer</col>
<col>Bit mask for texture calculation on this material. Bit 0 (1): exact (no zoom), bit 1 (2): no texture, bit 2 (4): extra large zoom, bit 3 (8): calculate texture based on gray scale.</col>
<col>Bit mask for texture calculation on this material. Bit 0 (1): exact (no zoom), bit 1 (2): no texture, bit 2 (4): extra large zoom</col>
</row>
<row>
<col>PXSGfx</col>
@ -372,8 +375,11 @@
<col>The background material.</col>
</row>
<row>
<col>Incindiary</col>
<col>All materials to be incinerated.</col>
<col>Incendiary</col>
<col>
All materials that can incinerate objects.
<em>Note: For compatibility reasons, the misspelling &quot;Incindiary&quot; is also accepted.</em>
</col>
</row>
<row>
<col>Extinguisher</col>

View File

@ -57,6 +57,8 @@
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Wind</funclink>
<funclink>PV_Gravity</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Cos</funclink>
</text>
<text>
<table>
@ -149,7 +151,7 @@
<row>
<col>Attach</col>
<col>bit mask</col>
<col>Defines the attachment of the particles to the calling object. Can be a combination of ATTACH_Front, ATTACH_Back, and ATTACH_MoveRelative. For example <code>ATTACH_Front | ATTACH_MoveRelative</code></col>
<col>Defines the attachment of the particles to the calling object. Can be a combination of ATTACH_Front, ATTACH_Back, and ATTACH_MoveRelative. For example <code>ATTACH_Front | ATTACH_MoveRelative. Non-attached particles are drawn on plane 900 (i.e. before most objects).</code></col>
</row>
</table>
</text>

View File

@ -39,32 +39,32 @@
<row>
<literal_col>Global</literal_col>
<col>Boolean</col>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlink href="playercontrols.xml#Globals">Global definitions</emlink>.</col>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlink href="playercontrols.html#Globals">Global definitions</emlink>.</col>
</row>
<row>
<literal_col>Hold</literal_col>
<col>Boolean</col>
<col>If true this command is interpreted as a held command. Such a command remembers whether the control key is pressed and generates another scripting event when it is released. See <emlink href="playercontrols.xml#Hold">Held keys</emlink>.</col>
<col>If true this command is interpreted as a held command. Such a command remembers whether the control key is pressed and generates another scripting event when it is released. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>RepeatDelay</literal_col>
<col>Integer</col>
<col>Only valid if <em>Hold</em> is true. If greater than 0 then this key generates additional scripting events while pressed every that many number of frames. See <emlink href="playercontrols.xml#Repeat">Key repeats</emlink>.</col>
<col>Only valid if <em>Hold</em> is true. If greater than 0 then this key generates additional scripting events while pressed every that many number of frames. See <emlink href="playercontrols.html#Repeat">Key repeats</emlink>.</col>
</row>
<row>
<literal_col>InitialRepeatDelay</literal_col>
<col>Integer</col>
<col>If specified then the delay of the first key repeat event can be changed. See <emlink href="playercontrols.xml#Repeat">Key repeats</emlink>.</col>
<col>If specified then the delay of the first key repeat event can be changed. See <emlink href="playercontrols.html#Repeat">Key repeats</emlink>.</col>
</row>
<row>
<literal_col>DefaultDisabled</literal_col>
<col>Boolean</col>
<col>If true then the command is deactivated in the normal case and needs to be activated by script first. This is useful for commands that are only required in special situations. See <emlink href="playercontrols.xml#Deactivate">Deactivated commands</emlink>.</col>
<col>If true then the command is deactivated in the normal case and needs to be activated by script first. This is useful for commands that are only required in special situations. See <emlink href="playercontrols.html#Deactivate">Deactivated commands</emlink>.</col>
</row>
<row>
<literal_col>ExtraData</literal_col>
<col>C4ID</col>
<col>Optional ID that is passed to the script function. See <emlink href="playercontrols.xml#ExtraData">ExtraData</emlink>.</col>
<col>Optional ID that is passed to the script function. See <emlink href="playercontrols.html#ExtraData">ExtraData</emlink>.</col>
</row>
<row>
<literal_col>CoordinateSpace</literal_col>
@ -94,7 +94,7 @@
</row>
<row>
<literal_col>Script</literal_col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.xml#Script">Script callbacks</emlink>. (Default value)</col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.html#Script">Script callbacks</emlink>. (Default value)</col>
</row>
<row>
<literal_col>ZoomIn</literal_col>
@ -184,17 +184,17 @@
<row>
<literal_col>Key</literal_col>
<col>String</col>
<col>Specifies the key(s) of this mapping or a reference to another mapping. See <emlink href="playercontrols.xml#Keys">Key mappings</emlink>.</col>
<col>Specifies the key(s) of this mapping or a reference to another mapping. See <emlink href="playercontrols.html#Keys">Key mappings</emlink>.</col>
</row>
<row>
<literal_col>ComboIsSequence</literal_col>
<col>Boolean</col>
<col>If true then multiple keys are taken as a sequence, i.e. they need to be pressed one after the other instead of all at the same time. See <emlink href="playercontrols.xml#Keys">Key mappings</emlink>.</col>
<col>If true then multiple keys are taken as a sequence, i.e. they need to be pressed one after the other instead of all at the same time. See <emlink href="playercontrols.html#Keys">Key mappings</emlink>.</col>
</row>
<row>
<literal_col>Control</literal_col>
<col>String</col>
<col>Command that is combined with this mapping. The name should be equivalent to the <em>Identifier</em> of a command defined in a <emlink href="playercontrols.xml#ControlDef">[ControlDef]</emlink>.</col>
<col>Command that is combined with this mapping. The name should be equivalent to the <em>Identifier</em> of a command defined in a <emlink href="playercontrols.html#ControlDef">[ControlDef]</emlink>.</col>
</row>
<row>
<literal_col>GUIName</literal_col>
@ -239,11 +239,11 @@
</row>
<row>
<literal_col>Hold</literal_col>
<col>The key changes the state of the command linked to to be held even if the key itself is pressed only shortly. Only valid if the <em>Hold</em> attribute is set for the command. This state remains until a corresponding mapping with trigger mode <em>Release</em> is being pressed. See <emlink href="playercontrols.xml#Hold">Held keys</emlink>.</col>
<col>The key changes the state of the command linked to to be held even if the key itself is pressed only shortly. Only valid if the <em>Hold</em> attribute is set for the command. This state remains until a corresponding mapping with trigger mode <em>Release</em> is being pressed. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>Release</literal_col>
<col>The key removes the held state. A key can have both Hold and Release set to toggle between the two states. See <emlink href="playercontrols.xml#Hold">Held keys</emlink>.</col>
<col>The key removes the held state. A key can have both Hold and Release set to toggle between the two states. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>AlwaysUnhandled</literal_col>
@ -273,7 +273,7 @@
return true;
}</code>
<text>most commands (except for asynchronous commands in the player menu) call a global script function:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)</code>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)</code>
<text>For an explanation of the parameters see <funclink>PlayerControl</funclink>. Amongst others, the function receives the calling player in player as well as the command to be executed in control.</text>
<text>As a simple example let's assume that in the global <em>PlayerControls.txt</em> the following command has been defined:</text>
<code>[ControlDefs]
@ -293,11 +293,11 @@
Control=Jump
Priority=50</code>
<text>This defines a Jump key and the corresponding standard mapping on the keyboard for the first player. The following script is used to handle the control:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)
{
// Which command has been issued?
// The constant CON_Jump has been declared automatically through the definition in PlayerControls.txt
if (control == CON_Jump &amp;&amp; !release)
if (control == CON_Jump &amp;&amp; state == CONS_Down)
{
// pressed the jump button. The clonk selected by the player shall jump
var player_clonk = GetCursor(player);
@ -319,17 +319,17 @@
GUIDesc=Going underground
ExtraData=Shovel</code>
<text>Let shovel be the ID of a shovel object. In the global script there could be the following, generic handling for unknown commands, for example:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)
{
// Handling of known controls
// [...]
// control with own handling
if (control_extra) return control_extra-&gt;PlayerControl(player, control, x, y, strength, repeat, release);
if (control_extra) return control_extra-&gt;PlayerControl(player, control, x, y, strength, repeat, state);
// unkown control
return false;
}</code>
<text>And in the script of the shovel:</text>
<code>func PlayerControl(int player, int control, int x, int y, int strength, bool repeated, bool release)
<code>func PlayerControl(int player, int control, int x, int y, int strength, bool repeated, int state)
{
// Handling of known controls
// Control dig directly in the shovel
@ -351,8 +351,9 @@
<ul>
<li>When released they also generate <funclink>PlayerControl</funclink> calls in the script with the <em>Release</em> flag set.</li>
<li>Mappings can emulate permanent key presses using the <em>Hold</em>/<em>Release</em> flags.</li>
<li><emlink href="playercontrols.xml#Repeat">Key repeats</emlink> are generated.</li>
<li><emlink href="playercontrols.html#Repeat">Key repeats</emlink> are generated.</li>
<li>The held state of the key can be queried in the script via <funclink>GetPlayerControlState</funclink>.</li>
<li>If the command is bound to an analog stick or trigger on a controller, every change in position causes in a call to PlayerControl() with state = CONS_Moved.</li>
</ul>
</text>
<text>A good example for this functionality is a directional command:</text>
@ -362,7 +363,7 @@
GUIDesc=Walk left
Hold=1</code>
<text>In the script the direction is transferred to the Clonk:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)
{
if (control == CON_Left) return UpdateControlDir(player);
// ...

View File

@ -68,11 +68,11 @@
<row>
<col>MissionAccess</col>
<col>String</col>
<col>The scenario will only load if the player gained this password in another scenario. See script function <funclink>GainMissionAccess</funclink>().</col>
<col>The scenario will only load if the player gained this password in another scenario. See script function <funclink>GainScenarioAccess</funclink>().</col>
</row>
<row>
<col>Secret</col>
<col>bool</col>
<col>Bool</col>
<col>If true and MissionAccess is set, the scenario is invisible in the scenario selection list if the player does not have the required password access.</col>
</row>
<row>
@ -122,9 +122,14 @@
</row>
<row>
<col>FoWEnabled</col>
<col>Integer</col>
<col>Bool</col>
<col>0 or 1. If 0, FoW is disabled, and the whole landscape is visible. Default 1.</col>
</row>
<row>
<col>EvaluateOnAbort</col>
<col>Bool</col>
<col>If enabled, the game will be evaluated even when aborted by the player. This is intended for scenarios like Tower of Despair that save progress in players. Default false.</col>
</row>
</table>
</text>
<text>
@ -248,7 +253,7 @@
<row>
<literal_col>AutoScanSideOpen</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, LeftOpen and RightOpen will be set automatically depending on the landscape at game start.</col>
<col>0, 1, or 2. If 1, the left and right borders are closed if the corresponding map pixel in the left or right row has non-sky foreground or background and open otherwise. If 2, it only checks the background.</col>
</row>
<row>
<literal_col>MapWidth</literal_col>
@ -345,6 +350,11 @@
<col>Integer</col>
<col>0 or 1. If 1, all landscape chunks are drawn flat when the map is zoomed to draw the landscape. Set this while drawing a static map in console mode to fix small gaps of lower order materials hidden behind materials of chunky shape.</col>
</row>
<row>
<literal_col>Secret</literal_col>
<col>Bool</col>
<col>Whether to hide the map from <code><funclink>NO_OWNER</funclink></code> viewports (e.g. observers not following a player in network rounds)</col>
</row>
</table>
</text>
<text>

View File

@ -27,6 +27,11 @@
<col>int player, int x, int y, object base, int team, id extra_data</col>
<col>Called after when a new player joins the game. At this point, the clonks, materials, structures etc. are already placed at the position given in the <emlink href="scenario/scenario.html#SektionenPlayer1Player2Player3Player4">Scenario.txt</emlink>. <code>x</code> and <code>y</code> specify the starting position of the player, <code>base</code> is the player's base (if any), <code>team</code> denotes the team of the player. For <code>extra_data</code>, see <funclink>CreateScriptPlayer</funclink></col>
</row>
<row id="InitializePlayers">
<literal_col>InitializePlayers</literal_col>
<col></col>
<col>Called after all initial players joined. Can be used e.g. to start intros.</col>
</row>
<row id="RelaunchPlayer">
<literal_col>RelaunchPlayer</literal_col>
<col>int player, int killed_by_player</col>

View File

@ -9,10 +9,26 @@
<text>With #appendto, you can modify an existing object defintion script without changing the original file. For example, a scenario could change flints to cause bigger explosions, without having to duplicate the entire flint in the scenario.</text>
<h id="Syntax">Declaration</h>
<code>#appendto [id]</code>
<text>A script can append itself to one or multiple existing scripts using the <code>#appendto</code> directive. Functions of the same name will overload functions in the target script. The original overloaded functions can still be called using <emlink href="script/fn/inherited.html">inherited</emlink>. #included scripts are not appended with #append, but #appended scripts are included by #include.</text>
<text>A script can append itself to one or multiple existing scripts using the <code>#appendto</code> directive. Such script needs to be placed in System.ocg directory. Functions of the same name will overload functions in the target script. The original overloaded functions can still be called using <emlink href="script/fn/inherited.html">inherited</emlink>. #included scripts are not appended with #append, but #appended scripts are included by #include.</text>
<code>#appendto *</code>
<text>Appending to <code>*</code> will append this script to all definitions.</text>
<text>A script can contain multiple #appendto directives. It is always compiled with the original script. This is of interest whenever local variables or functions from the appended script are used.</text>
<h id="Example">Example</h>
<code>#appendto WindBag
// This function will be "overwritten" in the original windbag.
// You can however call the original function by calling <funclink>_inherited</funclink>(...)
// You'll find this quite often in other scenarios. Just take a look at other
// scenarios that contain a System.ocg folder.
func FxIntReloadTimer(object target, proplist effect)
{
// Make the windbag reload faster.
var old_fill = fill_amount;
var ret = <funclink>inherited</funclink>(target, effect, ...);
if (fill_amount > old_fill)
fill_amount += (fill_amount - old_fill) * 5;
return ret;
}</code>
</part>
<author>Sven2</author><date>2002-04</date>
<author>matthes</author><date>2004-06</date>

View File

@ -0,0 +1,288 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE doc
SYSTEM '../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Diagnostic Messages</title>
<h>Diagnostic Messages</h>
<part>
<text>
Certain constructs may be flagged by the engine as potentially
unintended or deprecated. In these cases, the engine will, by default,
emit a warning to the log file.
</text>
<text>
On occasion, these constructs are in fact intended by the script
author. In order to avoid unwanted warning messages hiding more important
messages, the engine supports selectively suppressing a warning category
for parts of a script.
</text>
</part>
<part>
<text>
Suppression and re-enablement is handled by the <code>#warning</code>
directive. The directive must be placed on a separate line.
</text>
<text>Warnings can be controlled using this syntax:</text>
<code>#warning {enable|disable} [warning_category [warning_category...]]</code>
<text>
If no category is given, the engine will suppress or enable all messages,
including those that are not enabled by default. A category remains
disabled or enabled until the next directive that affects it, or until
the end of the script. A script linked to via the <code>#include</code>
or <code>#appendto</code> directives does not affect, and is itself not
affected by, the warning settings of the current script.
</text>
<text>
It is not an error to specify a category that does not exist; the
invalid category is simply ignored. No separate warning is emitted.
</text>
</part>
<part>
<h>Warning Categories</h>
<text>The following warning categories currently exist:</text>
<table>
<rowh>
<col>Category</col>
<col>Description</col>
</rowh>
<row>
<col>invalid_escape_sequence</col>
<col>
<text>
The engine found an escape sequence inside a string that it
did not recognize.
</text>
<part><code>"\p"</code></part>
</col>
</row>
<row>
<col>invalid_hex_escape</col>
<col>
<text>
The engine found the start of a hexadecimal escape sequence
inside a string, but no hexadecimal digits followed it.
</text>
<part><code>"\xGN"</code></part>
</col>
</row>
<row>
<col>type_name_used_as_par_name</col>
<col>
<text>
A function parameter was declared without an explicit type
specification, but with a name that is the same as a built-in type.
</text>
<part><code>func f(array)</code></part>
<text>
This warning is not enabled by default.
<a href="#fn1" title="The warning may be enabled by default in a future version.">¹</a>
</text>
</col>
</row>
<row>
<col>empty_parameter_in_call</col>
<col>
<text>
In a function call, a parameter was left empty. The engine is
passing <code>nil</code> in its place.
</text>
<part><code><funclink>CreateObject</funclink>(Clonk,, 30, 100);</code></part>
<text>
This warning is not enabled by default.
<a href="#fn1" title="The warning may be enabled by default in a future version.">¹</a>
</text>
</col>
</row>
<row>
<col>empty_parameter_in_array</col>
<col>
<text>
In an array literal, an entry was left empty. The engine is
using <code>nil</code> in its place.
</text>
<part><code>[1, 2,, 3, 4]</code></part>
<text>
This warning is not enabled by default.
<a href="#fn1" title="The warning may be enabled by default in a future version.">¹</a>
</text>
</col>
</row>
<row>
<col>implicit_range_loop_var_decl</col>
<col>
<text>
The loop variable of a for-in loop was not declared either in the
loop header itself nor in the containing function. This is only
accepted for backwards compatibility and may be removed in a
future release. Explicitly declare the variable by adding the
<code>var</code> keyword.
</text>
<part>
<code>func f() {
&#9;for (i in [1, 2, 3]) {
&#9;}
}</code>
</part>
</col>
</row>
<row>
<col>non_global_var_is_never_const</col>
<col>
<text>
A variable has been declared as <code>const</code>, but is not
global. At this time, non-global variables are always mutable.
</text>
<part>
<code>const local a = {}</code>
</part>
</col>
</row>
<row>
<col>variable_shadows_variable</col>
<col>
<text>
The declaration of a variable uses the same name as a variable
in a greater scope. Changes to the shadowing variable will not
affect the shadowed variable.
</text>
<part>
<code>static foo;
func f() {
&#9;var foo = 3;
}</code>
</part>
</col>
</row>
<row>
<col>redeclaration</col>
<col>
<text>
A variable has been redeclared in the same scope. Make sure
you do not accidentally overwrite values another part of the
code relies upon.
</text>
<part>
<code>func f() {
&#9;var i;
&#9;var i;
}</code>
</part>
</col>
</row>
<row>
<col>variable_out_of_scope</col>
<col>
<text>
A variable has been used outside of the block it has been
declared in. This is accepted only for backwards compatibility
and may be removed in a future release.
</text>
<part>
<code>func f(a) {
&#9;i = 0;
&#9;if (a) {
&#9;&#9;var i = 1;
&#9;}
&#9;return i;
}</code>
</part>
</col>
</row>
<row>
<col>undeclared_varargs</col>
<col>
<text>
Use of <code><funclink>Par</funclink></code> inside a function
implicitly declares it as using a variable number of arguments.
This is not immediately obvious to callers of the function, and
should be explicitly declared in the function signature by
adding a final <code>...</code> parameter.
</text>
<part>
<code>func f(a) {
&#9;return <funclink>Par</funclink>(a);
}
// Better:
func g(a, ...) {
&#9;return <funclink>Par</funclink>(a);
}</code>
</part>
</col>
</row>
<row>
<col>arg_count_mismatch</col>
<col>
<text>
A function call passes more parameters than the function will
accept.
</text>
<part>
<code><funclink>GetDir</funclink>(0)</code>
</part>
</col>
</row>
<row>
<col>arg_type_mismatch</col>
<col>
<text>
The parameter given in a function call is of a different type
than the called function expects. The call will likely fail at
runtime.
</text>
<part>
<code><funclink>Sin</funclink>("huh?")</code>
</part>
</col>
</row>
<row>
<col>empty_if</col>
<col>
<text>
An <code>if</code> conditional is controlling an empty statement.
Use the empty block <code>{}</code> if this is intentional, or
remove the conditional entirely.
</text>
<part>
<code>if (true);</code>
</part>
</col>
</row>
<row>
<col>suspicious_assignment</col>
<col>
<text>
An assignment was found where an expression was expected. While
an assignment returns its own value, usually a comparison was
intended instead.
</text>
<part>
<code>if (a = b + 1) { /* Do something */}</code>
</part>
<text>
If the assignment is intentional, make this more obvious by
extracting it to a separate statement, or explicitly handle the
boolean conversion by adding a comparison operator.
</text>
</col>
</row>
</table>
</part>
<part>
<h>Examples</h>
<examples>
<example>
<code>func f(string s) {
&#9;Sin(s);&#x9;// WARNING: parameter 0 of call to 'Sin' passes string (int expected)
#warning disable arg_type_mismatch
&#9;Sin(s);
#warning enable arg_type_mismatch
&#9;Sin(s);&#x9;// WARNING: parameter 0 of call to 'Sin' passes string (int expected)
}</code>
</example>
</examples>
</part>
<a id="fn1" style="font-size: smaller; color: inherit;">¹ The warning may be enabled by default in a future version.</a>
</doc>

View File

@ -51,7 +51,8 @@ func Destruction()
<text>The magic spell object exists until the spell has ended and then makes the clonk visible again. Also, if the spell object is deleted for other reasons (e.g. a scenario section change), the clonk is made visible in the Destruction callback (if this wasn't so, the clonk would remain invisible for ever). Also there is a Timer (defined in the DefCore) called every second. Notice you couldn't just have a single timer call to mark the end of the spell because timer intervals are marked in the engine beginning with the start of the round and you wouldn't know at what point within an engine timer interval the spell would start.</text>
<text>However, there are some problems with this implementation: for example, the magician can not cast a second invisibility spell while he's already invisible - the second spell would have practically no effect, because the end of the first spell would make the clonk visible again. The spell script would have to do some special handling for this case - but not only for multiple invisibility spells, but also for any other spell or script that might affect visibility or coloration of the clonk. Even if this spell would remember the previous value e.g. for coloration it could not handle a situation in which other scripts change the color of their own in the middle of the spell. The same problems occur when multiple scripts modify temporary clonk physcials such as jumping, walking speed, fight strength or visibility range, energy, magic energy etc. Using effects, these conflicts can be avoided.</text>
<h id="Usage">Application</h>
<text>Effects are created using <funclink>AddEffect</funclink> and removed with <funclink>RemoveEffect</funclink>. If an effect was successfully created, the callback Fx*Start is made (* is replaced with the effect name). Depending on the parameters, there can also be an Fx*Timer call for continuous activity such as casting sparks, adjusting energy etc. Finally, when the effect is deleted, the callback Fx*Stop is made. Now, the invisibility spell implemented using effects:</text>
<text>Effects are created using <funclink>CreateEffect</funclink> and removed with <funclink>RemoveEffect</funclink>. If an effect was successfully created, the callback <emlink href="script/Effects.html#Construction">Construction</emlink> is made. Depending on the parameters, there can also be an <emlink href="script/Effects.html#TimerCallback">Timer</emlink> call for continuous activity such as casting sparks, adjusting energy etc. Finally, when the effect is deleted, the callback <emlink href="script/Effects.html#Destruction">Destruction</emlink> is made.</text>
<text>Now, the invisibility spell implemented using effects:</text>
<code>/* Invisibility spell with effect system */
// visibility - previous visibility
@ -59,92 +60,86 @@ func Destruction()
func Activate(object caster, object caster2)
{
// get caster
if (caster2) caster = caster2;
// get caster
if (caster2) caster = caster2;
// start effect
<funclink>AddEffect</funclink>(&quot;InvisPSpell&quot;, caster, 200, 1111, nil, GetID());
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
// start effect
caster-><funclink>CreateEffect</funclink>(InvisPSpell, 200, 1111);
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
}
func FxInvisPSpellStart(object target, proplist effect)
{
// Save the casters previous visibility
effect.visibility = target.Visibility;
effect.old_mod = target-&gt;<funclink>GetClrModulation</funclink>();
// Make the caster invisible
target.Visibility = <funclink>VIS_Owner</funclink> | <funclink>VIS_Allies</funclink> | <funclink>VIS_God</funclink>;
// Semitransparent and slightly blue for owner and allies
target-&gt;SetClrModulation(<funclink>ModulateColor</funclink>(effect.old_mod, RGBa(127,127,255,127)));
// Fertig
return true;
}
func FxInvisPSpellStop(object target, proplist effect)
{
// restore previous values
target-&gt;<funclink>SetClrModulation</funclink>(effect.old_mod);
target.Visibility = effect.visibility;
// done
return true;
local InvisPSpell = new Effect {
Start = func() {
// Save the casters previous visibility
this.visibility = Target.Visibility;
this.old_mod = Target-&gt;<funclink>GetClrModulation</funclink>();
// Make the caster invisible
Target.Visibility = <funclink>VIS_Owner</funclink> | <funclink>VIS_Allies</funclink> | <funclink>VIS_God</funclink>;
// Semitransparent and slightly blue for owner and allies
Target-&gt;SetClrModulation(<funclink>ModulateColor</funclink>(this.old_mod, RGBa(127,127,255,127)));
},
Stop = func() {
// restore previous values
Target-&gt;<funclink>SetClrModulation</funclink>(this.old_mod);
Target.Visibility = this.visibility;
}
}</code>
<text>In this case, the magic spell object only starts the effect, then deletes itself immediately. The engine ensures that there are no conflicts with multiple effects modifying the visibility: effects are stored in a stack which ensures that effects are always removed in the opposite order of their addition. For this, there are a couple of extra Start and Stop calls to be made which are explained in detail later.</text>
<text>This effects does not have a timer function. It does, however, define a timer interval of 1111 which will invoke the standard timer function after 1111 frames which will delete the effect. Alternatively, you could define a timer function as such:</text>
<code>func FxInvisPSpellTimer()
<code>Timer = func()
{
// return value of -1 means that the effect should be removed
return -1;
// return value of -1 means that the effect should be removed
return -1;
}</code>
<text>To store the previous status of the target object, properties of the effect are used. This is necessary because in this case the effect callbacks do not have any object script context. So you cannot access any object local variables in the effect callbacks - remember that the magic spell object which has created the effect is already deleted. If you require an object context in the effect callbacks you can specify one in <funclink>AddEffect</funclink>(). In that case, effect callbacks would be in object local context and the effect would automatically be deleted if the target object is destroyed.</text>
<text>To store the previous status of the target object, properties of the effect are used. This way effects are independant of other objects and effects - remember that the magic spell object which has created the effect is already deleted. If you need to call functions in the context of the target object or other objects, use <code>-></code>.</text>
<h id="Priorities">Priorities</h>
<text>When creating an effect you always specify a priority value which determines the effect order. The engine ensures that effects with lower priority are added before effects with a higher priority - even if this means deleting an existing effect of higher priority. So if one effect colors the clonk green and another colors the clonk red, the result will be that of the effect with higher priority. If two effects have the same priority, the order is undefined. However, it is guaranteed that effects added later always notify the Fx*Effect callback of the same priority.</text>
<text>In the case of the red and green color, one effect could also determine the previous coloring and then mix a result using ModulateColor. But priorities also have another function: an effect of higher priority can prevent the addition of other effects of lower priority. This is done through the Fx*Effect callback. If any existing effect reacts to this callback with the return value -1, the new effect is not added (the same applies to the Start callback of the effect itself). Here an example:</text>
<text>When creating an effect you always specify a priority value which determines the effect order. The engine ensures that effects with lower priority are added before effects with a higher priority - even if this means deleting an existing effect of higher priority. So if one effect colors the clonk green and another colors the clonk red, the result will be that of the effect with higher priority. If two effects have the same priority, the order is undefined. However, it is guaranteed that effects added later always notify the <code>Effect</code> callback of the same priority.</text>
<text>In the case of the red and green color, one effect could also determine the previous coloring and then mix a result using ModulateColor. But priorities also have another function: an effect of higher priority can prevent the addition of other effects of lower priority. This is done through the <code>Effect</code> callback. If any existing effect reacts to this callback with the return value -1, the new effect is not added (the same applies to the Start callback of the effect itself). Here an example:</text>
<code>/* Spell of immunity against fire */
func Activate(object caster, object caster2)
{
// get caster
if (caster2) caster = caster2;
// get caster
if (caster2) caster = caster2;
// start effect
<funclink>AddEffect</funclink>(&quot;BanBurnPSpell&quot;, caster, 180, 1111, nil, GetID());
// start effect
caster-><funclink>CreateEffect</funclink>(BanBurnPSpell, 180, 1111);
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
}
func FxBanBurnPSpellStart(object target, proplist effect, bool temporary)
{
// On start of the effect: extinguish clonk
if (!temporary) target-&gt;<funclink>Extinguish</funclink>();
return true;
}
func FxBanBurnPSpellEffect(string new_name)
{
// block fire
if (<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return -1;
// everything else is ok
return 0;
}</code>
<text>This effect makes the clonk fire-proof for 30 seconds. The effect is implemented without any Timer or Stop callbacks as the complete functionality is achieved by simply blocking other effects which might have "Fire" as part of their name. This especially applies to the engine internal fire which has exactly the name "Fire". Of course, you could still add a Timer callback for graphic effects so the player can see that his clonk is immune. Also, you could create special visual effects when preventing incineration in FxBanBurnPSpellEffect. For the like:</text>
local BanBurnPSpell = new Effect {
Construction = func()
{
// On start of the effect: extinguish clonk
Target-&gt;<funclink>Extinguish</funclink>();
},
Effect = func(string new_name)
{
// block fire
if (<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return -1;
// everything else is ok
return 0;
}
};</code>
<text>This effect makes the clonk fire-proof for 30 seconds. The effect is implemented without any Timer or Stop callbacks as the complete functionality is achieved by simply blocking other effects which might have "Fire" as part of their name. This especially applies to the engine internal fire which has exactly the name "Fire". Of course, you could still add a Timer callback for graphic effects so the player can see that his clonk is immune. Also, you could create special visual effects when preventing incineration in <code>Effect</code>. For the like:</text>
<code>[...]
func FxBanBurnPSpellEffect(string new_name, object target, proplist effect, var1, var2, var3)
Effect = func(string new_name, var1, var2, var3, var4)
{
// only handle fire
if (!<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return 0;
// with fire, the three extra parameters have the following meaning:
// var1: caused_by - player that is responsible for the fire
// var2: blasted - bool: if the fire has been created by an explosion
// var3: burning_object - object: incineratable object
// extinguish burning object
if (var3 &amp;&amp; <funclink>GetType</funclink>(var3) == <funclink>C4V_C4Object</funclink>) var3-&gt;<funclink>Extinguish</funclink>();
// block fire
return -1;
// only handle fire
if (!<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return 0;
// with fire, the three extra parameters have the following meaning:
// var1: caused_by - player that is responsible for the fire
// var2: blasted - bool: if the fire has been created by an explosion
// var3: burning_object - object: incineratable object
// extinguish burning object
if (var3 &amp;&amp; <funclink>GetType</funclink>(var3) == <funclink>C4V_C4Object</funclink>) var3-&gt;<funclink>Extinguish</funclink>();
// block fire
return -1;
}</code>
<text>This would even delete all burning objects which would otherwise incinerate the target object. The type check for var3 avoids possible conflicts with other "Fire" effects that might have differing parameters. Obviously, conflict situations like this should be avoided at all cost.</text>
<text>The following table contains general guidelines for priorities in effects of the original pack:</text>
@ -210,44 +205,44 @@ func FxBanBurnPSpellEffect(string new_name, object target, proplist effect, var1
func Activate(object caster, object caster2)
{
// get caster
if (caster2) caster = caster2;
// get caster
if (caster2) caster = caster2;
// start effect
<funclink>AddEffect</funclink>(&quot;ReincarnationPSpell&quot;, caster, 180, 0, nil, GetID());
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
// start effect
caster-><funclink>CreateEffect</funclink>(ReincarnationPSpell, 180, 0);
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
}
func FxReincarnationPSpellStart(object target, proplist effect, bool temporary)
{
// Only at the first start: message
if (!temporary) target-&gt;<funclink>Message</funclink>(&quot;%s gets an extra life&quot;, target-&gt;<funclink>GetName</funclink>());
return true;
}
local ReincarnationPSpell = new Effect {
Construction = func() {
// Only at the first start: message
Target-&gt;<funclink>Message</funclink>(&quot;%s gets an extra life&quot;, Target-&gt;<funclink>GetName</funclink>());
return true;
},
func FxReincarnationPSpellStop(object target, proplist effect, int reason, bool temporary)
{
// only when the clonk died
if (reason != 4) return true;
// the clonk has already been resurrected
if (target-&gt;<funclink>GetAlive</funclink>()) return -1;
// resurrect clonk
target-&gt;<funclink>SetAlive</funclink>(true);
// give energy
target-&gt;<funclink>DoEnergy</funclink>(100);
// message
target-&gt;<funclink>Message</funclink>(&quot;%s has been resurrected.&quot;, target-&gt;<funclink>GetName</funclink>());
func Stop(int reason, bool temporary) {
// only when the clonk died
if (reason != 4) return true;
// the clonk has already been resurrected
if (Target-&gt;<funclink>GetAlive</funclink>()) return -1;
// resurrect clonk
Target-&gt;<funclink>SetAlive</funclink>(true);
// give energy
Target-&gt;<funclink>DoEnergy</funclink>(100);
// message
Target-&gt;<funclink>Message</funclink>(&quot;%s has been resurrected.&quot;, Target-&gt;<funclink>GetName</funclink>());
// remove
return true;
}</code>
// remove
return true;
}
};</code>
<text>This effect reanimates the clonk as many times as he has cast the reanimation spell.</text>
<h id="GlobalEffects">Global Effects</h>
<text>Global effects are effects that are not bound to any target object. With global effects, too, priorities are observed and temporary Add/Remove calls might be necessary to ensure order. Simply imagine all global effects are attached to an imaginary object. Global effects are accessed whenever you specify <code>nil</code> for the target object.</text>
<text>There are two global effect types: Scenerio effects and global effects. They are bound to the <code>Scenario</code> and <code>Global</code> proplists. With these effects, too, priorities are observed and temporary Add/Remove calls might be necessary to ensure order.</text>
<text>This can be used to make changes to gravity, sky color, etc. Here's an example for a spell that temporarily reduces gravity and then resets the original value:</text>
<code>/* Gravitation spell */
@ -333,34 +328,39 @@ func FxGravChangeUSpellAdd(object target, proplist effect, string new_name, int
<table>
<caption id="PropertiesTable">Effect Properties</caption>
<rowh>
<col>Data type</col>
<col>Name</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<col>string</col>
<col><code>Name</code></col>
<col>string</col>
<col>Can be changed.</col>
</row>
<row>
<col>int</col>
<col><code>Priority</code></col>
<col>int</col>
<col>See <a href="Priorities">Priorities</a></col>
</row>
<row>
<col>int</col>
<col><code>Interval</code></col>
<col>int</col>
<col>Of the <a href="#TimerCallback">Timer callback</a>.</col>
</row>
<row>
<col>int</col>
<col><code>Time</code></col>
<col>int</col>
<col>The age of the effect in frames, used for the <a href="#TimerCallback">Timer callback</a>. Can be changed.</col>
</row>
<row>
<col>proplist</col>
<col><code>CommandTarget</code></col>
<col>Either the command object or the command definition, depending on which is used.</col>
<col>proplist</col>
<col><code>nil</code> when created by <funclink>CreateEffect</funclink>, as the effect gets the callbacks itself. When created by <funclink>AddEffect</funclink> either the command object or the command definition, depending on which is used.</col>
</row>
<row>
<col><code>Target</code></col>
<col>proplist</col>
<col>The object the effect belongs to, or the proplists <code>Scenario</code> or <code>Global</code> for scenario and global effects.</col>
</row>
</table>
<h id="UserCallbacks">User Defined Properties</h>
@ -488,19 +488,19 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
</row>
</table>
</text>
<text>Warning: as function names may not be more than 100 characters in length (and you will lose oversight eventually), you should not stuff too much information into the effect name. Effect names are case sensitive. Also, you should avoid using any of these identifiers in your effect names if your effect doesn't have anything to do with them.</text>
<text>Effect names are case sensitive. Also, you should avoid using any of these identifiers in your effect names if your effect doesn't have anything to do with them.</text>
<h id="CBRef">Callback Reference</h>
<part>
<text>The following callbacks are made by the engine and should be implemented in your script according to necessity. * is to be replaced by your effect name.</text>
<h>Fx*Start</h>
<text><code>int Fx*Start (object target, proplist effect, int temporary, any var1, any var2, any var3, any var4);</code></text>
<text>Called at the start of the effect. target is the target object of the effect. <code>effect</code> is the effect itself. <code>effect</code> can be used to manipulate the effect, for example with <code>effect.Interval=newinterval</code>.</text>
<text>The following callbacks are made by the engine and should be implemented in your effect prototype as necessary.</text>
<h>Start</h>
<text><code>int Start (int temporary, any var1, any var2, any var3, any var4);</code></text>
<text>Called at the start of the effect. <code>this</code> is the effect itself. It can be used to manipulate the effect, for example with <code>this.Interval=newinterval</code>.</text>
<text>In normal operation the parameter temporary is 0. It is 1 if the effect is re-added after having been temporarily removed and 2 if the effect was temporarily removed and is now to be deleted (in this case a Remove call will follow).</text>
<text>If temporary is 0, var1 to var4 are the additional parameters passed to <funclink>AddEffect</funclink>().</text>
<text>If temporary is 0 and this callback returns -1 the effect is not created and the corrsponding <funclink>AddEffect</funclink>() call returns 0.</text>
<h>Fx*Stop</h>
<text><code>int Fx*Stop (object target, proplist effect, int reason, bool temporary);</code></text>
<text>When the effect is temporarily or permanently removed. target again is the target object and <code>effect</code> the effect itself.</text>
<text>If temporary is 0, var1 to var4 are the additional parameters passed to <funclink>CreateEffect</funclink>().</text>
<text>If temporary is 0 and this callback returns -1 the effect is not created and the corrsponding <funclink>CreateEffect</funclink>() call returns <code>nil</code>.</text>
<h>Stop</h>
<text><code>int Stop (int reason, bool temporary);</code></text>
<text>When the effect is temporarily or permanently removed. <code>this</code> is the effect itself.</text>
<text>reason contains the cause of the removal and can be one of the following values:</text>
<text>
<table>
@ -537,26 +537,34 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
</table>
</text>
<text>The effect can prevent removal by returning -1. This will not help, however, in temporary removals or if the target object has been deleted.</text>
<h id="TimerCallback">Fx*Timer</h>
<text><code>int Fx*Timer (object target, proplist effect, int time);</code></text>
<text>Periodic timer call, if a timer interval has been specified at effect creation. target and <code>effect</code> as usual.</text>
<h id="FxConstructionCallback">Construction</h>
<text><code>int Construction (any var1, any var2, any var3, any var4);</code></text>
<text>Called when the effect is first created, before it is started. The parameters <code>var1</code> to <code>var4</code> are passed through from <funclink>CreateEffect</funclink>.</text>
<text>The return value is ignored.</text>
<h id="FxDestructionCallback">Destruction</h>
<text><code>nil Destruction (int reason);</code></text>
<text>Callback when the effect is removed. <code>reason</code> is the same as in the preceding <code>Stop</code> call, see above.</text>
<text>The return value is ignored.</text>
<h id="TimerCallback">Timer</h>
<text><code>int Timer (int time);</code></text>
<text>Periodic timer call, if a timer interval has been specified at effect creation.</text>
<text>time specifies how long the effect has now been active. This might alternatively be determined using effect.Time.</text>
<text>If this function is not implemented or returns -1, the effect will be deleted after this call.</text>
<h>Fx*Effect</h>
<text><code>int Fx*Effect (string new_name, object target, proplist effect, any var1, any var2, any var3, any var4);</code></text>
<text>A call to all effects of higher priority if a new effect is to be added to the same target object. new_name is the name of the new effect; <code>effect</code> is the effect being called.</text>
<h>Effect</h>
<text><code>int Effect (string new_name, any var1, any var2, any var3, any var4);</code></text>
<text>A call to all effects of higher priority if a new effect is to be added to the same target object. new_name is the name of the new effect; <code>this</code> is the effect being called.</text>
<text>Warning: the new effect is not yet properly initialized and should not be manipulated in any way. Especially the priority field might not yet have been set.</text>
<text>This function can return -1 to reject the new effect. As the new effect might also be rejected by other effects, this callback should not try to add effects or similar (see gravitation spell). Generally you should not try to manipulate any effects during this callback.</text>
<text>Return -2 or -3 to accept the new effect. As long as the new effect is not rejected by any other effect, the Fx*Add call is then made to the accepting effect, the new effect is not actually created, and the calling AddEffect function returns the effect index of the accepting effect. The return value -3 will also temporarily remove all higher prioriy effects just before the Fx*Add callback and re-add them later.</text>
<text>var1 bis var4 are the parameters passed to <funclink>AddEffect</funclink>()</text>
<h>Fx*Add</h>
<text><code>int Fx*Add (object target, proplist effect, string new_name, int new_timer, any var1, any var2, any var3, any var4);</code></text>
<text>Callback to the accepting effect if that has returned -2 or -3 to a prior Fx*Effect call. <code>effect</code> identifies the accepting effect to which the consequences of the new effect will be added; target is the target object (0 for global effects).</text>
<text>Return -2 or -3 to accept the new effect. As long as the new effect is not rejected by any other effect, the <code>Add</code> call is then made to the accepting effect, the new effect is not actually created, and the calling <funclink>CreateEffect</funclink> function returns the accepting effect. The return value -3 will also temporarily remove all higher prioriy effects just before the <code>Add</code> callback and re-add them later.</text>
<text>var1 bis var4 are the parameters passed to <funclink>CreateEffect</funclink>()</text>
<h>Add</h>
<text><code>int Add (string new_name, int new_timer, any var1, any var2, any var3, any var4);</code></text>
<text>Callback to the accepting effect if that has returned -2 or -3 to a prior <code>Effect</code> call. <code>this</code> identifies the accepting effect to which the consequences of the new effect will be added.</text>
<text>new_timer is the timer interval of the new effect; var1 to var4 are the parameters from AddEffect. Notice: in temporary calls, these parameters are not available - here they will be 0.</text>
<text>If -1 is returned, the accepting effect is deleted also. Logically, the calling AddEffect function will then return -2.</text>
<h>Fx*Damage</h>
<text><code>int Fx*Damage (object target, proplist effect, int damage, int cause);</code></text>
<text>Every effect receives this callback whenever the energy or damage value of the target object is to change. If the function is defined, it should then return whether to allow the change.</text>
<text>If -1 is returned, the accepting effect is deleted also. Logically, the calling <funclink>CreateEffect</funclink> function will then return <code>nil</code>.</text>
<h>Damage</h>
<text><code>int Damage (int damage, int cause, int by_player);</code></text>
<text>Every effect receives this callback whenever the energy or damage value of the target object is to change. If the function is defined, it should then return the damage to be done to the target.</text>
<text id="damagecause">This callback is made upon life energy changes in living beings and damage value changes in non-livings - but not vice versa. cause contains the value change and reason:</text>
<text>
<table>
@ -639,7 +647,7 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
<text>There are the following functions for manipulation of effects:</text>
<text>
<ul>
<li><funclink>AddEffect</funclink>() - for effect creation</li>
<li><funclink>CreateEffect</funclink>() - for effect creation</li>
<li><funclink>RemoveEffect</funclink>() - for effect removal</li>
<li><funclink>GetEffect</funclink>() - to search for effects</li>
<li><funclink>GetEffectCount</funclink>() - for effect counting</li>

View File

@ -178,6 +178,10 @@
<col>GUI_GridLayout</col>
<col>The sub-windows of this window will automatically be arranged in a grid.</col>
</row>
<row>
<col>GUI_TightGridLayout</col>
<col>Like GUI_GridLayout but might reorder items and lead to less empty space between sub-windows.</col>
</row>
<row>
<col>GUI_VerticalLayout</col>
<col>The sub-windows of this window will automatically be arranged vertically in a list.</col>

View File

@ -260,11 +260,11 @@ Blit({Algo=MAPALGO_Scale, OffX=Wdt/2, X=-100, Op=copy_layer});
</row><row>
<col>OffX</col>
<col>0</col>
<col>X position of fixed point that remains in position.</col>
<col>X position of fixed point that remains in position. Actual fixed point is translated left by -0.5 pixels to achieve proper pixel mapping.</col>
</row><row>
<col>OffY</col>
<col>0</col>
<col>Y position of fixed point that remains in position.</col>
<col>Y position of fixed point that remains in position. Actual fixed point is translated up by -0.5 pixels to achieve proper pixel mapping.</col>
</row>
</table></text></part>
<h>MAPALGO_Rotate</h><part>
@ -292,6 +292,10 @@ Blit({Algo=MAPALGO_Scale, OffX=Wdt/2, X=-100, Op=copy_layer});
<text>Jumbles its operand around by moving points by a randomized offset.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Algorithms that is being manipulated.</col>
</row><row>
<col>Seed</col>
<col>Random(65536)</col>
<col>If nonzero, the offset map is generated from a fixed seed.</col>

View File

@ -38,6 +38,9 @@
<text>Finds a random position in the shape and returns it as properties x and y in the supplied proplist. The return value indivates whether a point could be found.</text>
<text>The parameter max_tries indicates how many times the algorithm tries to find a point within the shape. The function is guaranteed to succeed for non-empty base shapes (i.e. rectangle and circle) as well as combined shapes on a single try. However a stochastic approach is used for intersection and subtraction shapes where random points are queried from one of the sub-shapes and subsequently checked against the other sub-shapes.</text>
<text></text>
<code>bool GetArea();</code>
<text>Returns the area covered by the shape in squared pixels.</text>
<text></text>
<code>proplist GetBoundingRectangle();</code>
<text>Returns a rectangular shape that includes at least the whole shape used as calling context.</text>
<text></text>

View File

@ -6,7 +6,7 @@
<func>
<title>Abs</title>
<category>Arithmetics</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AbsX</title>
<category>Objects</category>
<subcat>Position</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AbsY</title>
<category>Objects</category>
<subcat>Position</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>ActIdle</title>
<category>Objects</category>
<subcat>Activity</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>bool</rtype></syntax>
<desc>Checks whether an object is currently performing an activity.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>AddCommand</title>
<category>Objects</category>
<subcat>Commands</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>bool</rtype>
<params>

View File

@ -6,7 +6,8 @@
<func>
<title>AddEffect</title>
<category>Effects</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<deprecated />
<syntax>
<rtype>proplist</rtype>
<params>
@ -18,7 +19,7 @@
<param>
<type>object</type>
<name>target</name>
<desc>Target object for the effect. If <code>nil</code>, a global effect is created.</desc>
<desc>Target object for the effect. If <code>nil</code>, <code>Global</code> is used, but the target parameter of the callbacks will get <code>nil</code>.</desc>
<optional />
</param>
<param>
@ -74,6 +75,7 @@
<remark>For examples and more information see the <emlink href="script/Effects.html">effects documentation</emlink>.</remark>
<related>
<emlink href="script/Effects.html">Effects Documentation</emlink>
<funclink>CreateEffect</funclink>
<funclink>CheckEffect</funclink>
<funclink>GetEffectCount</funclink>
<funclink>EffectCall</funclink>

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>AddFragmentShader</title>
<category>Global</category>
<version>8.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>string</type>
<name>category</name>
<desc>
Shader category or shader name the slices are added to. Known categories:
<table>
<rowh>
<col>Category</col>
<col>Description</col>
</rowh>
<row>
<col>Common</col>
<col>Applies to everything.</col>
</row>
<row>
<col>Object</col>
<col>Applies to all objects and sprites.</col>
</row>
<row>
<col>Landscape</col>
<col>Applies to the landscape.</col>
</row>
</table>
</desc>
</param>
<param>
<type>string</type>
<name>shader</name>
<desc>The GLSL shader code.</desc>
</param>
</params>
</syntax>
<desc>Adds shader slices to a category of shaders or to a single shader. Returns an identifier for removal.</desc>
<remark>
Consider using built-in functions such as <funclink>SetGamma</funclink>, <funclink>SetMatAdjust</funclink>, or <funclink>SetClrModulation</funclink> for changing colors instead of writing a custom shader.
</remark>
<examples>
<example>
<code>AddFragmentShader("Landscape", "slice(color+1) { fragColor.r = 1.f; }");</code>
<text>Makes the landscape very red.</text>
</example>
</examples>
<related>
<funclink>RemoveShader</funclink>
</related>
</func>
<author>Luchs</author><date>2016-10</date>
</funcs>

View File

@ -7,7 +7,7 @@
<title>AddMenuItem</title>
<category>Objects</category>
<subcat>Menu</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>AddMsgBoardCmd</title>
<category>Interface</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,19 +7,19 @@
<title>AddVertex</title>
<category>Objects</category>
<subcat>Vertices</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<rtype>bool</rtype>
<params>
<param>
<type>int</type>
<name>x</name>
<desc>X coordinate, relative to the object center</desc>
<desc>X coordinate, relative to the object center.</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y coordinate, relative to the object center</desc>
<desc>Y coordinate, relative to the object center.</desc>
</param>
</params>
</syntax>
@ -32,6 +32,7 @@
</example>
</examples>
<related>
<funclink>InsertVertex</funclink>
<funclink>GetVertex</funclink>
<funclink>SetVertex</funclink>
<funclink>GetVertexNum</funclink>

View File

@ -6,7 +6,7 @@
<func>
<title>Angle</title>
<category>Arithmetics</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_AbsX</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_AbsY</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Action</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params />

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Const</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Dist</title>
<category>Animations</category>
<version>5.6 OC</version>
<version>6.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Linear</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_R</title>
<category>Animations</category>
<version>5.3 OC</version>
<version>3.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_X</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_XDir</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Y</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_YDir</title>
<category>Animations</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AppendCommand</title>
<category>Objects</category>
<subcat>Commands</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>bool</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>ArcCos</title>
<category>Arithmetics</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>ArcSin</title>
<category>Arithmetics</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AttachMesh</title>
<category>Objects</category>
<subcat>Display</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>BlastFree</title>
<category>Landscape</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>BlastObjects</title>
<category>Objects</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>BoundBy</title>
<category>Arithmetics</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>Bubble</title>
<category>Environment</category>
<subcat>Effects</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>bool</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>Buy</title>
<category>Objects</category>
<subcat>Creation</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>object</rtype>
<params>
@ -50,7 +50,6 @@
<related>
<funclink>Sell</funclink>
<funclink>GetWealth</funclink>
<funclink>GetBase</funclink>
<funclink>FindBase</funclink>
</related>
</func>

View File

@ -7,7 +7,7 @@
<title>C4D_All</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Object category: all categories.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>C4D_Background</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Object category: object is drawn behind the landscape. Useful for effects like clouds or celestial bodies.</desc>
<remark>This category does not work in the old 8 bit graphics system.</remark>

View File

@ -7,7 +7,7 @@
<title>C4D_Goal</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Object category: game goal.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Living</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Objects with this category are alive when created.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Object</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Object category: Item that can hit alive objects.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Parallax</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Object category: the object moves parallax with respect to the landscape. This means that the apparent object position changes depending on the scroll position of the viewport. This can be used to have objects apparently moving in the far background or to create status overlays.<br/>Parallax deviation from the normal location is specified in percent and stored in an array in the <emlink href="definition/properties.html#Parallaxity"><code>Parallaxity</code> property</emlink> of the object (<code>Parallaxity[0]</code> for horizontal, <code>Parallaxity[1]</code> for vertical deviation). This means for normal location these two values should be 100. A value of 0 will lock the object to the viewport. For parallax background object use values between 0 and 100. Object positions can also be negative values. Those objects will then be aligned with the right or bottom edge of the screen respectively.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Rule</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Object category: rule object.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_StaticBack</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Objects with this category do not move. This is useful for all kinds of stuff, like making sure rule objects don't fall out of the landscape.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>C4D_Structure</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Unused Object category.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>C4D_Vehicle</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Unused Object category.</desc>
<related>

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Array</title>
<category>Variables</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: array.</desc>
<examples>

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Bool</title>
<category>Variables</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: boolean value (<code>true</code> or <code>false</code>).</desc>
<examples>

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_C4Object</title>
<category>Variables</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: object pointer.</desc>
<examples>

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Def</title>
<category>Variables</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: Definition. Definitions are a special type of proplist, and this data type is used for distinguishing definitions from proplists.</desc>
<examples>

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Int</title>
<category>Variables</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: integer.</desc>
<examples>

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Nil</title>
<category>Variables</category>
<version>5.2 OC</version>
<version>2.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: nil.</desc>
<examples>

Some files were not shown because too many files have changed in this diff Show More