Welcome, Guest. Please login or register.

What openbor you prefer: Double dragon,battletoads or final fight !? by lirexpatrio
[December 07, 2012, 07:15:27 pm]


what are your favorite games OpenBOR?! by lirexpatrio
[December 07, 2012, 07:09:46 pm]


Post Some Awesome Videos by maxman
[December 07, 2012, 05:51:39 pm]


Can @cmd playmusic "aaaa" 1 also increse music sound ? by BeasTie
[December 07, 2012, 05:24:38 pm]


Streets of Rage: Silent Storm by mtrain
[December 07, 2012, 03:45:05 pm]


Site will be down for maintenance on 12/8/2012 thru 12/10/2012 by Damon Caskey
[December 07, 2012, 07:42:42 am]


Cancelled SOR 3d Remake by riccochet
[December 07, 2012, 03:58:33 am]


Dungeon Fighter: B.O.R. by msmalik681
[December 07, 2012, 03:24:27 am]


[TUTORIAL] How to create 4 Games of OpenBOR in 1 CD (650 MB) by magggas
[December 06, 2012, 09:46:25 pm]


custknife by Bloodbane
[December 06, 2012, 09:34:09 pm]


blockfx help by B.Kardi
[December 06, 2012, 04:09:14 pm]


street of age 4 hd by corradlo
[December 06, 2012, 01:41:36 pm]


ClaFan - Classic Fantasy ver 1.17 by soniczxblade
[December 06, 2012, 05:01:20 am]


Bug Archive by Bloodbane
[December 06, 2012, 02:00:44 am]


"Bio-Doom" and "Gears of Doom" by BulletBob
[December 05, 2012, 10:07:21 pm]


Contra Locked 'N' Loaded v2 by Bloodbane
[December 05, 2012, 09:39:43 pm]


Downloadable OpenBoR Manual by BeasTie
[December 05, 2012, 08:31:24 pm]


Having trouble testing changes by B.Kardi
[December 05, 2012, 03:05:53 pm]


DragonBall Absalon by msmalik681
[December 05, 2012, 02:52:13 pm]


[Hi-Res] Swamp by Vibrant
[December 05, 2012, 10:47:14 am]


  • Dot Guests: 162
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.



Author Topic: Help with level up system (I'm new to scripting)  (Read 829 times)

0 Members and 1 Guest are viewing this topic.

Offline Mykole11@gmail.com

  • Jr. Member
  • **
  • Posts: 18
Help with level up system (I'm new to scripting)
« on: June 18, 2012, 03:43:12 pm »
ok I followed piefwolf's scripting for level up system, works great! But I can't keep the stats after I die, continue, or quit. Another thing I want to do is increase offense and defense when I level up, how do I do that? If anyone could help me that would be great!

Offline Mykole11@gmail.com

  • Jr. Member
  • **
  • Posts: 18
Re: Help with level up system (I'm new to scripting)
« Reply #1 on: June 18, 2012, 03:48:46 pm »
And how do I make it so that when I level up, it's says "level up" on top of my character?
And how do I  put the current Level # under my MP

Offline Pierwolf

  • Sr. Member
  • ****
  • Posts: 348
    • Pierwolf's Magic chamber of abstract theories about relativity of Karma and metempsychosis
Re: Help with level up system (I'm new to scripting)
« Reply #2 on: June 18, 2012, 04:41:00 pm »
If you take the scripts from the ver.2.0 of my mod, you can see that it keeps the statistic after you die.
also, for the level up on top of the char, you have to make a spawn animation. just look in the data/chars/misc/levelup folder.  ;)

My current project:

Knights & Dragons: The Endless Quest - COMPLETE!

Offline Mykole11@gmail.com

  • Jr. Member
  • **
  • Posts: 18
Re: Help with level up system (I'm new to scripting)
« Reply #3 on: June 18, 2012, 06:11:54 pm »
Thanks man! I got stats to work the way I wanted but can you go into more detail about
how to make the spawn animation work?

"for the level up on top of the char, you have to make a spawn animation. just look in the data/chars/misc/levelup folder."

I found the folder but I don't know how to use it or how to make it work, is there more scripting involved?

Offline Pierwolf

  • Sr. Member
  • ****
  • Posts: 348
    • Pierwolf's Magic chamber of abstract theories about relativity of Karma and metempsychosis
Re: Help with level up system (I'm new to scripting)
« Reply #4 on: June 18, 2012, 06:45:12 pm »
Yes of course there is a lot of scripting involved.

the level up spawn is called in lvup.c, on the line:

Code: [Select]
void spawnLvup(void ent)
{
clearspawnentry();
setspawnentry("name", "levelup");
void vSpawn=spawn();
float fX =getentityproperty(ent, "x");
float fY = getentityproperty(ent, "a");
float fZ = getentityproperty(ent, "z");
changeentityproperty(vSpawn, "position", fX, fZ, fY + 70);
}

you have to play with this in order to make it work.

to put the current level # wherever you want, you have to play with lvupsc.c and player.c, specifically at the lines:

Code: [Select]
void set()
{
void pindex = getentityproperty(getlocalvar("self"),"playerindex");
void score = getplayerproperty(pindex,"score");
int lv = getLevel(score);
setAbi(pindex,getlocalvar("self"));
settextobj(pindex,69+120*pindex, 253, 0, 1, "LVL"+lv);
}


scripting is a pain actually, and i too am still a total noob at it; you are a new member,  i suggest you first to learn how basic openbor works, before approaching scripts!  :)
My current project:

Knights & Dragons: The Endless Quest - COMPLETE!

Offline Mykole11@gmail.com

  • Jr. Member
  • **
  • Posts: 18
Re: Help with level up system (I'm new to scripting)
« Reply #5 on: June 19, 2012, 08:20:55 am »
Thanks man! ok I'll try it! I just don't understand what most of it means.

Offline Mykole11@gmail.com

  • Jr. Member
  • **
  • Posts: 18
Re: Help with level up system (I'm new to scripting)
« Reply #6 on: June 19, 2012, 09:28:05 am »
I'm trying to make a 2d Castlevania game

Offline Mykole11@gmail.com

  • Jr. Member
  • **
  • Posts: 18
Re: Help with level up system (I'm new to scripting)
« Reply #7 on: June 19, 2012, 07:38:27 pm »
Hey, I got the "level up" txt to work, it shows up on the top right of the screen.
I figured out how to move it up and down, the top right of the screen is good for me tho.
Now if only I could get the Level # to show up under my MP bar.

 



 0%




SimplePortal 2.3.3 © 2008-2010, SimplePortal