I have got two questions.
First question:
I'm going to make something like spells in my maps, so I decided to learn how to make at least existing spell working with cooldown. For example I have removed "RemoveObject" from fireball spell and now I need to make some cooldown, because if I don't do it, clonks will be able to cast fireballs without cooldown.
Also I tried to make spells periodically spawn again in inventory, but I don't like this idea. It may cause a lot of bugs, errors and lags.
Also a small question: is it possible to make player be not able to throw items away? I have tried it once, but I have failed, so I make a limit on same items in clonk's inventory
Second question:
How to draw a map? I have tried to draw a map with different tools (Paint, Photshop, etc.) But it doesn't work right. I have saved it as .bmp and it still didn't work. Maybe there are some special tools for drawing maps for clonks? Or at least there is a best one? Because making generated landscape is not always good/useful/easy.
First question:
I'm going to make something like spells in my maps, so I decided to learn how to make at least existing spell working with cooldown. For example I have removed "RemoveObject" from fireball spell and now I need to make some cooldown, because if I don't do it, clonks will be able to cast fireballs without cooldown.
Also I tried to make spells periodically spawn again in inventory, but I don't like this idea. It may cause a lot of bugs, errors and lags.
Also a small question: is it possible to make player be not able to throw items away? I have tried it once, but I have failed, so I make a limit on same items in clonk's inventory
Second question:
How to draw a map? I have tried to draw a map with different tools (Paint, Photshop, etc.) But it doesn't work right. I have saved it as .bmp and it still didn't work. Maybe there are some special tools for drawing maps for clonks? Or at least there is a best one? Because making generated landscape is not always good/useful/easy.
I just answer the first question, I just have a minute:
As far as I know there is no magic in OC, right? For ClonkRage:
It is slightly tricky to do it, because you have to modify the really messy combo system In Clonk Rage, but it's possible. I build a system in a scenario called "Fireland" (search for my MagicLeagueExtra packet on CCAN),
I also used a variant of that in my Blackfield modification and added cooldown to some spamming spells.
At last there is Etagenkampf ("Floor Fight"), which uses a System by Limeoux. So check it out, but be warned: It was for me (not beeing a programmer) really advanced shit.
As far as I know there is no magic in OC, right? For ClonkRage:
>First question:
It is slightly tricky to do it, because you have to modify the really messy combo system In Clonk Rage, but it's possible. I build a system in a scenario called "Fireland" (search for my MagicLeagueExtra packet on CCAN),
I also used a variant of that in my Blackfield modification and added cooldown to some spamming spells.
At last there is Etagenkampf ("Floor Fight"), which uses a System by Limeoux. So check it out, but be warned: It was for me (not beeing a programmer) really advanced shit.
I actually was not thinking about making something like system in Clonk Rage. I want to make a different system. So these spells will look like items, but they won't remove from Inventory. Hope you understand what I'm talking about :DD
So Actually I want to make a map with 4 different teams, 6 "permanent" spells and one choosable. So If I will get answers to my questions, probably I will make exactly what I'm thinking about
So Actually I want to make a map with 4 different teams, 6 "permanent" spells and one choosable. So If I will get answers to my questions, probably I will make exactly what I'm thinking about
Cool, looking forward to it. You can also change the number of items a clonk can carry.
Like the Alchemist from CRs Xeron/Queron/whatsitcalled? Most of the common items (Flints, rocks, wood, coal, etc.) had a spell assigned to them that you could use every so often per item without additional cost. Each item in the inventory had a halo around them whose color depended on how much of the cooldown was done.
>I'm going to make something like spells in my maps, so I decided to learn how to make at least existing spell working with cooldown. For example I have removed "RemoveObject" from fireball spell and now I need to make some cooldown, because if I don't do it, clonks will be able to cast fireballs without cooldown.
You could add an effect to the spell that wears off after time and doesn't allow the spell to be casted while it's on. Or you could save the last cast time and check if enough time has passed since that.
>Drawing maps
I think the question has already been answered here, still: The thing that matters with clonk maps is not the actual color, but the palette-index. mspaint is not really good at preserving it. You can draw maps in the console/editor mode of openclonk.
Ok. I will try to draw maps.
But what scripts or functions do I need to use in order to make cooldown? I have tried to find it, but I only found this: GetActTime
But what scripts or functions do I need to use in order to make cooldown? I have tried to find it, but I only found this: GetActTime
Either, you work with effects, or with
FrameCounter
, a local variable and comparisons.
I have got one problem. Still wonder why, but I have no idea what to do, so cooldown will work like it must. Here is my code:
What must I place after "if(timer>500) target->"?
I tried to use different things, but everything was making wrong effect. For example once I have got effect like this: charging Fireball and after some time shots, I don't need such effect.
public func ControlUse(object pClonk, int ix, int iy)
{
AddEffect("Cooldown",this,100,4+Random(2),this,this->GetID());
AddEffect("Fireball", nil, 100, 1, nil, GetID(), pClonk->GetOwner(), Angle(0,0,ix,iy),pClonk->GetX(), pClonk->GetY());
Sound("Fireball");
Sound("Fireball");
return 1;
}
func FxCooldownTimer(object target, effect, int timer)
{
if(timer>500) target->
return 1;
}
What must I place after "if(timer>500) target->"?
I tried to use different things, but everything was making wrong effect. For example once I have got effect like this: charging Fireball and after some time shots, I don't need such effect.
You need to check whether the spell is still on cooldown in ControlUse (if(GetEffect(...))) and just remove the effect when the time is up (return FX_Execute_Kill in FxCooldownTimer).
I have got another question >.<
Where is editor mode for openclonk?
Where is editor mode for openclonk?
> Also a small question: is it possible to make player be not able to throw items away? I have tried it once, but I have failed, so I make a limit on same items in clonk's inventory
If we don't have the option to "lock" an item in its slot yet (i.e., make it so you cannot throw it away), then we should definitely add that functionality.
I was making new spell and then I realised that I want to make unusual way to remove cooldown.
Here is my code:
And as I can see, function "Initialize" causes an error and doesn't work. It supposed to cause removing cooldown if Clonk's speed by X or Y is 0.
I'm sure problem is in "Initialize"
And yes, this spell is increasing clonk's speed by 2 *lol*
Here is my code:
protected func Initialize()
{
var y = pClonk->GetYDir();
var x = pClonk->GetXDir();
if(x=0) target->RemoveEffect("Cooldown",this);
if(y=0) target->RemoveEffect("Cooldown",this);
return 1;
}
protected func ControlUse(object pClonk, iX, iY)
{
if(GetEffect("Cooldown",this))
{
pClonk->Message("Reloading!");
return true;
}
else
{
AddEffect("Cooldown",this,100,4+Random(2),this,this->GetID());
var y = pClonk->GetYDir();
var x = pClonk->GetXDir();
pClonk->SetYDir((y) * 2);
pClonk->SetXDir((x) * 2);
return 1;
}
}
func FxCooldownTimer(object target, effect, int timer)
{
if(timer>50) target->RemoveEffect("Cooldown",this);
return 1;
}
And as I can see, function "Initialize" causes an error and doesn't work. It supposed to cause removing cooldown if Clonk's speed by X or Y is 0.
I'm sure problem is in "Initialize"
And yes, this spell is increasing clonk's speed by 2 *lol*
There are some issues:
In
And a smaller thing in your
If you want to remove the effect from the timer function you can simply do
So the line in your
Initialize
is called when the object (the scroll) is created. Your variables pClonk
is not known at that time! Which Clonk do you mean?In
Initialize
you use if(x=0)
. Be careful there: X=Y means "set X to Y". You want X==Y which means "Is X the same as Y?".And a smaller thing in your
FxCooldownTimer
function:If you want to remove the effect from the timer function you can simply do
return -1;
or return FX_Execute_Kill;
(which is the same).So the line in your
Fx*Timer
could look like this:if (timer > 50) return -1;
Strange, but when I use
What must I use instead of
Actually I tried
I Still don't know what must I use istead of
pClonk
, it works fine. I mean Clonk, which uses the scroll.What must I use instead of
Initialize
? I think if I put if ((x==0) && (y==0)) return -1
in FxCooldownTimer, it won't work. Or will it?Actually I tried
return FX_Execute_Kill
seems like I used it wrong way.I Still don't know what must I use istead of
Initialize
.
What do you want the stuff in Initialize to do?
You want to remove the effect when the Clonk is not moving?
You want to remove the effect when the Clonk is not moving?
Then Initialize would be the wrong place - it is only executed once when the object (the scroll) is created.
You should put the check in the Fx*Timer function, as you already wrote:
With
PS: I see that your effect target is not the Clonk but the scroll. So if you want to use "target" in the Fx*Timer function and target should be your Clonk, then you should add the effect to the Clonk and not to the scroll:
You should put the check in the Fx*Timer function, as you already wrote:
if ((x == 0) && (y == 0)) return -1;
With
var x = target->GetXDir();
not pClonk->GetXDir()
, because "pClonk" is not known at that point.PS: I see that your effect target is not the Clonk but the scroll. So if you want to use "target" in the Fx*Timer function and target should be your Clonk, then you should add the effect to the Clonk and not to the scroll:
AddEffect("Cooldown",pClonk,100,4+Random(2),this,this->GetID());
Thank you.
I know, that cooldown effect is on scroll, I think it's better, because if I will put it on clonk, I will probably need to rename all Cooldown effects for all spells, so spells will have cooldown effect separately. Also if someday I will be able to lock item slot, It will be not necessary to put cooldown on clonks (except of this spell, probably)
I know, that cooldown effect is on scroll, I think it's better, because if I will put it on clonk, I will probably need to rename all Cooldown effects for all spells, so spells will have cooldown effect separately. Also if someday I will be able to lock item slot, It will be not necessary to put cooldown on clonks (except of this spell, probably)
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill