Soul Bound (Open world dungeon crawl)

This is the place to post your own creative works for other to play or give feedback on!
Forum rules
This forum is for posting and collaborating upon third party work. Please do not post request-threads, and avoid posting artwork that is not your own unless it is being used as a reference.

Re: Soul Bound (Open world dungeon crawl)

Postby that man » Tue May 27, 2014 9:35 pm

Well, the changes I have made to the code have gone nowhere...and by nowhere, I mean, this is literally what a week of tinkering has brought me:
Spoiler (click to show/hide):

Code: Select All Code
<HTML>
<HEAD>
<SCRIPT>
var Entity = function (health, lust, strength, resilience, willpower, intelligence, libido, speed) {
    this.health = health;
    this.strength = strength;
    this.lust = lust;
   this.resilience = resilience;
   this.willpower = willpower;
   this.intelligence = intelligence;
   this.libido = libido;
   this.speed = speed;
};
var player = Entity(500, 0, 10, 10, 10, 10, 10, 10);
var selectedmonster = lesser_witch(250, 0, 5, 5, 10, 15, 15, 10);
var selectedmonster = goblin(100, 0, 15, 15, 5, 5, 15, 5);
var selectedmonster = lilith(500, 0, 25, 25, 25, 25, 25, 25);

var names;

var randomnumber = Math.floor(Math.random(10)*10);

var selectedmonster;
if (randomnumber >= 0 && randomnumber < 3){
   selectedmonster = lesser_witch;
   names = "Lesser Witch";
}
else if (randomnumber > 3 && randomnumber < 6){
   selectedmonster = goblin;
   names = "Goblin";
}
else if (randomnumber > 6){
   selectedmonster = lilith;
   names = "Lilith";
}

var battle = 1;
var monsterdead = 0;
var playerdead = 0;
var monsterhorny = 0;
var playerhorny = 0;

var playerturn = 1;
var monsterturn = 0;
   while (battle == 1){

while (playerturn == 1){

   selectedmonster.health = selectedmonster.health - Math.ceil(Math.random(player.power - selectedmonster.resilience)*10);
      console.log(names + "'s Health is now " + selectedmonster.health);
   selectedmonster.lust = selectedmonster.lust + Math.ceil (Math.random(player.libido + player.willpower - selectedmonster.willpower - selectedmonster.intelligence)*10);
      console.log(names + "'s Resitence is at " + selectedmonster.lust);
playerturn = 0;
monsterturn = 1;
}

while (monsterturn == 1){
   player.health = players.health - Math.ceil(Math.random(selectedmonster.power + selectedmonster.speed - player.resilience - player.speed)*10);
      console.log("player's Health is now " + players.health);
   player.lust = players.lust + Math.ceil (Math.random(selectedmonster.libido + selectedmonster.willpower - player.willpower - player.intelligence)*10);
      console.log("Player's Resitence is at " + players.lust);
playerturn = 1;
monsterturn = 0;
}

if (selectedmonster.health < 0){
   monsterdead = 1;
   battle = 0;
}

if (selectedmonster.lust > 99){
   monsterhorny = 1;
   battle = 0;

}

if (players.health < 0){
   playerdead = 1;
   battle = 0;

}

if (players.lust > 99){
   playerhorny = 1;
   battle = 0;

}

}
</SCRIPT>
</HEAD>
</HTML>

What exactly am I doing wrong? Am I just bad at programming? Should I just use a pre-built engine, and then credit the maker? Gah!
Anyway, yeah, if I can't figure out what's wrong, I may just focus on the story, enemies, factions, and other such things for now.
that man
 
Joined: Sat Jul 28, 2012 5:07 pm

Re: Soul Bound (Open world dungeon crawl)

Postby kvier » Wed May 28, 2014 12:23 am

First problem: you declare Entity as a function that returns an object containing properties of a combatant, but use the name of the monster as a function, rather than assigning the result of the Entity function to a new variable. Furthermore, using the this accessor requires that you use new so that there's something to modify.
Code: Select All Code
var Entity = function (health, lust, strength, resilience, willpower, intelligence, libido, speed) {
[...]
var player = Entity(500, 0, 10, 10, 10, 10, 10, 10);
var selectedmonster = lesser_witch(250, 0, 5, 5, 10, 15, 15, 10);
var selectedmonster = goblin(100, 0, 15, 15, 5, 5, 15, 5);
var selectedmonster = lilith(500, 0, 25, 25, 25, 25, 25, 25);
You want things like var lesser_witch = new Entity(250, 0, 5, 5, 10, 15, 15, 10);

Second problem: You don't want those redundant tests in your if/else if/else if. (Currently, 3 and 6 will produce no monster instead of one of them, because 3 is neither more than 3 nor less than 3 nor more than 6).
Code: Select All Code
if (randomnumber >= 0 && randomnumber < 3){
   selectedmonster = lesser_witch;
   names = "Lesser Witch";
}
else if (randomnumber > 3 && randomnumber < 6){
   selectedmonster = goblin;
   names = "Goblin";
}
else if (randomnumber > 6){
   selectedmonster = lilith;
   names = "Lilith";
}
Remove the randomnumber > 3 && and if (randomnumber > 6) — they're handled by the previous test.

Third problem: simple typo, "players" instead of "player" (or vice versa).


Stylistic point: Add the monster name to the Entity function that creates the combatant object. Then you don't need to keep track of two unlinked variables (selectedmonster and names)
kvier
 
Joined: Mon Apr 23, 2012 7:46 pm

Re: Soul Bound (Open world dungeon crawl)

Postby that man » Wed May 28, 2014 12:45 am

Well, it's cleared up some of the other problems, but now the player is undefined (same trouble I had during the week when I tried fixing it), though, the monsters should be recognized now. I cleaned up all the mistakes you said to, and there's a couple more tentative changes in there, but this is what I've got:
Spoiler (click to show/hide):

Code: Select All Code
<HTML>
<HEAD>
<SCRIPT>
var Entity = function (health, lust, strength, resilience, willpower, intelligence, libido, speed) {
    this.health = health;
    this.strength = strength;
    this.lust = lust;
   this.resilience = resilience;
   this.willpower = willpower;
   this.intelligence = intelligence;
   this.libido = libido;
   this.speed = speed;
};
var player = Entity(500, 0, 10, 10, 10, 10, 10, 10);
var lesser_witch = new Entity(250, 0, 5, 5, 10, 15, 15, 10);
var goblin = new Entity(100, 0, 15, 15, 5, 5, 15, 5);
var lilith = new Entity(500, 0, 25, 25, 25, 25, 25, 25);

var names;

var randomnumber = Math.floor(Math.random(10)*10);

var selectedmonster;
if (randomnumber <= 3){
   selectedmonster = lesser_witch;
   names = "Lesser Witch";
}
else if (randomnumber <= 6){
   selectedmonster = goblin;
   names = "Goblin";
}
else if (randomnumber > 6){
   selectedmonster = lilith;
   names = "Lilith";
}

var battle = 1;
var monsterdead = 0;
var playerdead = 0;
var monsterhorny = 0;
var playerhorny = 0;

var playerturn = 1;
var monsterturn = 0;
   while (battle == 1){

while (playerturn == 1){

   selectedmonster.health = selectedmonster.health - Math.ceil(Math.random(player.power - selectedmonster.resilience)*10);
      console.log(names + "'s Health is now " + selectedmonster.health);
   selectedmonster.lust = selectedmonster.lust + Math.ceil (Math.random(player.libido + player.willpower - selectedmonster.willpower - selectedmonster.intelligence)*10);
      console.log(names + "'s Resitence is at " + selectedmonster.lust);
playerturn = 0;
monsterturn = 1;
}

while (monsterturn == 1){
   player.health = player.health - Math.ceil(Math.random(selectedmonster.power + selectedmonster.speed - player.resilience - player.speed)*10);
      console.log("player's Health is now " + player.health);
   player.lust = player.lust + Math.ceil (Math.random(selectedmonster.libido + selectedmonster.willpower - player.willpower - player.intelligence)*10);
      console.log("Player's Resitence is at " + player.lust);
playerturn = 1;
monsterturn = 0;
}

if (selectedmonster.health < 0){
   monsterdead = 1;
   battle = 0;
}

if (selectedmonster.lust > 99){
   monsterhorny = 1;
   battle = 0;

}

if (players.health < 0){
   playerdead = 1;
   battle = 0;

}

if (players.lust > 99){
   playerhorny = 1;
   battle = 0;

}

}
</SCRIPT>
</HEAD>
</HTML>
that man
 
Joined: Sat Jul 28, 2012 5:07 pm

Re: Soul Bound (Open world dungeon crawl)

Postby kvier » Wed May 28, 2014 2:24 am

You failed to add "new" in of "var player = Entity[...]" and failed to change all the "players" to "player".
kvier
 
Joined: Mon Apr 23, 2012 7:46 pm

Re: Soul Bound (Open world dungeon crawl)

Postby that man » Wed May 28, 2014 3:37 am

Thank you, the code works now... Sort of. At least, now all I have to do is get the code to do the right sort of math, print the data, make different dialogues for different enemies, have unique executables, and control the actual flow. The first spoiler is just combat data I'm trying to save (and to show some of the problems I'm having), while the second one is the edited code.
Spoiler (click to show/hide):

Code: Select All Code
"Lesser Witch's Health is now 242" test%20game%200.00:50
"Lesser Witch's Resitence is at 8" test%20game%200.00:52
"player's Health is now 494" test%20game%200.00:59
"Player's Resitence is at 2" test%20game%200.00:61
"Lesser Witch's Health is now 235" test%20game%200.00:50
"Lesser Witch's Resitence is at 15" test%20game%200.00:52
"player's Health is now 493" test%20game%200.00:59
"Player's Resitence is at 4" test%20game%200.00:61
"Lesser Witch's Health is now 229" test%20game%200.00:50
"Lesser Witch's Resitence is at 17" test%20game%200.00:52
"player's Health is now 489" test%20game%200.00:59
"Player's Resitence is at 7" test%20game%200.00:61
"Lesser Witch's Health is now 224" test%20game%200.00:50
"Lesser Witch's Resitence is at 22" test%20game%200.00:52
"player's Health is now 488" test%20game%200.00:59
"Player's Resitence is at 17" test%20game%200.00:61
"Lesser Witch's Health is now 215" test%20game%200.00:50
"Lesser Witch's Resitence is at 27" test%20game%200.00:52
"player's Health is now 483" test%20game%200.00:59
"Player's Resitence is at 21" test%20game%200.00:61
"Lesser Witch's Health is now 210" test%20game%200.00:50
"Lesser Witch's Resitence is at 35" test%20game%200.00:52
"player's Health is now 477" test%20game%200.00:59
"Player's Resitence is at 31" test%20game%200.00:61
"Lesser Witch's Health is now 202" test%20game%200.00:50
"Lesser Witch's Resitence is at 38" test%20game%200.00:52
"player's Health is now 474" test%20game%200.00:59
"Player's Resitence is at 41" test%20game%200.00:61
"Lesser Witch's Health is now 193" test%20game%200.00:50
"Lesser Witch's Resitence is at 45" test%20game%200.00:52
"player's Health is now 468" test%20game%200.00:59
"Player's Resitence is at 50" test%20game%200.00:61
"Lesser Witch's Health is now 184" test%20game%200.00:50
"Lesser Witch's Resitence is at 49" test%20game%200.00:52
"player's Health is now 467" test%20game%200.00:59
"Player's Resitence is at 53" test%20game%200.00:61
"Lesser Witch's Health is now 179" test%20game%200.00:50
"Lesser Witch's Resitence is at 53" test%20game%200.00:52
"player's Health is now 457" test%20game%200.00:59
"Player's Resitence is at 58" test%20game%200.00:61
"Lesser Witch's Health is now 177" test%20game%200.00:50
"Lesser Witch's Resitence is at 55" test%20game%200.00:52
"player's Health is now 454" test%20game%200.00:59
"Player's Resitence is at 62" test%20game%200.00:61
"Lesser Witch's Health is now 174" test%20game%200.00:50
"Lesser Witch's Resitence is at 60" test%20game%200.00:52
"player's Health is now 450" test%20game%200.00:59
"Player's Resitence is at 71" test%20game%200.00:61
"Lesser Witch's Health is now 167" test%20game%200.00:50
"Lesser Witch's Resitence is at 64" test%20game%200.00:52
"player's Health is now 443" test%20game%200.00:59
"Player's Resitence is at 79" test%20game%200.00:61
"Lesser Witch's Health is now 158" test%20game%200.00:50
"Lesser Witch's Resitence is at 72" test%20game%200.00:52
"player's Health is now 439" test%20game%200.00:59
"Player's Resitence is at 82" test%20game%200.00:61
"Lesser Witch's Health is now 155" test%20game%200.00:50
"Lesser Witch's Resitence is at 80" test%20game%200.00:52
"player's Health is now 434" test%20game%200.00:59
"Player's Resitence is at 87" test%20game%200.00:61
"Lesser Witch's Health is now 151" test%20game%200.00:50
"Lesser Witch's Resitence is at 83" test%20game%200.00:52
"player's Health is now 429" test%20game%200.00:59
"Player's Resitence is at 96" test%20game%200.00:61
"Lesser Witch's Health is now 141" test%20game%200.00:50
"Lesser Witch's Resitence is at 90" test%20game%200.00:52
"player's Health is now 426" test%20game%200.00:59
"Player's Resitence is at 102"

