Mana not subtracting

Get help using Construct 2

Post » Wed Dec 14, 2011 5:30 am

I'm really not sure why but when I cast a spell the mana does not consume, I have it set when a character clicks on an object it "casts" the spell (either left click or right click). I have the action:

Player | Subtract SpellBullet.ManaCost from Mana;

but it does not work at all, it's strange because I have:

Player | Toggle notCastCD

just above it but it works fine... also putting an append text box into that event seems to not work at all either. I may have some redundant events or actions but this is still a work in progress and I've not yet went through and optimized things yet nor have I started creating custom textures...still borrowing from others for now.

ProjectDL.capx

Websitekiasta2011-12-14 05:38:06
B
3
G
1
Posts: 12
Reputation: 599

Post » Wed Dec 14, 2011 7:45 am

I can't tell you for sure, what's going wrong.
What I can tell you is that you really should use sub-events (How events work).

I'm pretty sure a strict reorganisation of the code and less splitting/includes (you really don't need to split the code so much) will help settle things down.
For a better organisation readability of the code, use groups.

There's not much to be done there to help but massively rewrite the whole thing, which I'm not willing/able to do right now.

With a cleaner structure, the code is likely to behave as expected.Kyatric2011-12-14 07:46:06
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Wed Dec 14, 2011 2:20 pm

I'm just making this as a learning experience, thanks for the advice. I'll have to take a look at that when I get to work :)

I've read a bit and basically I'm still using C++ OOP logic. Using event sheets like header file includes are not the same, like class inheritance? I guess I really don't understand the logic at all of Construct 2. I'm trying to understand the logic but I really have no idea. I thought I was doing pretty well *shrugs* oh well.kiasta2011-12-14 15:16:48
B
3
G
1
Posts: 12
Reputation: 599


Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 13 guests