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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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++.
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.
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
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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>
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>
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.
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
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.
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.
Bit 3 (C4MatOv_Monochrome) was removed in fc5c38468 ("Material: Remove
color field, use textures as is", 2009), but was still mentioned in the
documentation.
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.
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.
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.
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.
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.
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.
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.
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.
- 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...
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.
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.
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.
- 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
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.
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).
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.
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
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.
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.).
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
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.
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.
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.
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.
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)
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
- 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.
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.
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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
}
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!
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.
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
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.
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).
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).
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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".
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.
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).
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).
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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 '{}'.
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.
On Windows, we cannot resolve addresses using getaddrinfo() before
initializing Winsock. By storing the address as string, the address
parsed later on.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
The pByChild parameter to C4Group::AdvanceFilePtr was never used except
to pass it to itself recursively, and C4Group::ProcessOut was never used
at all.
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.
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.
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.
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.
option(PROJECT_FOLDERS"Put source files into subfolders in project file"ON)
option(DEPLOY_QT_LIBRARIES"Deploy Qt libraries to executable path"OFF)
CMAKE_DEPENDENT_OPTION(USE_COCOA"Use Apple Cocoa widgets."ON"APPLE"OFF)
CMAKE_DEPENDENT_OPTION(USE_WIN32_WINDOWS"Use Microsoft Desktop App User Interface widgets."ON"WIN32"OFF)
CMAKE_DEPENDENT_OPTION(USE_SDL_MAINLOOP"Use SDL to create windows etc. Qt editor."ON"NOT USE_COCOA AND NOT USE_WIN32_WINDOWS AND NOT HEADLESS_ONLY"OFF)
option(WITH_AUTOMATIC_UPDATE"Automatic updates are downloaded from the project website."OFF)
CMAKE_DEPENDENT_OPTION(WITH_APPDIR_INSTALLATION"Install into an AppDir"OFF"UNIX AND NOT APPLE AND WITH_AUTOMATIC_UPDATE"ON)
option(HEADLESS_ONLY"Only build headless parts. Somewhat reduces dependencies. (still needs libpng because that one's small and hard to remove.) Only tested with make/gcc/linux."OFF)
@ -189,20 +224,15 @@ REQUIRE_CXX_SOURCE_COMPILES("template<class... T> class C; int main() { return 0
#time,sothetestbelowworks.
REQUIRE_CXX_SOURCE_COMPILES("#include <regex>\nint main() { std::cregex_iterator ri; }"HAVE_WORKING_REGEX" If you are using gcc, please update to gcc 4.9.")
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.
FILE(WRITE"${_pchdir}/${_name}""#ifdef __cplusplus\n#warning Precompiled header not used. Turn off or fix!\n#endif")#Thisfileisaddedsothecc-unitsdon'tstumbleovernotbeingabletoincludethefile
<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>
<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>
<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>
<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>
<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>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlinkhref="playercontrols.xml#Globals">Global definitions</emlink>.</col>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="playercontrols.xml#Repeat">Key repeats</emlink>.</col>
<col>If specified then the delay of the first key repeat event can be changed. See <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="playercontrols.xml#ExtraData">ExtraData</emlink>.</col>
<col>Optional ID that is passed to the script function. See <emlinkhref="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 <emlinkhref="playercontrols.xml#Script">Script callbacks</emlink>. (Default value)</col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlinkhref="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 <emlinkhref="playercontrols.xml#Keys">Key mappings</emlink>.</col>
<col>Specifies the key(s) of this mapping or a reference to another mapping. See <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="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 <emlinkhref="playercontrols.html#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>AlwaysUnhandled</literal_col>
@ -351,7 +351,7 @@
<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><emlinkhref="playercontrols.xml#Repeat">Key repeats</emlink> are generated.</li>
<li><emlinkhref="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>
<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>
<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>
<hid="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 <emlinkhref="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 <emlinkhref="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>
<hid="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
<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>
<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 <emlinkhref="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>
<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>
<desc>Data type: Definition. Definitions are a special type of proplist, and this data type is used for distinguishing definitions from proplists.</desc>
<desc>Material to test to be inserted (see <funclink>Material</funclink>()).</desc>
</param>
<param>
<type>int</type>
<name>x</name>
<desc>X insert position or offset</desc>
<optional/>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y insert position or offset</desc>
<optional/>
</param>
<param>
<type>proplist</type>
<name>out_insertpos</name>
<desc>If a writeable proplist is passed, members x and y are filled with the position at which the material would be inserted.</desc>
<optional/>
</param>
</params>
</syntax>
<desc>Tests if a material pixel at the given position can be inserted.</desc>
<remark>If the target position already contains material of the same density as the inserted material, the engine will search upwards for a proper insertion position.</remark>
<desc>Material to test to be inserted (see <funclink>Material</funclink>()).</desc>
</param>
<param>
<type>int</type>
<name>x</name>
<desc>X insert position or offset</desc>
<optional/>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y insert position or offset</desc>
<optional/>
</param>
<param>
<type>proplist</type>
<name>out_insertpos</name>
<desc>If a writeable proplist is passed, members x and y are filled with the position at which the material would be inserted.</desc>
<optional/>
</param>
</params>
</syntax>
<desc>Tests if a material pixel at the given position can be inserted.</desc>
<remark>If the target position already contains material of the same density as the inserted material, the engine will search upwards for a proper insertion position.</remark>