Code: Select All Code
"Goblin's Health is now 92" test%20game%200.00:50
"Goblin's Resitence is at 8" test%20game%200.00:52
"player's Health is now 492" test%20game%200.00:59
"Player's Resitence is at 1" test%20game%200.00:61
"Goblin's Health is now 89" test%20game%200.00:50
"Goblin's Resitence is at 10" test%20game%200.00:52
"player's Health is now 482" test%20game%200.00:59
"Player's Resitence is at 8" test%20game%200.00:61
"Goblin's Health is now 83" test%20game%200.00:50
"Goblin's Resitence is at 16" test%20game%200.00:52
"player's Health is now 480" test%20game%200.00:59
"Player's Resitence is at 9" test%20game%200.00:61
"Goblin's Health is now 80" test%20game%200.00:50
"Goblin's Resitence is at 23" test%20game%200.00:52
"player's Health is now 475" test%20game%200.00:59
"Player's Resitence is at 12" test%20game%200.00:61
"Goblin's Health is now 75" test%20game%200.00:50
"Goblin's Resitence is at 29" test%20game%200.00:52
"player's Health is now 469" test%20game%200.00:59
"Player's Resitence is at 22" test%20game%200.00:61
"Goblin's Health is now 69" test%20game%200.00:50
"Goblin's Resitence is at 36" test%20game%200.00:52
"player's Health is now 463" test%20game%200.00:59
"Player's Resitence is at 23" test%20game%200.00:61
"Goblin's Health is now 67" test%20game%200.00:50
"Goblin's Resitence is at 42" test%20game%200.00:52
"player's Health is now 453" test%20game%200.00:59
"Player's Resitence is at 28" test%20game%200.00:61
"Goblin's Health is now 61" test%20game%200.00:50
"Goblin's Resitence is at 52" test%20game%200.00:52
"player's Health is now 451" test%20game%200.00:59
"Player's Resitence is at 30" test%20game%200.00:61
"Goblin's Health is now 59" test%20game%200.00:50
"Goblin's Resitence is at 62" test%20game%200.00:52
"player's Health is now 449" test%20game%200.00:59
"Player's Resitence is at 35" test%20game%200.00:61
"Goblin's Health is now 50" test%20game%200.00:50
"Goblin's Resitence is at 66" test%20game%200.00:52
"player's Health is now 440" test%20game%200.00:59
"Player's Resitence is at 42" test%20game%200.00:61
"Goblin's Health is now 47" test%20game%200.00:50
"Goblin's Resitence is at 70" test%20game%200.00:52
"player's Health is now 436" test%20game%200.00:59
"Player's Resitence is at 45" test%20game%200.00:61
"Goblin's Health is now 39" test%20game%200.00:50
"Goblin's Resitence is at 73" test%20game%200.00:52
"player's Health is now 430" test%20game%200.00:59
"Player's Resitence is at 49" test%20game%200.00:61
"Goblin's Health is now 36" test%20game%200.00:50
"Goblin's Resitence is at 74" test%20game%200.00:52
"player's Health is now 428" test%20game%200.00:59
"Player's Resitence is at 58" test%20game%200.00:61
"Goblin's Health is now 27" test%20game%200.00:50
"Goblin's Resitence is at 79" test%20game%200.00:52
"player's Health is now 427" test%20game%200.00:59
"Player's Resitence is at 68" test%20game%200.00:61
"Goblin's Health is now 20" test%20game%200.00:50
"Goblin's Resitence is at 85" test%20game%200.00:52
"player's Health is now 426" test%20game%200.00:59
"Player's Resitence is at 75" test%20game%200.00:61
"Goblin's Health is now 18" test%20game%200.00:50
"Goblin's Resitence is at 94" test%20game%200.00:52
"player's Health is now 425" test%20game%200.00:59
"Player's Resitence is at 80" test%20game%200.00:61
"Goblin's Health is now 11" test%20game%200.00:50
"Goblin's Resitence is at 103" test%20game%200.00:52
"player's Health is now 424" test%20game%200.00:59
"Player's Resitence is at 82"

Spoiler (click to show/hide):

Code: Select All Code
<HTML>
<HEAD>
<SCRIPT>
var Entity = function (health, lust, strength, resilience, willpower, intelligence, libido, speed) {
    this.health = health;
    this.strength = strength;
    this.lust = lust;
   this.resilience = resilience;
   this.willpower = willpower;
   this.intelligence = intelligence;
   this.libido = libido;
   this.speed = speed;
};
var player = new Entity(500, 0, 10, 10, 10, 10, 10, 10);
var lesser_witch = new Entity(250, 0, 5, 5, 10, 15, 15, 10);
var goblin = new Entity(100, 0, 15, 15, 5, 5, 15, 5);
var lilith = new Entity(500, 0, 25, 25, 25, 25, 25, 25);

var names;

var randomnumber = Math.floor(Math.random(10)*10);

var selectedmonster;
if (randomnumber <= 3){
   selectedmonster = lesser_witch;
   names = "Lesser Witch";
}
else if (randomnumber <= 6){
   selectedmonster = goblin;
   names = "Goblin";
}
else if (randomnumber > 6){
   selectedmonster = lilith;
   names = "Lilith";
}

var battle = 1;
var monsterdead = 0;
var playerdead = 0;
var monsterhorny = 0;
var playerhorny = 0;

var playerturn = 1;
var monsterturn = 0;
   while (battle == 1){

while (playerturn == 1){

   selectedmonster.health = selectedmonster.health - Math.ceil(Math.random(player.power - selectedmonster.resilience)*10);
      console.log(names + "'s Health is now " + selectedmonster.health);
   selectedmonster.lust = selectedmonster.lust + Math.ceil (Math.random(player.libido + player.willpower - selectedmonster.willpower - selectedmonster.intelligence)*10);
      console.log(names + "'s Resitence is at " + selectedmonster.lust);
playerturn = 0;
monsterturn = 1;
}

while (monsterturn == 1){
   player.health = player.health - Math.ceil(Math.random(selectedmonster.power + selectedmonster.speed - player.resilience - player.speed)*10);
      console.log("player's Health is now " + player.health);
   player.lust = player.lust + Math.ceil (Math.random(selectedmonster.libido + selectedmonster.willpower - player.willpower - player.intelligence)*10);
      console.log("Player's Resitence is at " + player.lust);
playerturn = 1;
monsterturn = 0;
}

if (selectedmonster.health < 0){
   monsterdead = 1;
   battle = 0;
}

if (selectedmonster.lust > 99){
   monsterhorny = 1;
   battle = 0;

}

if (player.health < 0){
   playerdead = 1;
   battle = 0;

}

if (player.lust > 99){
   playerhorny = 1;
   battle = 0;

}

}
</SCRIPT>
</HEAD>
</HTML>

Now then: focus on coding, or story?
that man
 
Joined: Sat Jul 28, 2012 5:07 pm

Re: Soul Bound (Open world dungeon crawl)

Postby that man » Mon Jun 02, 2014 1:59 am

I decided to do some quick story things, and also drew up some new concept art:
The Story idea
Spoiler (click to show/hide):

Synn, the city of 15 million people, and 15 thousand souls. Rumor has it, that the first building was made by a man called "Richard Synn" almost 300 years ago, over the grave of the man who rightfully owned the land, and that he ran a tavern of ill-repute. Sure, in the light, the city is beautiful and polite, with not a single speck of dust out of place, but once the Shadows start to fall, and the calm veneer begins to fade, all Hell breaks loose: literally, to those who can see.

The concept art
Spoiler (click to show/hide):

Image
The left one is a...cultist...witch...I don't know? I really haven't decided yet.
The right one is either a Succubus or Siren...again, not decided yet.
that man
 
Joined: Sat Jul 28, 2012 5:07 pm

Re: Soul Bound (Open world dungeon crawl)

Postby BlueLight » Mon Jun 02, 2014 7:49 am

okay so just looking at the other post; you need better coding hygiene. For instants never use a plural version of a word for a variable,method, or class. I break this rule when dealing with arrays.
Variables tend to be nouns while methods(functions) are verbs. Classes are also nouns.

Ctrl+f is your friend. This will let you search for words or sets of characters. A program designed for programming can not only do that but also replace the words or sets of characters with another set. Notepad++ is one i suggest you pick up. This would allow you to find all instances of "Players" and turn it into "player".
User avatar
BlueLight
Gangs n' Whores Developer
 
Joined: Sat Jun 04, 2011 8:23 am

Re: Soul Bound (Open world dungeon crawl)

Postby that man » Mon Jun 02, 2014 2:21 pm

BlueLight Wrote:okay so just looking at the other post; you need better coding hygiene. For instants never use a plural version of a word for a variable,method, or class. I break this rule when dealing with arrays.
Variables tend to be nouns while methods(functions) are verbs. Classes are also nouns.

Ctrl+f is your friend. This will let you search for words or sets of characters. A program designed for programming can not only do that but also replace the words or sets of characters with another set. Notepad++ is one i suggest you pick up. This would allow you to find all instances of "Players" and turn it into "player".

I do use Notepad++...I just didn't know about that feature. The plural thing is just one of those errors that turn up when I code late at night, so, I'll just have to double check it more often. Thanks for the Ctrl+f thing.
that man
 
Joined: Sat Jul 28, 2012 5:07 pm

Re: Soul Bound (Open world dungeon crawl)

Postby gravifan89 » Tue Jun 24, 2014 5:01 am

I'm interested in this game, but can't find a download link.
User avatar
gravifan89
 
Joined: Wed Aug 22, 2012 9:37 pm
Location: North-East Ohio

Re: Soul Bound (Open world dungeon crawl)

Postby that man » Tue Jun 24, 2014 5:15 am

...there isn't a download link. Due to a lack of programming skills, I only have some rudimentary coding done for the battle engine, as well as some concept art for the characters. I also haven't been able to work on it for a while, so, the buggy code here is the only code there is.
that man
 
Joined: Sat Jul 28, 2012 5:07 pm

Re: Soul Bound (Open world dungeon crawl)

Postby gravifan89 » Tue Jun 24, 2014 7:22 am

Well, seeing the pretty-obvious lack of interest also helps explain it. Not sure why, though, because the basic idea is astoundingly interesting. Eh, oh well, I'm a patient man.
User avatar
gravifan89
 
Joined: Wed Aug 22, 2012 9:37 pm
Location: North-East Ohio

Re: Soul Bound (Open world dungeon crawl)

Postby that man » Tue Jun 24, 2014 4:34 pm

I think the lack of interest comes from a lack of content. I have gotten the code to work (sort of), but there's still more to do.
that man
 
Joined: Sat Jul 28, 2012 5:07 pm

Re: Soul Bound (Open world dungeon crawl)

Postby gravifan89 » Tue Jun 24, 2014 5:56 pm

As I said, I'm a patient man, and I can wait as long as needed.
User avatar
gravifan89
 
Joined: Wed Aug 22, 2012 9:37 pm
Location: North-East Ohio

Previous

Return to Creative Corner



Who is online

Users browsing this forum: No registered users