Battle system recreation

Started by Construed, Wed 29/02/2012 06:13:31

Previous topic - Next topic

Construed

I've finally caught up to the point i was at before my game.agf crashed and am working upon the battle system again.
I'm looking for people who may have spare time to comment on how i can improve the battle systems stability and accuracy also ways in increment random damages, random exp etc...

Room script:
Code: ags

///Put in room that brings character to the fight room.
// room script file Room #21

//////////////////Room entrances/Exits

function hHotspot1_WalkOn()
{
player.ChangeRoom(20, 280, 126);
}

function hHotspot2_WalkOn()
{
player.ChangeRoom(22, 42, 126);
}

function hHotspot3_WalkOn()
{
player.ChangeRoom(25, 165, 170);
}

//////////////////////End Room entrances/Exits



//////////////////collision code between goblin and player

function room_RepExec()
{
  


if ((goblin.View==88)&&((player.IsCollidingWithChar(goblin) == 1))){
       Display("Hostile intent is evident,  You prepare for battle.");
    player.ChangeRoom(301); 
     goblin.FollowCharacter(null);
     
}
}

////////////end collision



///////////////goblin random appearance
function room_AfterFadeIn(){
int ran=Random(7777);
if (ran==777) goblin.ChangeRoom(21, 279, 121);
}

///////////end random appearance




////////////goblin follow character
function room_FirstLoad()
{
goblin.FollowCharacter(player, 0, 0);
}
/////////////end follow character





Fight room script Room # 301:

Code: ags

// room script file


function room_AfterFadeIn(){

///////monster/hero health
monsterui.Visible=true; 
player.PlaceOnWalkableArea();


/////goblin attack
object[1].SetView(56);
object[1].Animate(0, 3, eOnce, eBlock);


//////so goblin corpse wont follow character after fight
goblin.FollowCharacter(null);
object[1].SetView(56);
object[1].Animate(0, 3, eOnce, eBlock);
}



function room_RepExec()
{
  
////////change player views to bigger views for in battle  
 if ((player.View==42)||(player.View==16)) {
  player.ChangeView(85);
  object[0].SetView(82);
 }
   else if ((player.View==17)||(player.View==59)) {
    player.ChangeView(87);
    object[0].SetView(84);
  }
  else if ((player.View==18)||(player.View==58)) {
    player.ChangeView(86);
    object[0].SetView(83);
}
  
  
  
 if (IsKeyPressed(eKeyUpArrow) == 1){
   
//////////hero sword object
object[0].Animate(0, 3, eOnce, eBlock);
object[0].Animate(1, 3, eOnce, eBlock);

 int dmg=Random(5);

if (dmg==0)  monsterz-=1;
  

else if (dmg==1) monsterz-=2;

else if (dmg==2) monsterz-=3;

else if (dmg==3) monsterz-=4;

else if (dmg==4) monsterz-=5;

else if (dmg==5) monsterz-=6;

/////////////////goblin attack
object[1].SetView(56);
object[1].Animate(0, 25, eOnce, eBlock);

if (dmg==0)  health-=0;
  

else if (dmg==1) health-=1;

else if (dmg==2) health-=2;

else if (dmg==3) health-=3;

else if (dmg==4) health-=4;

else if (dmg==5) health-=5;



 }



 ///////bring to prev room if monster is dead
 else if (monsterz<=0) {
  int p=player.PreviousRoom;
  player.ChangeRoom(p, 160, 120);
  goblin.ChangeRoom(p, 160, 120);
  player.PlaceOnWalkableArea();
  



////////////////////change the players views and speeds accordingly
  if (player.View==85){
 player.ChangeView(16);
CafeDo(String.Format("speed is %d %d", 5, 5));
player.SetWalkSpeed(5, 5);
  }
  else if (player.View==86) {
    player.ChangeView(18);
    CafeDo(String.Format("speed is %d %d", 5, 5));
player.SetWalkSpeed(5, 5);
  }
  else if (player.View==87) {
    player.ChangeView(17);
    CafeDo(String.Format("speed is %d %d", 5, 5));
player.SetWalkSpeed(5, 5);
}
    
  
  

///////////////tally expierance  
 if ((expierance % 1) == 0) {
 level++;
 expierance += 15;
  player_maxhealth += 5;
  player_maxmana += 5;
  player_maxstamina += 5;
  strength += 1; 
  Display ("You have reached level %d And now have, %d strength, %d health, %d mana, %d stamina, %d gold",level, strength, player_maxhealth, player_maxmana,player_maxstamina, goldshow );

 
 int win=Random(2);
 monsterui.Visible=false; 
  goblin.ChangeView(89);
  

if (monsterz <= 0){

  


///////////////random amounts of gold added according to random
if (win==0)  goldshow += 20;
  

else if (win==1) goldshow += 10;
  
 
else goldshow += 5;
   
}

 }
  
}
 
 
 
}



////////////change player views and weapons according to class
function room_Load()
{
 if ((player.View==42)||(player.View==16)) {
  player.ChangeView(85);
  object[0].SetView(82);
 }
   else if ((player.View==17)||(player.View==59)) {
    player.ChangeView(87);
    object[0].SetView(84);
  }
  else if ((player.View==18)||(player.View==58)) {
    player.ChangeView(86);
    object[0].SetView(83);
}

}



function room_Leave()
{
Display("You have triumphed over your enemy!");
}





I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Construed

I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Construed

#2
I was reading through my last battle system's posts and edited the above accordingly to peoples wishes.
It pretty much works exactley how i want it to as far as animations, Turn based battle.

But i would like to find better ways to do the experience so that it takes like 10 monster kills for 1 level 1 strength etc... and also i would like to figure out how to make strength effect damage % and dexterity or parry effect the damage the player takes..
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Khris

Code: ags
 int dmg=Random(5);

if (dmg==0)  monsterz-=1;
  

else if (dmg==1) monsterz-=2;

else if (dmg==2) monsterz-=3;

else if (dmg==3) monsterz-=4;

else if (dmg==4) monsterz-=5;

else if (dmg==5) monsterz-=6;


                \/
Code: ags
  int dmg = Random(5);
  monsterz -= dmg + 1;


Part of why you're having difficulty with this (or actually, the main reason) is that you seem to be unable to organize your code properly.
Complex code has to be organized like a company, with departments handling projects independently and their VPs reporting to the CEO.
The equivalent of your code is the CEO running all day around the entire company, constantly explaining every single step of every single task to an army of mindless grunts.

Please don't get offended over this analogy, building a well-oiled, productive company is very difficult.

My point is that at this stage, people don't really know where to even start helping you. What you need is well trained department heads, not a single IT guy, if I may strain my analogy. And this is in fact what you're asking for, as opposed to help with a specific problem.

The code isn't properly indented to boot, which further decreases (if not erases) peoples' willingness to help you, including mine.

I'm not trying to put you down or anything, I'm just trying to explain why you aren't getting any replies.

Construed

Quote from: Khris on Thu 01/03/2012 00:31:42
Code: ags
 int dmg=Random(5);

if (dmg==0)  monsterz-=1;
  

else if (dmg==1) monsterz-=2;

else if (dmg==2) monsterz-=3;

else if (dmg==3) monsterz-=4;

else if (dmg==4) monsterz-=5;

else if (dmg==5) monsterz-=6;


                \/
Code: ags
  int dmg = Random(5);
  monsterz -= dmg + 1;

Hmm, i don't really know what you mean by adding +1 to dmg which is the random factor, damage is done by subtracting from monsterz which is a glob var of the specific monsters life.

I know what you mean by organization and a well oiled machine etc.. but that's not what im looking for here, I'm just looking for something that works, besides this pose here this code will never be seen again. Only what it does matters to me, not what it looks like.

As far as indentation goes, yes i have a mental block in that area, Tidyness of code seems pretty useless to me, If it matters THAT much to people i will continue along the solo path i have been on thus far and complete the game with less gratitude towards others.

All im really looking for here is as stated above:
better ways to do the experience so that it takes like 10 monster kills for 1 level 1 strength etc... and also i would like to figure out how to make strength effect damage % and dexterity or parry effect the damage the player takes..

I thank you for taking the time to comment after i have been undeservingly rude to you a few times "Sorry for that".
But if people find it too hard to bear with my mental disabilities i will continue on the path that i've been on which has gotten this game more than 75% complete.

My programming methods, no matter how sloppy or unconventional still work and in the end thats all that really matters.

Thanks, -Jared
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Ghost

#5
Quote from: GrimReapYou on Thu 01/03/2012 00:46:50
AllI'm really looking for here is as stated above:
better ways to do the experience so that it takes like 10 monster kills for 1 level 1 strength etc... and also i would like to figure out how to make strength effect damage % and dexterity or parry effect the damage the player takes..

At least the last two things are pretty straightforward. I haven't read the whole thread and don't know how your code works, but the theory is simple.

For strength affecting damage, let's assume you have an average strength of 5; everything above that would mean you are exeptionally strong (I'm borrowing from GURPS here):
int damageDealt = baseDamage + (playerStrength-5) would add an additional point of raw damage for every point of strength above 5.

For dexterity affecting damage taken, a little more random system:
int damageTaken = baseDamage - (Random(playerDexterity)+1)+playerParry would decrease raw damage by a random number of 1 to playerDext AND the player's parry value.

This is, naturally, no workable code, but a rather simple way to play with variables. Personally I prefer such things to be highly randomized and affected by several factors: Player attributes provide the base, equipment may min or max that base, and then you start to add a random element, so that a very strong player with a very good sword has a high change of dealing really devastating blows, but even he may have a bad day ;)

As for experience, I'd advise to use a system where the monster's "level" is counted against your hero's level, so that a Level1 hero will, say, get 5 XP per Level1 skeleton, but a Level 4 hero will only get 2 XP (simply because these lowly monsters are not really a challenge for him anymore). Players usually accept such a system. Should this be something you want to emulate, I think I can find some tables for that.

Construed

Yea, that sounds like about what i need.
I want the battle system to be as simplistic as the original game, however we cant have all the players skipping all the harder creatures and purely leveling on goblins.
A table for that would be great :D

Thanks, -Jared
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Khris

Quote from: GrimReapYou on Thu 01/03/2012 00:46:50Hmm, i don't really know what you mean by adding +1 to dmg which is the random factor, damage is done by subtracting from monsterz which is a glob var of the specific monsters life.
I'm not increasing the value of dmg.
The two lines I posted do the exact same thing as the seven lines you posted.
Don't you see that in each of the six lines, you are subtracting (dmg+1) from monsterz, regardless of how big dmg is? You're basically doing the exact same thing six times.

Also, "people don't help you because you're posting messy code" isn't the same as "I demand you code your game according to my standards of what constitutes proper coding".
I don't give two shits about what your code looks like or whether you just want it to work.
What I'm pointing out is that YOU should care about how the code you're posting here looks like, IF YOU WANT OTHER PEOPLE'S HELP.
(Also, coding readably will make it easier FOR YOU to deal with your own code, especially if your coding methods are also messy. But yeah, tidiness of code is useless. Says the guy who blames a memory leak for getting a "no nested functions" error.)

It's so exhausting to deal with you because you tend to interpret even the most harmless things people say in the absolute worst possible way.
I'm not planning to go into this any further, but if you have a mental illness and aren't taking your meds, better start taking them again.

Ghost

Quote from: GrimReapYou on Thu 01/03/2012 01:19:15
A table for that would be great :D

Then let's assume we always know the level of a monster. We will give "normal" XP when player and monster are the same level. We will give MORE XP when the monster's level is
higher, and less XP when it is lower. This makes strong monsters a worthy challenge and discourages grinding. To make this as easy as possible we keep a baseXP variable for each monster.
I will "cap" the system at level +5 or -5 for examples sake; here I give 0 XP for a monster that's five levels below the hero, and triple XP for a monster that's five levels above.

To get the level difference, we say:
levelGap = monsterLevel - playerLevel

and then:

float experienceGained;

if (levelGap == -5) experienceGained = 0
else if (levelGap == -4) experienceGained = baseXP/3.5
else if (levelGap == -3) experienceGained = baseXP/2.7
else if (levelGap == -2) experienceGained = baseXP/1.7
else if (levelGap == -1) experienceGained = baseXP/1.2
else if (levelGap == 0) experienceGained = baseXP
else if (levelGap == 1) experienceGained = baseXP*1.5
else if (levelGap == 2) experienceGained = baseXP*1.7
else if (levelGap == 3) experienceGained = baseXP*2.0
else if (levelGap == 4) experienceGained = baseXP*2.5
else if (levelGap == 5) experienceGained = baseXP*3

This is very rough, though, and would need a lot of tweaking. It also assumes that you do NOT reach 0 XP by divisions other than the -5 one. And it's AWFULLY scripted- but it shows the idea, and the system itself is commonly used. You can easily make it cover a larger range, and a monster could as well have an array of pre-made experience points (maybe for a boss monster that ignores your level completely and always gives generous XP, or mooks that ONLY give XP when you're actually weaker).

Hope that helps!

Construed

Quote from: Khris on Thu 01/03/2012 01:31:05
Quote from: GrimReapYou on Thu 01/03/2012 00:46:50Hmm, i don't really know what you mean by adding +1 to dmg which is the random factor, damage is done by subtracting from monsterz which is a glob var of the specific monsters life.
I'm not increasing the value of dmg.
The two lines I posted do the exact same thing as the seven lines you posted.
Don't you see that in each of the six lines, you are subtracting (dmg+1) from monsterz, regardless of how big dmg is? You're basically doing the exact same thing six times.

Also, "people don't help you because you're posting messy code" isn't the same as "I demand you code your game according to my standards of what constitutes proper coding".
I don't give two shits about what your code looks like or whether you just want it to work.
What I'm pointing out is that YOU should care about how the code you're posting here looks like, IF YOU WANT OTHER PEOPLE'S HELP.
(Also, coding readably will make it easier FOR YOU to deal with your own code, especially if your coding methods are also messy. But yeah, tidiness of code is useless. Says the guy who blames a memory leak for getting a "no nested functions" error.)

It's so exhausting to deal with you because you tend to interpret even the most harmless things people say in the absolute worst possible way.
I'm not planning to go into this any further, but if you have a mental illness and aren't taking your meds, better start taking them again.

Those 6 lines aren't doing the exact same thing six times, its taking 6 different random amounts of damage, "dmg" is not damage, its simply an int for a random number that has absolutely no effect on "damage" which is "monsterz".
tried and tested.

And as for the memory leek, obviously your not as smart as I thought you were, Memory leeks can damage random parts of memory where entire or partial scripts/code/machine language is stored, causing an infinite amount of random undesirable effects to ALL aspects of AGS and any other program on earth. "Including a total Game.agf crash".

You say i misinterpret harmless things people say, I think i was rather polite and even included an "apology to you".

As for my medication I don't take any at all, because there is none that works.
I have to deal with my issues myself.

As far as brackets being  here}          or here}                      or here}
Did you ever think i have a different way of reading code than you and most others here, I scroll down my script and i expect my brackets to be touching the edges, that is how i differentiate where my functions begin and end at a quick pace as i can scroll down a page of my code faster than the matrix and find what I'm looking for at the drop of a dime.

I have a different mindset and a different way of doing things than you and most other people sometimes misconstrued as brutish or simplistic, yet it works for me, and i get things done that alot of people could never dream of.

Everyone on earth ridiculed Albert Einstein, who couldn't even find his way home by himself every day.
Yet now everyone uses what he came up with in some form or another. My point is we are all different and you'd be amazed how those differences can manufacture wonderful and even believed to be impossible things.

End point is, I like you alot as a person khris, Your smart, forgiving and a great person whom of which i'm sure in the end your achievements could possibly change the course of history.

But you should look at the lower forms of intelligence such as myself with more mercy and simply help instead of ridiculing.
Quote from: Ghost on Thu 01/03/2012 01:39:56
Quote from: GrimReapYou on Thu 01/03/2012 01:19:15
A table for that would be great :D

Then let's assume we always know the level of a monster. We will give "normal" XP when player and monster are the same level. We will give MORE XP when the monster's level is
higher, and less XP when it is lower. This makes strong monsters a worthy challenge and discourages grinding. To make this as easy as possible we keep a baseXP variable for each monster.
I will "cap" the system at level +5 or -5 for examples sake; here I give 0 XP for a monster that's five levels below the hero, and triple XP for a monster that's five levels above.

To get the level difference, we say:
levelGap = monsterLevel - playerLevel

and then:

float experienceGained;

if (levelGap == -5) experienceGained = 0
else if (levelGap == -4) experienceGained = baseXP/3.5
else if (levelGap == -3) experienceGained = baseXP/2.7
else if (levelGap == -2) experienceGained = baseXP/1.7
else if (levelGap == -1) experienceGained = baseXP/1.2
else if (levelGap == 0) experienceGained = baseXP
else if (levelGap == 1) experienceGained = baseXP*1.5
else if (levelGap == 2) experienceGained = baseXP*1.7
else if (levelGap == 3) experienceGained = baseXP*2.0
else if (levelGap == 4) experienceGained = baseXP*2.5
else if (levelGap == 5) experienceGained = baseXP*3

This is very rough, though, and would need a lot of tweaking. It also assumes that you do NOT reach 0 XP by divisions other than the -5 one. And it's AWFULLY scripted- but it shows the idea, and the system itself is commonly used. You can easily make it cover a larger range, and a monster could as well have an array of pre-made experience points (maybe for a boss monster that ignores your level completely and always gives generous XP, or mooks that ONLY give XP when you're actually weaker).

Hope that helps!
That's a great table to base my system on, I will give it much thought and try my best to figure out how to connect it to my games system, although i'll most likely use it as a base idea to implement another way as my brain works differently I dont use structs or anything of the such so i'll probley come up with several workarounds to add similar variances to the different values.

Thanks very much for taking the time to post :D

-Jared 

I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Ryan Timothy B

#10
Code: ags
 int dmg = Random(5);

if (dmg == 0)  monsterz -= 1;
else if (dmg == 1) monsterz -= 2;
else if (dmg == 2) monsterz -= 3;
else if (dmg == 3) monsterz -= 4;
else if (dmg == 4) monsterz -= 5;
else if (dmg == 5) monsterz -= 6;


                \/
Code: ags
  int dmg = Random(5);
  monsterz -= dmg + 1;


Quote from: GrimReapYou on Thu 01/03/2012 02:35:45
Those 6 lines aren't doing the exact same thing six times, its taking 6 different random amounts of damage, "dmg" is not damage, its simply an int for a random number that has absolutely no effect on "damage" which is "monsterz".
tried and tested.

What are you seriously going on about? Khris is 100% correct that your code above is exactly the same as his code. Let me walk you through this...


You're using Constant numbers. Meaning they never change. Making the number you're subtracting by is dmg + 1 each line of code.
Do you not see the recurring pattern above?

int Damage = Random(5)

       If Damage == 0  then   subtract 1 from monsterz       // monsterz -= Damage + 1
else If Damage == 1  then   subtract 2 from monsterz       // monsterz -= Damage + 1
else If Damage == 2  then   subtract 3 from monsterz       // monsterz -= Damage + 1
else If Damage == 3  then   subtract 4 from monsterz       // monsterz -= Damage + 1
else If Damage == 4  then   subtract 5 from monsterz       // monsterz -= Damage + 1
else If Damage == 5  then   subtract 6 from monsterz       // monsterz -= Damage + 1

Therefore, if all of these lines are  monsterz -= Damage + 1

Making this line of code exactly the same as all these lines above:
Code: ags
monsterz -= Random(5) + 1;



Calm down the hostility and constantly trying to make us, the people helping you, look like the bad guys because you can't understand simple logic and math.

Khris

Maybe we have to do this step by step...?
I have actually seen code like this:

Code: ags
  if (a == 1) b = 1;
  else if (a == 2) b = 2;
  else if (a == 3) b = 3;
  else if (a == 4) b = 4;
  ...
(It went on until 100...)

Do you see that the exact same thing can be achieved by
Code: ags
  b = a;

?

Memory leak:
Don't tell me I'm not smart only to say something really stupid immediately afterwards. A memory leak doesn't randomly damage parts of RAM; what it does is use up RAM constantly without freeing it again, which ultimately leads to there being no free memory left, if the program runs long enough. At least look shit up before getting condescending; it's what I do, too.

Code:
You don't get it, do you? It's only about code you post here to ask for help. I don't care how you code in private.
BUT:
Telling us that this:
Code: ags
}

 }
  
}
 
 
 
}

is intended and helps you finding what you want really fast is ridiculous. It's like saying you like them that way after accidentally shitting all over your strawberries. Please, grow up.

WHAM

I can't stop laughing!!!  :D ;D ;)

Also: have a picture of a "memory leek" according to Google:
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Construed

#13
Quote from: Ryan Timothy on Thu 01/03/2012 08:10:01
Code: ags
 int dmg = Random(5);

if (dmg == 0)  monsterz -= 1;
else if (dmg == 1) monsterz -= 2;
else if (dmg == 2) monsterz -= 3;
else if (dmg == 3) monsterz -= 4;
else if (dmg == 4) monsterz -= 5;
else if (dmg == 5) monsterz -= 6;


               \/
Code: ags
  int dmg = Random(5);
  monsterz -= dmg + 1;


Quote from: GrimReapYou on Thu 01/03/2012 02:35:45
Those 6 lines aren't doing the exact same thing six times, its taking 6 different random amounts of damage, "dmg" is not damage, its simply an int for a random number that has absolutely no effect on "damage" which is "monsterz".
tried and tested.

What are you seriously going on about? Khris is 100% correct that your code above is exactly the same as his code. Let me walk you through this...


You're using Constant numbers. Meaning they never change. Making the number you're subtracting by is dmg + 1 each line of code.
Do you not see the recurring pattern above?

int Damage = Random(5)

      If Damage == 0  then   subtract 1 from monsterz       // monsterz -= Damage + 1
else If Damage == 1  then   subtract 2 from monsterz       // monsterz -= Damage + 1
else If Damage == 2  then   subtract 3 from monsterz       // monsterz -= Damage + 1
else If Damage == 3  then   subtract 4 from monsterz       // monsterz -= Damage + 1
else If Damage == 4  then   subtract 5 from monsterz       // monsterz -= Damage + 1
else If Damage == 5  then   subtract 6 from monsterz       // monsterz -= Damage + 1

Therefore, if all of these lines are  monsterz -= Damage + 1

Making this line of code exactly the same as all these lines above:
Code: ags
monsterz -= Random(5) + 1;



Calm down the hostility and constantly trying to make us, the people helping you, look like the bad guys because you can't understand simple logic and math.

Yes I'm on a third grade math level, So lets all dance around in a circle make fun of and not help me when i have to overuse code to do simple things.

Yes its a recurring pattern, not "6 lines doing the same exact thing".

Not to mention that its random, so it could be any of those numbers...

And the whole point of this post was to find better ways of achieving better randomization and % based incrementing.

You don't have to tell me what memory leeks do and i don't have to look on google.
Did you forget i just had a game crash due to them.

Button graphics blacked out, Rooms that i know existed suddenly didn't exist, functions stopped working, and when i went to save my game it saved a bunch of fragmented bullshit you would call data that never worked again.

You know i've tried to have patience and compassion with you people, you overlooked some of my mistakes in the past, but it seems all you can do is ridicule my work and tell me how shitty it is instead of providing genuine help.

So like your mother said... If you don't have anything good to say, Don't say anything at all.


[EDIT]
Said some evil racist crap here  *Slaps self in the face*
[/EDIT]
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

WHAM

Sorry guys, but I just have to post one more time:

Grim: According to your profile you are a 27(!!!) years old AGS-tutoring, proof-reading "PRO"(!!!!!) and you can't even fucking spell "Memory leak" if your life depended on it! And YOU are telling a guy like Khris how "he is not as smart as you thought"!

By ye Gods I tried to not post anymore but this is just too much!

BWA-HA-HA-HA-HA!!!  ;D
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Construed

in anger people make mistakes, but from this point on i have nothing to say to you khris or ryan timothy ever again, your a bunch of ridiculous nerd trolls who have done nothing but hold me back, you are now dead to me.

KTHX BAI
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Khris

Grim:
You can not still not get this, can you?

Please, look at this line:
Code: ags
  monsterz -= dmg +1;


Now imagine that the random result was 4, so dmg equals 4. This line of code will first evaluate the right side, dmg + 1. Since dmg is 4, dmg + 1 is 5. So put together, in the case of dmg being 4, we end up with monsterz -= 5;
Which is exactly what you used: if (dmg == 4) monsterz -= 5;

Now imagine the random result was 1. We have monsterz -= dmg +1, which becomes monsterz -= 1 + 1, which becomes monsterz -= 2;
Which is exactly what you used: if (dmg == 1) monsterz -= 2;

Thus, regardless of the value of dmg, monsterz -= dmg + 1 will always do exactly the same as the corresponding line of your six.

Granted, there are situations where you can't take that shortcut. But not using it if it's so obviously, clearly available, is just, I don't know... sad.

Also, you said you got the "nested functions" error due to a memory leAk although it's clearly always the user's fault, and now you're suddenly talking about your game crashing.
It's like talking to a five year old. We can see right through these cheap attempts at winning the arguments, and so far you failed every time. (This isn't about winning of course, but don't expect us to fall for your cheap tactics and don't expect us to not call you out on it. And stop making an utter ass of yourself by going on about patience and compassion when you're straining ours every time, all the time.)

Yeah, thanks, and bye. Get the hell outta here.

Construed

#17
You just cant accept being wrong lol, which you are, your scientific mind just cant comprehend it its really funny.
When a line produces a diffrent number, it is NOT the same, its a diffrent number, i think pre-schoolers could understand that.
I felt sorry for myself because I had no shoes.
Then I met the man with no feet.

Ryan Timothy B

#18
Quote from: GrimReapYou on Thu 01/03/2012 17:06:55
You know i've tried to have patience and compassion with you people, you overlooked some of my mistakes in the past, but it seems all you can do is ridicule my work and tell me how shitty it is instead of providing genuine help.

Dude, what are you talking about? You're showing us a gigantic mess of code and asking us to better improve your battle script. How is it that once we point out a few mistakes or things you could improve with your code to better help you it's suddenly a bad thing?

The only reason the monster health code was brought up several times because you completely went psycho and told Khris he was dead wrong and doesn't know what he's talking about. "Tried and tested" = Bull.


Let's reverse this situation a little. If someone had posted a background in the Critics Lounge and you commented on it telling the person that they need to learn perspective because the background at the moment has issues. Then this person barks back at you telling you that you're delusional and not as smart as he/she once thought you were, even though it's glaringly obvious to you that he's wrong and the background does indeed have issues.


This is exactly what you're doing to us:

You: Hey guys, I need help adding 2 and 5 together
Us: 5 + 2 = 7
You: You're wrong! I've tried and tested it! I'm tired of asking for your help if all you're going to do is poke ridicule at my work instead of providing genuine help.

Umm.. what?


edit:
QuoteYou just cant accept being wrong lol, which you are, your scientific mind just cant comprehend it its really funny.
When a line produces a diffrent number, it is NOT the same, its a diffrent number, i think pre-schoolers could understand that.
Okay now I'm really confused with you. You're either a troll who is just pissing around with us, or you simply can't understand it and think we're the idiots.

RickJ

#19
Simply hilarious.  :=   Oh how boring life would be if we didn't get one of these from time to time.   It's times like this that make me nostalgic for Monty Python "... the parrot's not dead, he's sleeping ..." .  ;)

[edit]
I'm also a bit of a Trek fan and this seems somehow appropriate here. Enjoy  ;D
http://www.youtube.com/watch?v=-WmGvYDLsj4&feature=related


SMF spam blocked by CleanTalk