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

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 have created 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: 2.3.: Castle Arch can be stacked on each other, Correct material components

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

Best regards,

Attachment: CastleMelee2.ocs (15k)
Attachment: Castles.ocd (820k)
Attachment: screenshot.png (34k)
Attachment: screenshot2.jpg (67k)
Attachment: castles_preview.gif (564k)
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-23 19:18
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
Edit2: Okay, I ended up creating an extra invisible object for the door control...
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!
Parent - By manuelclonk Date 2019-03-16 20:34 Edited 2019-03-16 20:43
Some preview for the next version: Started developing a horse, but it will probably take a while until it is finished/bug free:
Parent - - By Caesar [jp] Date 2019-03-17 05:11
I wonder, might the towers be a good place to use the half-solid masks?
Parent - - By manuelclonk Date 2019-03-23 10:42 Edited 2019-03-23 11:40
Do you mean for the doors or for the staircase? For the staircase it would be possible to use something like in the illustration attached (Blue is half solid mask)
Attachment: screenshot1.png (3k)
Parent - - By Caesar [jp] Date 2019-03-23 12:43 Edited 2019-03-23 12:45
For the staircases, yes. I would have tried something simpler first, though.

Parent - - By manuelclonk Date 2019-03-29 21:03 Edited 2019-03-29 21:14
Here is a first draft! See Attachment below. Will add it to the next release and work on the texture a bit more.
Question that remains: How to walk down?
Possible balancing problem:  Arrows can be fired only upwards

Attachment: Staircase2.ocd (72k)
Attachment: screenshot1.jpg (19k)
Parent - - By Sven2 [us] Date 2019-03-29 22:30
For movement in staircases, I think <Space> + <Direction key (WASD)> to move up/down or even sideways would be nice. I don't think the clonk should even have to "enter" the staircase (like in CR). It could just be teleported if you press Interact+Direction.
Parent - By K-Pone [de] Date 2019-03-30 22:32
But can this be done somehow? I mean, Space + A/D switches between interactable objects and Space + W switches between available actions for the currently selected object. Can this be overridden?
Parent - By Luchs Date 2019-03-30 00:03

>Question that remains: How to walk down?

Press X to drop through the half-solid mask.
Parent - By Caesar [jp] Date 2019-04-01 14:14
I had a thing somewhere that allowed arrows and bullets to permeate half-solid masks in any direction. But that still leaves flints and other weapons.

Also, I'd like to know… how does this feel? Does it allow to move smoothly?
Up Topic Development / Scenario & Object Development / [Small Project] Castles.ocd

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill