Script: CR to OC

Revision as of 10:43, 21 January 2013 by Zapper (talk | contribs) (Created page with "If you are coming from ClonkRage scripting, you will find some new things in OpenClonk. Not much and not very difficult, but you will have to know them.<br /> This page does n...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

If you are coming from ClonkRage scripting, you will find some new things in OpenClonk. Not much and not very difficult, but you will have to know them.
This page does not explain every thing in detail, but should give you an overview.

ActMap

The ActMap.txt is completely gone, you can declare actions directly in the script of an object now, like this:

local ActMap=
{
	Attach = 
	{
		Prototype = Action,
		Name="Attach",
		Procedure=DFA_ATTACH,
		NextAction="Be",
		Length=1,
		FacetBase=1,
	}
};


This has the positive effect that you can modify actions when the game is running!

DefCore

A lot of entries from the DefCore.txt went into script, too. Here an example from the axe script:

local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";
local UsageHelp = "$UsageHelp$";
local Rebuy = true;
local ChopStrength = 10;

This helps if you need your own entries. Sadly there is no system which DefCore entries have moved to script and which haven't.

zoomed Graphics.png

You can use 2D graphics just like in CR. But you can also defined versions for zoom levels so that the graphics do not look too pixelized at high zoom. You do that by simply putting a dot and the zoom level into the graphics name:

Graphics.4.png
Overlay.4.png

3D Models

As you know,