Help with Leveling

I am currently working on my first game in the engine. It is a RPG and i want it so when the sword hits an enemy a certain amount of times level goes up. I know in theory how it should be done but i cant put it together. I am not a complete noob to the game engine and i have lots of experience in blender. Thank-you for any help.

do you want it

  1. when the sword hits the enemy it gives experience points…
    2.or when it kills the enemy it gives xp points.

i don’t know much about python so if any of the… people that are good at it out there… ughh.

do something like this (this ain’t in python but the python people may be able to translate)

int xp;
int xpreq;
intlevel;
xpreq = 100;

(bit of python here):
if.sensor(collisionwiththeenemyguy).isPositive():
xp += 10;
if (xp == xpreq);
level += 1;
xp -= xpreq;
xpreq *=2; (Pretty sure that works…)

ughh… don’t know enough python, probably shouldn’t post but what the hey, you could probably do this with logic bricks but i’m too tired… you’d need to put that in like a loop of some sort…

I’m sorry if the above made absolutely no sense at all, i’ve been up for 20+ hours straight and it is still Midday over here…

:frowning:

Thanks for response, but i don’t want to do it in python I want to try and do it in logic bricks.

You can use the property sensors to check the value of properties (e.g. Experience and Level ). Expression controllers can also filter sensor pulses (e.g. from a collision sensor). The property actuators can modify property values (e.g. Level + 1).
If you play around with this you should find a way.

Thats what ive been trying to do, but i cant get it to work. Thats the reason i posted this, to see if someone has a more complete answer.

It’s quite simple actually:

Just have 2 planes with text property and texture etc…

Now one is your XP and the other is level, have it when your sword hits an enemy (Collision sensor) it will ad 1 to your text XP text property.

Now once your xp gets to for example 10, have it reset and have your level property add 1.

That’s how I see it being done.

hm… this is an interesting question, and i too need to know the answer to this one. Will be following along and see if there comes a good answer to this.

-thondal-

Ok, I made a simple levelling up system for you,

File: Click

Now all you would need to do is change the spacebar with your collision with an enemy.

Hope this is some help to you,
Brave.

heres the blend
if you know logic bricks this should make sence
hehe its done in 2.43 because the parenting was acting funny
arrow keys to move
when you poke the other block 10 times you gain a level:rolleyes:
http://littlebobs.googlepages.com/levelsystem.blend
edit: hmm braveheart beat me well mines a little more complete

Thank-you very much for the help. I will look over this further to see how i can implement this my game. Thanks again!

Theres only one problem with it braveheart… When u press spacebar ten times, instead of adding just 1 lv it adds 2. Did u do this on purpose or is it a glitch?

1 more question, it might seem really noob, but how do u add text like that in the game engine?

First you need to get a bitmap font grid (you can get some from ST150’s site) then you must add a plane and UVmap it so it fits just around the @ in the grid. Then click “Text” in the Texture face options. Then create a property called Text. The value of this property will be displayed through the Text object.

Text> http://www.blending-online.co.uk/8501/17001.html

And to make your own faonts> http://www.blendenzo.com/tutFTBlender.html

It adds 2 levels?
Are you sure?

It was working fine for me, only added 1 level for every 10 XP.

Thanks for the info on the text and i guess it doesnt really matter about it adding 2 levels, but thanks anyways for the example.

braveheart are u using a test build of 2.43? because i think i´ve read this somewhere that there is a glitch in the bge in 2.42 that sometime it adds 2 instead of 1. Oh well… This thread is really useful, will be making a level up system when i get that far. Just need a menu, enemies etc… long way. no wrong in having goals is there? :stuck_out_tongue:

oh, btw, good luck ragchan :wink:

-thondal-

I am yes :o reason being i feel that colision is allot more stable in it, the collision for the game i’m working on at current was all messed up in 2.42.