Not logged inOpenClonk Forum
- - By Asmageddon [pl] Date 2010-01-26 18:55
I'm currently working on a magic system, but today I have no more time, and there is(or are) few problems, if you will to help you can download file I will upload and fix it or tell me how to.
Overview of the system:
All clonks have got one variable for each school of magic(fire,astral,earth,water,air) defining skill in it.
Items:
Staff - Required for casting spells, staff can additionally boost user skill in all magic schools(or in only one) and/or grant knowledge of magic spells
Wand - Holds some mana points, which can be used for casting its spell (ie. with Wand of Fireball you can cast fireballs until Wand mana is depleted). Some wands can auto-recharge
Scroll - Holds one charge of magic spell. Scrolls are one-time, so their magic power is a bit higher(by 2 or 3 grades depending on power of one who created them)
Orb - Source of magic power, orbs eventually boost magic skills. More powerfull orbs can recharge or even grant knowledge of spells.
Spellbook - Spellbook is source of knowledge of magic spells secondary to clonk's memory.
So in normal round EVERY clonk have got skill of 2 in every magic school and EVERY (normal)staff have got magic power of 1 for every school, and basic orbs do not boost user magic power, so ALL spells are cast with power of 3.
Some spells can be charged, take a look at script of Generic spell object.
I also plan on making a rule, that makes all magic spells shared by all clonks, so spell - once researched(or learned by some clonk) - can be used by all clonks of this player with a staff and source of Mana
Mana can be drawn from orbs, OR from clonk private reserves(or if there is not enough mana points life energy can be used as power supply, this is just an option).

Currently I have:
SPELL - Generic spell object (seems to work well)
SPELL_JUMP - Jump spell
WNDY - Wand of jump, does not work, I do not know if it is fault of wand object, jump spell or generic spell object(I doubt its this one)

EDIT: There is possibility, that I will have no time to work on it in few nearest days, so you can feel free to finish it for me :P

I'd be gratefull if somebody would download the file and take a look at what is wrong, and what could be corrected/upgraded.
Attachment: Magic.c4d.zip (50k)
Reply
Parent - By Newton [de] Date 2010-01-26 20:04 Edited 2010-01-26 20:06
I'll not comment on the magic system itself as this topic is not up for discussion yet. Meaning a magic system is not part of the agenda for the next few releases and also is a topic that (imo) needs to be concepted and discussed by all to reach some common solution how the magic will work in OC. Just one thing: I like the idea that your magic system seems to be a object-driven one - that the magic is done by useable objects instead of the clonk himself.

Here is what I can advise you:
  • avoid using LocalN(). Local variables should be private, that is only the same object should have direct access to these. Instead, use getter/setter methods, e.g. Set/Do/GetMana()

  • Avoid over-engineering: While abstraction is generally a good thing, too much abstraction and at the wrong places causes unflexibility and hides the mechanics behind the system - it can even lead to more work. E.g. the only thing the air-staff-item does is forward the Control*-controls to the spell which also effectively just defines an action on the release of the mouse button (ControlUseStop). This whole thing seems unnecessary as the same could be done more straightforward and easier, without hiding the mechanics and keeping flexibility, by checking the mana of the clonk/staff before doing that airblast.
    This is actually a common mistake many people do, especially amongst the more experienced C4-scripters.

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill