THATMANOVERTHERE'S PROFILE
I am very into drawing, writing, movies, computers, and video games. Right now, I want to some how combine those things together into a cohesive experience.
Search
Filter
Attempting to code a battle engine
Well, just to be funny, I tried running the engine as is and got this message:
I think that might have something to do with the buttons, I managed to get it to stop doing that, and hope that this edited code will help:
SyntaxError: syntax error game.html:28
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
<!DOCTYPE html>
<HTML lang="en-US">
<HEAD>
<SCRIPT>
var Entity = function (hp, mu, sp, pp, fp, re, de, sl) {
this.hp = hp;
this.pp = pp;
this.mu = mu;
this.re = re;
this.fp = fp;
this.de = de;
this.sp = sp;
this.sl = sl;
};
var Mina = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var RH_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var BC_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var SS_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var names;
var randomnumber = Math.floor(Math.random(10)*10);
var selectedmonster;
if (randomnumber <= 3){
selectedmonster = RH_Whelp;
names = "Red Hand Whelp";
}
else if (randomnumber <= 6, > 3){
selectedmonster = BC_Whelp;
names = "Blue Chest Whelp";
}
else if (randomnumber > 6){
selectedmonster = SS_Whelp;
names = "Sand Stalker Whelp";
}
var battle = 1;
var monsterdead = 0;
var playerdead = 0;
var minaempty = 0;
var monsterempty = 0;
var mina.closeattack = Math.ceil(Math.random(Mina.pp + mina.sp)*20);
var mina.rangeattack = Math.ceil(Math.random(Mina.fp + mina.sp)*20);
var selectedmonster.closeattack = Math.ceil(Math.random(selectedmonster.pp + selectedmonster.sp)*20);
var selectedmonster.rangeattack = Math.ceil(Math.random(selectedmonster.fp + selectedmonster.sp)*20);
var mina.resistance = Math.ceil(Math.random(Mina.re + mina.de)*20);
var selectedmonster.resistance = Math.ceil(Math.random(selectedmonster.re + selectedmonster.de)*20);
var dodgeroll = Math.floor(Math.random(100)*100);
var playerturn = 1;
var monsterturn = 0;
while (battle == 1){
while (playerturn == 1){
if (selectedmonster.sp >= dodgeroll){
<p>names + "dodged the attack!"</p>;
}
else if (mina.closeattack <= selectedmonster.resistance){
<p>"The attack bounced harmlessly off" + names</p>;
}
else if (mina.closeattack < selectedmonster.resistance){
Selectedmonster.hp = (selectedmonster.hp - mina.closeattack + selectedmonster.resistance);
<p>names + "was hit! He has" + selectedmonster.hp + "hp left!"</p>;
}
if (mina.mu <= 0){
<p>"there is no ammo left!"</p>;
}
else if (selectedmonster.sp >= dodgeroll){
mina.mu = mina.mu - 1;
<p>names + "dodged the attack! Mina has" + mina.mu + " shots left!"</p>;
}
else if mina.rangeattack <= selectedmonster.resistance{
mina.mu = mina.mu - 1;
<p>"The attack bounced harmlessly off" + names + "armor. Mina has " + mina.mu + "left."</p>;
}
else if (mina.rangeattack < selectedmonster.resistance){
mina.mu = mina.mu - 1;
Selectedmonster.hp = (selectedmonster.hp - mina.rangeattack + selectedmonster.resistance);
<p> names + "was hit! He has" + selectedmonster.hp + "hp left! Mina has " + mina.mu + "left!"</p>;
}
playerturn = 0;
monsterturn = 1;
}
while (monsterturn == 1){
if (mina.sp >= dodgeroll){
<p>"Mina dodged the attack!"</p>;
}
else if (selectedmonster.closeattack <= mina.resistance)
<p>"The attack bounced harmlessly off Mina's armor."</p>;
}
else if (selectedmonster.closeattack < mina.resistance){
mina.hp = mina.hp - selectedmonster.closeattack + mina.resistance;
<p>"Mina was hit! She has " + mina.hp + " hp left!"</p>;
}
if (selectedmonster.mu <= 0){
<p>names + "has no more ammo!"</P>
}
else if (mina.sp >= dodgeroll){
<p>"Mina dodged the attack!"</p>;
}
else if (selectedmonster.rangeattack <= mina.resistance){
selectedmonster.mu = selectedmonster.mu - 1;
<p>"The attack bounced harmlessly off Mina's armor."</p>;
}
else if (selectedmonster.rangeattack < mina.resistance){
selectedmonster.mu = selectedmonster.mu - 1;
mina.hp = mina.hp - selectedmonster.rangeattack + mina.resistance;
<p>"Mina was hit! She has " + mina.hp + " hp left!</p>;
}
playerturn = 1;
monsterturn = 0;
}
if (selectedmonster.hp < 0){
monsterdead = 1;
battle = 0;
}
if (Mina.hp < 0){
playerdead = 1;
battle = 0;
}
if (Mina.mu < 0){
playerempty = 1
}
if (selectedmonster.mu < 0){
monsterempty = 1
}
</SCRIPT>
</HEAD>
</HTML>
<HTML lang="en-US">
<HEAD>
<SCRIPT>
var Entity = function (hp, mu, sp, pp, fp, re, de, sl) {
this.hp = hp;
this.pp = pp;
this.mu = mu;
this.re = re;
this.fp = fp;
this.de = de;
this.sp = sp;
this.sl = sl;
};
var Mina = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var RH_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var BC_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var SS_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var names;
var randomnumber = Math.floor(Math.random(10)*10);
var selectedmonster;
if (randomnumber <= 3){
selectedmonster = RH_Whelp;
names = "Red Hand Whelp";
}
else if (randomnumber <= 6, > 3){
selectedmonster = BC_Whelp;
names = "Blue Chest Whelp";
}
else if (randomnumber > 6){
selectedmonster = SS_Whelp;
names = "Sand Stalker Whelp";
}
var battle = 1;
var monsterdead = 0;
var playerdead = 0;
var minaempty = 0;
var monsterempty = 0;
var mina.closeattack = Math.ceil(Math.random(Mina.pp + mina.sp)*20);
var mina.rangeattack = Math.ceil(Math.random(Mina.fp + mina.sp)*20);
var selectedmonster.closeattack = Math.ceil(Math.random(selectedmonster.pp + selectedmonster.sp)*20);
var selectedmonster.rangeattack = Math.ceil(Math.random(selectedmonster.fp + selectedmonster.sp)*20);
var mina.resistance = Math.ceil(Math.random(Mina.re + mina.de)*20);
var selectedmonster.resistance = Math.ceil(Math.random(selectedmonster.re + selectedmonster.de)*20);
var dodgeroll = Math.floor(Math.random(100)*100);
var playerturn = 1;
var monsterturn = 0;
while (battle == 1){
while (playerturn == 1){
if (selectedmonster.sp >= dodgeroll){
<p>names + "dodged the attack!"</p>;
}
else if (mina.closeattack <= selectedmonster.resistance){
<p>"The attack bounced harmlessly off" + names</p>;
}
else if (mina.closeattack < selectedmonster.resistance){
Selectedmonster.hp = (selectedmonster.hp - mina.closeattack + selectedmonster.resistance);
<p>names + "was hit! He has" + selectedmonster.hp + "hp left!"</p>;
}
if (mina.mu <= 0){
<p>"there is no ammo left!"</p>;
}
else if (selectedmonster.sp >= dodgeroll){
mina.mu = mina.mu - 1;
<p>names + "dodged the attack! Mina has" + mina.mu + " shots left!"</p>;
}
else if mina.rangeattack <= selectedmonster.resistance{
mina.mu = mina.mu - 1;
<p>"The attack bounced harmlessly off" + names + "armor. Mina has " + mina.mu + "left."</p>;
}
else if (mina.rangeattack < selectedmonster.resistance){
mina.mu = mina.mu - 1;
Selectedmonster.hp = (selectedmonster.hp - mina.rangeattack + selectedmonster.resistance);
<p> names + "was hit! He has" + selectedmonster.hp + "hp left! Mina has " + mina.mu + "left!"</p>;
}
playerturn = 0;
monsterturn = 1;
}
while (monsterturn == 1){
if (mina.sp >= dodgeroll){
<p>"Mina dodged the attack!"</p>;
}
else if (selectedmonster.closeattack <= mina.resistance)
<p>"The attack bounced harmlessly off Mina's armor."</p>;
}
else if (selectedmonster.closeattack < mina.resistance){
mina.hp = mina.hp - selectedmonster.closeattack + mina.resistance;
<p>"Mina was hit! She has " + mina.hp + " hp left!"</p>;
}
if (selectedmonster.mu <= 0){
<p>names + "has no more ammo!"</P>
}
else if (mina.sp >= dodgeroll){
<p>"Mina dodged the attack!"</p>;
}
else if (selectedmonster.rangeattack <= mina.resistance){
selectedmonster.mu = selectedmonster.mu - 1;
<p>"The attack bounced harmlessly off Mina's armor."</p>;
}
else if (selectedmonster.rangeattack < mina.resistance){
selectedmonster.mu = selectedmonster.mu - 1;
mina.hp = mina.hp - selectedmonster.rangeattack + mina.resistance;
<p>"Mina was hit! She has " + mina.hp + " hp left!</p>;
}
playerturn = 1;
monsterturn = 0;
}
if (selectedmonster.hp < 0){
monsterdead = 1;
battle = 0;
}
if (Mina.hp < 0){
playerdead = 1;
battle = 0;
}
if (Mina.mu < 0){
playerempty = 1
}
if (selectedmonster.mu < 0){
monsterempty = 1
}
</SCRIPT>
</HEAD>
</HTML>
Attempting to code a battle engine
author=TrihanThanks. I might make some changes to the stats later on, but I don't really think that will effect much at this stage of things.
I'll have a look at this later today and see what I can do to help you.
Attempting to code a battle engine
Here's the battle engine. Sorry it's so crude:
Var mina.closeattack = Math.ceil(Math.random(Mina.pp + mina.sp)*20);
Var mina.rangeattack = Math.ceil(Math.random(Mina.fp + mina.sp)*20);
Var selectedmonster.closeattack = Math.ceil(Math.random(selectedmonster.pp + selectedmonster.sp)*20);
Var selectedmonster.rangeattack = Math.ceil(Math.random(selectedmonster.fp + selectedmonster.sp)*20);
Var mina.resistance = Math.ceil(Math.random(Mina.re + mina.de)*20);
Var selectedmonster.resistance = Math.ceil(Math.random(selectedmonster.re + selectedmonster.de)*20);
var dodgeroll = Math.floor(Math.random(100)*100);
If selectedmonster.sp >= dodgeroll;
Console.log(names + "dodged the attack!");
Else if mina.closeattack <= selectedmonster.resistance;
Console.log( "The attack bounced harmlessly off" + names);
Else if mina.closeattack < selectedmonster.resistance;
Selectedmonster.hp = selectedmonster.hp - mina.closeattack + selectedmonster.resistance
Console.log( names + "was hit! He has" + selectedmonster.hp + "hp left!")
If selectedmonster.sp >= dodgeroll;
Console.log(names + "dodged the attack!");
If mina.mu <= 0;
console.log( "there is no ammo left!");
Else if mina.rangeattack <= selectedmonster.resistance;
mina.mu = mina.mu - 1;
Console.log( "The attack bounced harmlessly off" + names + "armor. Mina has " + mina.mu + "left.");
Else if mina.rangeattack < selectedmonster.resistance;
mina.mu = mina.mu - 1;
Selectedmonster.hp = selectedmonster.hp - mina.rangeattack + selectedmonster.resistance
Console.log( names + "was hit! He has" + selectedmonster.hp + "hp left! Mina has " + mina.mu + "left!")
If mina.sp >= dodgeroll;
Console.log("Mina dodged the attack!");
Else if selectedmonster.closeattack <= mina.resistance;
Console.log( "The attack bounced harmlessly off Mina's armor.");
Else if selectedmonster.closeattack < mina.resistance;
mina.hp = mina.hp - selectedmonster.closeattack + mina.resistance
Console.log( "Mina was hit! She has" + mina.hp + "hp left!")
If mina.sp >= dodgeroll;
Console.log("Mina dodged the attack!");
If mina.mu <= 0;
console.log( names + "has no more ammo!");
Else if selectedmonster.rangeattack <= mina.resistance;
selectedmonster.mu = selectedmonster.mu - 1;
Console.log( "The attack bounced harmlessly off Mina's armor.");
Else if selectedmonster.rangeattack < mina.resistance;
selectedmonster.mu = selectedmonster.mu - 1;
mina.hp = mina.hp - selectedmonster.rangeattack + mina.resistance
Console.log( "Mina was hit! She has" + mina.hp + "hp left!)
Var mina.rangeattack = Math.ceil(Math.random(Mina.fp + mina.sp)*20);
Var selectedmonster.closeattack = Math.ceil(Math.random(selectedmonster.pp + selectedmonster.sp)*20);
Var selectedmonster.rangeattack = Math.ceil(Math.random(selectedmonster.fp + selectedmonster.sp)*20);
Var mina.resistance = Math.ceil(Math.random(Mina.re + mina.de)*20);
Var selectedmonster.resistance = Math.ceil(Math.random(selectedmonster.re + selectedmonster.de)*20);
var dodgeroll = Math.floor(Math.random(100)*100);
If selectedmonster.sp >= dodgeroll;
Console.log(names + "dodged the attack!");
Else if mina.closeattack <= selectedmonster.resistance;
Console.log( "The attack bounced harmlessly off" + names);
Else if mina.closeattack < selectedmonster.resistance;
Selectedmonster.hp = selectedmonster.hp - mina.closeattack + selectedmonster.resistance
Console.log( names + "was hit! He has" + selectedmonster.hp + "hp left!")
If selectedmonster.sp >= dodgeroll;
Console.log(names + "dodged the attack!");
If mina.mu <= 0;
console.log( "there is no ammo left!");
Else if mina.rangeattack <= selectedmonster.resistance;
mina.mu = mina.mu - 1;
Console.log( "The attack bounced harmlessly off" + names + "armor. Mina has " + mina.mu + "left.");
Else if mina.rangeattack < selectedmonster.resistance;
mina.mu = mina.mu - 1;
Selectedmonster.hp = selectedmonster.hp - mina.rangeattack + selectedmonster.resistance
Console.log( names + "was hit! He has" + selectedmonster.hp + "hp left! Mina has " + mina.mu + "left!")
If mina.sp >= dodgeroll;
Console.log("Mina dodged the attack!");
Else if selectedmonster.closeattack <= mina.resistance;
Console.log( "The attack bounced harmlessly off Mina's armor.");
Else if selectedmonster.closeattack < mina.resistance;
mina.hp = mina.hp - selectedmonster.closeattack + mina.resistance
Console.log( "Mina was hit! She has" + mina.hp + "hp left!")
If mina.sp >= dodgeroll;
Console.log("Mina dodged the attack!");
If mina.mu <= 0;
console.log( names + "has no more ammo!");
Else if selectedmonster.rangeattack <= mina.resistance;
selectedmonster.mu = selectedmonster.mu - 1;
Console.log( "The attack bounced harmlessly off Mina's armor.");
Else if selectedmonster.rangeattack < mina.resistance;
selectedmonster.mu = selectedmonster.mu - 1;
mina.hp = mina.hp - selectedmonster.rangeattack + mina.resistance
Console.log( "Mina was hit! She has" + mina.hp + "hp left!)
Attempting to code a battle engine
author=Trihan
Let me see what I can do.
thanks. Do you want me to post the prototype battle engine I had here too?
Attempting to code a battle engine
author=Trihan
To have the buttons do different things you would attach onclick handlers to them via JavaScript. Displaying the values would depend on how you want them to appear, though I assume you'd simply have a document.write(variablename) where you want the values to be shown. Not entirely sure what you mean with setting a picture for the characters, but you'd basically do more or less the same thing as setting the variables, except you'd have the var value as the filename of the picture then use JavaScript to insert the filename into an <img> tag.
Ok, that does help me out a little bit, but I was hoping for something a little bit more specific on the javascript side of things, as I'm not entirely sure how to set that part up.
Attempting to code a battle engine
author=bulmabriefs144
Ummm, are you using your own engine, one of the rpgmakers, etc? Because we don't know what this is for, we can't help much.
Sorry, I was trying to create my own engine here. I forgot to specify that part.
Attempting to code a battle engine
So...This is some code that I tried to code on my own for a sort of side project where...I'm honestly too embarrassed by the idea to describe it here, so I'll just present my problem. The actual formulas aren't in there yet, but I was wondering if someone could tell me these three things:
1. How to have the buttons activate a different formulas depending on which one is pushed.
2. How to display the name, HP (health points), and MU (Munitions) for each of the characters.
3. How to set a picture to each of the characters.
Here is the coding I have done:
1. How to have the buttons activate a different formulas depending on which one is pushed.
2. How to display the name, HP (health points), and MU (Munitions) for each of the characters.
3. How to set a picture to each of the characters.
4. Isn't as important now, but it is how to change the character. I assume I can set it to the buttons later, but I can do it later.
Here is the coding I have done:
<HTML>
<HEAD>
<SCRIPT>
var Entity = function (hp, mu, sp, pp, fp, re, de, sl) {
this.hp = hp;
this.pp = pp;
this.mu = mu;
this.re = re;
this.fp = fp;
this.de = de;
this.sp = sp;
this.sl = sl;
};
var Mina = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var RH_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var BC_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var SS_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var names;
var randomnumber = Math.floor(Math.random(10)*10);
var selectedmonster;
if (randomnumber <= 3){
selectedmonster = RH_Whelp;
names = "Red Hand Whelp";
}
else if (randomnumber <= 6, > 3){
selectedmonster = BC_Whelp;
names = "Blue Chest Whelp";
}
else if (randomnumber > 6){
selectedmonster = SS_Whelp;
names = "Sand Stalker Whelp";
}
var battle = 1;
var monsterdead = 0;
var playerdead = 0;
var playerempty = 0;
var monsterempty = 0;
var playerturn = 1;
var monsterturn = 0;
while (battle == 1){
while (playerturn == 1){
<form action="game_unkown.html" method="get">
Choose your action:
<button name="R_A" type="submit" value="RA">Ranged Attack</button>
<button name="C_A" type="submit" value="CA">Close Attack</button>
<button name="R_E" type="reset" value="RT">Retreat</button>
if ((isset($_RA) {
}
playerturn = 0;
monsterturn = 1;
}
while (monsterturn == 1){
playerturn = 1;
monsterturn = 0;
}
if (selectedmonster.hp < 0){
monsterdead = 1;
battle = 0;
}
if (Mina.hp < 0){
playerdead = 1;
battle = 0;
}
if (Mina.mu < 0){
playerempty = 1
}
if (selectedmonster.mu < 0){
monsterempty = 1
}
</SCRIPT>
</HEAD>
</HTML>
<HEAD>
<SCRIPT>
var Entity = function (hp, mu, sp, pp, fp, re, de, sl) {
this.hp = hp;
this.pp = pp;
this.mu = mu;
this.re = re;
this.fp = fp;
this.de = de;
this.sp = sp;
this.sl = sl;
};
var Mina = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var RH_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var BC_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var SS_Whelp = new Entity(15, 15, 3, 3, 3, 4, 1, 3);
var names;
var randomnumber = Math.floor(Math.random(10)*10);
var selectedmonster;
if (randomnumber <= 3){
selectedmonster = RH_Whelp;
names = "Red Hand Whelp";
}
else if (randomnumber <= 6, > 3){
selectedmonster = BC_Whelp;
names = "Blue Chest Whelp";
}
else if (randomnumber > 6){
selectedmonster = SS_Whelp;
names = "Sand Stalker Whelp";
}
var battle = 1;
var monsterdead = 0;
var playerdead = 0;
var playerempty = 0;
var monsterempty = 0;
var playerturn = 1;
var monsterturn = 0;
while (battle == 1){
while (playerturn == 1){
<form action="game_unkown.html" method="get">
Choose your action:
<button name="R_A" type="submit" value="RA">Ranged Attack</button>
<button name="C_A" type="submit" value="CA">Close Attack</button>
<button name="R_E" type="reset" value="RT">Retreat</button>
if ((isset($_RA) {
}
playerturn = 0;
monsterturn = 1;
}
while (monsterturn == 1){
playerturn = 1;
monsterturn = 0;
}
if (selectedmonster.hp < 0){
monsterdead = 1;
battle = 0;
}
if (Mina.hp < 0){
playerdead = 1;
battle = 0;
}
if (Mina.mu < 0){
playerempty = 1
}
if (selectedmonster.mu < 0){
monsterempty = 1
}
</SCRIPT>
</HEAD>
</HTML>
Noche (An RPG idea that I am running through and looking for feedback for)
author=suzy_cheesedreams
Uhhhh I would probably go with the first person perspective battle screen, as it is the default for VX Ace. You may as well try to minimize your workload, as obviously the side view system = more script stuff, I would imagine.
Lessening the amount of stuff you have to do and compromising if you're green, which is what I am to game-making, is probably a more efficient way to go, otherwise the project could take too long and you could get frustrated that you can't learn things as quickly as you'd hoped, or find that you've loaded yourself with too much work. (I don't know if this is your first project or not, though.)
Yeah, I have taken a game design course before, but it focused on Gamemaker or just designing the documentation for it, so Gamemaker itself is a bit foreign to me. Seeing as this is my first project in RPGmaker, I guess it would make more sense to go on the easy side of things.
Noche (An RPG idea that I am running through and looking for feedback for)
Ok, I have two things to report right now:
1. I have two more sketch dumps to show you (yes, I tried to minimize their size, but it didn't work out all that well):
2. Aside from that...I started playing Persona Q, and have been debating about using the first person perspective of turn based combat. So then, which way should I go with then, especially since I have had no luck with getting RPGmaker running on my computer yet, so it is still early enough to use.
1. I have two more sketch dumps to show you (yes, I tried to minimize their size, but it didn't work out all that well):


2. Aside from that...I started playing Persona Q, and have been debating about using the first person perspective of turn based combat. So then, which way should I go with then, especially since I have had no luck with getting RPGmaker running on my computer yet, so it is still early enough to use.
Noche (An RPG idea that I am running through and looking for feedback for)
@suzy_cheesedreams
I have some sketches up already, but I will put up some more as soon as I am able to.
@sooz
That's why I hadn't put out any real call for help yet, as I don't really have that much done yet. I could try getting a basic thing with an encounter system and the combat system, but it will take some time.
I have some sketches up already, but I will put up some more as soon as I am able to.
@sooz
That's why I hadn't put out any real call for help yet, as I don't really have that much done yet. I could try getting a basic thing with an encounter system and the combat system, but it will take some time.













