Not logged inOpenClonk Forum
Up Topic Development / Scenario & Object Development / [Small Project] Castles.ocd
- - By manuelclonk Date 2019-01-29 19:36 Edited 2019-02-17 19:01
Hi there,

So far I prefered to play Clonk Rage in local multiplayer/splitscreen mode with the knight package most. Funny part was always to build and destroy castles in melee mode. Therefore, I did not play Openclonk much yet. However as I have seen the splitscreen is under development and the game starts to become really, really great (New Editor, easier controls, new graphic style, to name a few), I decided to start creating a simple castle package for future settlement melee games:

Current Structures:

- Drawbridge
- Door
- Palisades
- Tower Left/Right/Center (Space: Go upstairs; Hold Space and press left/right if there is an way upstairs and downstairs)
- Hall. It is possible to build other buildings inside a hall.
- Tower Roof: Protects the castle from climbing clonks when placed on top of a tower

It uses the staircase script from Maikels Cannon Tower concept. This is work in progress, next steps are:

- Better Graphics, fewer bugs

Last Update: 17.2.: Elements are correctly loaded from savegames, Connection Feature for Castle Parts, new elements

I also added a small melee scenario, which I could only test with one player though. Feel free to give feedback!

Best regards,

Attachment: Castles.ocd (802k)
Attachment: CastleMelee2.ocs (15k)
Attachment: screenshot.png (34k)
Attachment: screenshot2.png (280k)
Parent - - By Clonkonaut Date 2019-01-29 23:07
Very good! The alignment could make use of the already existing connection feature (like basements can be attached to each other). That you don't need to script all stuff yourself and it's already working with existing systems.
Parent - - By manuelclonk Date 2019-02-03 20:59
Thanks for the reply. This feature looks promising for bridge like elements especially. However, I started looking at the WoodenBridge and Basement scripts and both make use of
IsBelowSurfaceConstruction() { return true; }. If I set it to false it is not possible to place the object in the air anymore. If I set it to true the construction site falls down somehow during construction (left side):

Will try to implement it for normal castle elements however!
Parent - - By Clonkonaut [de] Date 2019-02-04 11:46
IsBelowSurfaceConstruction is a special functions for construction that can be placed below the surface of the landscape. Like basements do whenever you build them below another construction. The construction previewer (what you place when selecting the hammer) will try to place the construction site deeper down if it's set to true. Also, when the construction starts (all building material present), there will be no landscape obstruction checks. But it has nothing to do with the sticking feature of connecting buildings.

The main functions for sticking together are ConstructionCombineWith(), ConstructionCombineDirection() and whatever callback ConstructionCombineWith defines. Examples are the wooden bridge, the basement and the elevator (the elevator would be one that doesn't use IsBelowSurfaceConstruction because it's not one).

The construction site itself does not fall down (because it's a StaticBack object). But it of course creates the building at some point (all building material present) and starts to build it. Because the building is created with Con 1 and not 100, Initialize will not be called. In order to have your buildings float, you need to do something about that in Construction() or in CombineWith(object) - which is called as soon as creation is done and tells you which other building this one should stick to. Of course, this means to change the category to StaticBack or similar techniques to make it float (e.g. the basement changes to StaticBack in Construction()). Otherwise it will fall down because C4D_Structure objects do that.
Parent - By manuelclonk Date 2019-02-04 20:39
Thank you so much for the good explanation! The structure from the screenshot can be connected to the tower now. Will work on the connection feature for the remaining structures next :)
Parent - By manuelclonk Date 2019-02-13 19:21 Edited 2019-02-17 18:36
The connection feature is implemented now for left and right directions. However, for the door and the drawbridge buildings I noticed something strange: Both have set local Touchable=1; and SetCategory(C4D_StaticBack); called in the Construction method. SetCategory(C4D_StaticBack); made the construction flipable by the clonk in the game however (e.g. the Clonk could change the direction of the drawbridge). So right now the door and the drawbridge are not of type C4D_StaticBack but of C4D_Structure instead. Is it possible to use C4D_StaticBack and prevent the construction from flipping somehow?

Edit: Both FlipDir=1 and NoConstructionFlip=False are set in order to allow direction change before building using the spacebar
Parent - - By Armin Date 2019-02-05 19:17
When I overcome my Blender problems, I'll upload an updated version of my castle decorations pack, too. They will likely fit into your castles.
Parent - By manuelclonk Date 2019-02-07 20:58
Good to hear! The castle decoration pack looks quite promising!
Up Topic Development / Scenario & Object Development / [Small Project] Castles.ocd

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill