Jump to content
MakeWebGames

Recommended Posts

Posted

I don't code for the MCcodes engine anymore... I got fed up with fixing stuff so much that I decided to make my own engine.

Its nearly finished.

Anyways, Ive converted a few things I coded for my engine to work for MCcodes, although I haven't tested them as such yet they should all work.

This is my leveling code converted to work with MCcodes V1, I did this mainly because arson took his off and many people have asked for it, Ive also done it because arson also used a pointless query in his =/

What does mine do differently?

Well instead of reseting the exp each time this keeps it, basically it works like TCs upgrade, it will calculate how many levels the player can upgrade from there experience and it will then upgrade them to that level instead of someone playing, getting 300% then upgrading only to find out they have gone up one level and lost 200% exp, which is what happens now I believe.

Check it out anyways.

Open up global_func.php and find:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

REPLACE the whole CheckLevel() function shown above with the following:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Then save and close that file and upload it or whatever....

Now create the upgrade.php file

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

The comments are to tell you what does what if you didn't know, they can be removed to compact the code if you wish.

Now add this...

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

... to where ever you want to display the [upgrade] link when the player can upgrade. I suggest next to the level in the user stats section.

 

NOTICE - Please don't use this if you don't know what your doing, this can mess up your game if you don't know what it does, that is if your game is up, if its not you have nothing to worry about. BACKUP THE DATABASE AND FILES BEFORE YOU INSTALL. I will not be held responsible for your careless actions =)

Let me know if it works or not, It works fine in my engine but I may of messed up the conversion.

+1 If you use it =)

Matt

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

lol nice. ;)

Most games have that upgrade mod where you have to click multiple times to upgrade 1 level so you do it again and again. :) So it goes straight up to required level.

I have made this system where you can only upgrade minimum once per week (soon to be 10 days maybe), Keeps the level economy fair.

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

Thats a pretty neat idea.

Like I said I don't code for the MCcode engine it was just for the guys that were asking for one.

I have to say though... why doesn't anyone use the database.class.php file? There are functions that are of use in there, I know I haven't seen any paid mods so I cant say anything about what I haven't seen but for what I have its not used =/

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

I currently have on my game, where once players level up they gain stat points. And they can be used to upgrade differant things. Also I have a gym but can only use it once a day. Energy goes up every 24 hours.

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

You lose the percentage of Exp because more exp is needed to go up to the next level..

Say you need 100 exp to get to level 2, and then 200 exp to get to level 3

you get 150 exp in one poof somehow.

You gain your 1 level which is 100% exp.

Then you are on level 2, waiting for level 3. you only have 50 extra exp. thats 25% of 200, as opposed to 50% of 100.

Let me know if that confuses you. you need to understand that the exp needed goes up for each level...it doesnt stay the same, or every mccode game would have level 10000000000 players in a day.

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

Soooo... Bad Idea..As it is nothing but a huge bug script.

All it does is give the users more exp for their levels, leveling them faster than they should...Sorry you wasted your time coding it though!

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

lol

Soooo... Bad Idea..As it is nothing but a huge bug script.

All it does is give the users more exp for their levels, leveling them faster than they should...Sorry you wasted your time coding it though!

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

 

Soooo... Bad Idea..As it is nothing but a huge bug script.

All it does is give the users more exp for their levels, leveling them faster than they should...Sorry you wasted your time coding it though!

Are you retarded? What part of this didnt you get?

 

Anyways, Ive converted a few things I coded for my engine to work for MCcodes, although I haven't tested them as such yet they should all work.

Meaning it works, I have tested it.

What your trying to say is bull shit, take this for example.

L1- 100

L2- 500

L3- 900

Ok so they need 500 exp to get to level 2 they get 500 exp they level up to level two now they need an EXTRA 400 exp before they level up to level 3... Hows that hard?

Now... If you were to stop upgrading it works like this, your level 1 you have 900 so you can upgrade to level 2 and level 3

THE CODE, will work out what level you should be from your exp, say 901 you should be level 3, it will then work out the difference which is 2 so it will times everything by two because your going up two levels!

Simple?

If you actually read the code, you would find out i only use one exp variable, therefore you cannot have a percentage to next level based of your stats, you will have to work it out using the formula. Therefore what your saying is crap, because it doesn't do that.

Dont cry because i posted a better version than the one you took down, i mean why did it even have that useless query in there?

Back at ya. for the -1 (asuming its you)

 

EDIT- actually I think iI misread your post. I think your answer is to change the god damn formula to fit your game dumb ass,

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

for example.

Anyone who has that formula in there game with it multiplying by one is going to level up quicker no matter what upgrade thing they have, truth is its is actually nothing to do with my code, it just the fact you too incompetant to consider changing the formula that works out how much exp you need to level up, bigger number = more time it take to get = lower levels longer.

Also that formula is mccodes formula so everyone is using it anyway, with lower numbers than i posted, so im guessing everyones game is buggy because of that.

  • 1 month later...
Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

Very good mod overall :-)

But there is one problem - as the variable $upgrade is declared inside a function, it's trapped in that function - you can't get the value of it anywhere else, it'll just give false or NULL.

try this for check_level instead

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and where you want to put upgrade text

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

and I also fixed another slight error - while things like

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

do set $y to "x", it's bad syntax and you should use quotes around the string.

Also, this mod slightly changes the workings of the EXP system.

Say if you were level 1, needed 100 exp to get to level 2 and had 105 exp.

With this mod, you would goto level 2 but still have 105 exp.

With the original coding, you would goto level 2 but the 100 would be taken off your exp leaving you with 5.

I believe this is what Arson was trying to point out but he worded it badly - this mod will increase the leveling rate on your game due to this change.

  • 1 month later...
Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

hi all. well i have the upgrade mod (not matts) and i found out recently that people were saving their upgrades so they could keep leveling up quicker by doing crimes as a level 1. as you know the lower the level the quicker you gain experience, as you get to a higher level you gain less experience and have to do more crimes to get the same amount you would get with doing less crimes as a lower level. what this meant is that i had people asking to have their accounts deleted and they made a new account and saved all their upgrades til they had enough to reach level 200 + and then they would upgrade. well after they have reached a high level then they would get a lot less experience as a high level player and the user levelling would then slow right down for them.

i had to block the saving of upgrades as a temp fix so now they have to upgrade each time they have an upgrade available. i used this code in attack.php and in criminal.php.

if($ir['upgrade'] > 0)

{

print "You must upgrade to continue";

$h->endpage();

exit;

}

not a good fix but a temp answer to my problem. :mrgreen:

  • 4 weeks later...
Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

Even fixing this so it takes the exp away it still causes masive leveling with anyone who has a significant amount of exp. more than it should

  • 4 months later...
Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

i get this

Warning: Division by zero in /home/criminal/public_html/header.php

when i put that in, any idea's

 

function check_level()

{

global $ir,$c,$userid;

$exp_needed=(int) (($ir['level']+1)*($ir['level']+1)*($ir['level']+1)*2.2);

if($ir['exp'] >= $exp_needed)

{

$upgrade = Y;

}

}

Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

the exp needed needs to be filled in and added to you users table and put in 100 for exp needed. Then the divison zero gose away. It just looking for exp needed and its blank.

  • 4 months later...
Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

 

the exp needed needs to be filled in and added to you users table and put in 100 for exp needed. Then the divison zero gose away. It just looking for exp needed and its blank.

I didn't understand that can you explain clearer and if i need something for SQL can someone tell me?

  • 4 weeks later...
Posted

Re: [Free] Advanced(ish) Level Upgrade Mod.

I s strange this upgrade thingy dont work properly I ended up coding my own smoother versionw hich makes people click one at a time :-)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...