[Adult Game] RPG status help...

I had an idea for an adult game but I really need help creating the statuses I made three so far, Pain, Arousal, and Fatigue, but I have no clue how to implement them inside the system. I'm extremely new to coding so please bear with me when it comes to this stuff.


What do you want them to do?

The hardest part of coding any system is deciding how you actually want it to behave. If you can describe what you want, you're close to having the code already.


I want "Pain" to act as health how much pain you can take before you faint. I want "Arousal" to work like sexual stamina how much stimulation you can take before you orgasm. I want "Fatigue" to work like stamina how much activities you can do before you need sleep. So I know what I want them to do, I just don't know how do it.


Data Types:


Amount (able to do arithmetic operations) Data Types:

  1. Integers: any non-decimal/non-fractional amount, examples: -999, 0, 999

player.strength = 100

  1. Doubles: any decimal/fractional/float/floating-point amount, examples: -999.123, 0.0, 999.123456789

player.damage = 48.3


Non-amount Data Types:

  1. Booleans: the special/reserved values of: 'true' and 'false'

game.paused = false
game.paused = true

player.poisoned = true
player.poisoned = false

tv.switchedon = true
tv.switchedon = false

orc.dead = false // conceptually the orc is alive
orc.dead = true // conceptually the orc is dead

orc.alive = true // conceptually the orc is alive
orc.alive = false // conceptually the orc is dead

  1. Strings: a collection of 1 or more characters (alphabet and/or numeric) and/or (some) symbols

Anything in double quotes, is a String

Able to do concatenation operations

player.alias = "HK"

player.condition = "normal"

game.introduction = "Welcome to my game, I hope you enjoy it! Muwahahaha"

room.description = "The dark forest is a dangerous place ... blah blah blah"

player.strength_as_a_string_attribute = "100" // the '100' Value is a String Value, it's NOT an amount (integer:int) value, due to having the double quotes, you can NOT do arithmetic operations with String Values

  1. Object Reference/Pointer

anything NOT in double quotes and NOT a special/reserved word, is an Object Reference/Pointer

player.parent = room

// create ("katana")
player.weapon = katana

  1. Lists

  2. Dictionaries

  3. Scripts


Arithmetic (Math) vs Concatenation

Addition (Arithmetic/Math):

5 + 5 = 10
55 + 55 = 110

Concatenation (definition: literally putting things together/next-to-each-other):

"5" + "5" = "55"
"55" + "55" = "5555"

"mama" + "mia" = "mamamia"

"mama" + " " + "mia" = "mama mia" // "mama" + "[SPACE]" + "mia" = "mama[SPACE]mia"

"mama " + "mia" = "mama mia" // "mama[SPACE]" + "mia" = "mama[SPACE]mia"

"mama" + " mia" = "mama mia" // "mama" + "[SPACE]mia" = "mama[SPACE]mia"

the '[SPACE]' is in fact a character/symbol, just like any other character/symbol

"mama" + "5" = "mama5"

"mama" + 5 = ERROR!

"5" + 5 = ERROR!


a quick brief simple example:

<object name="room">

  <inherit name="editor_room" />

</object>

<object name="player">

  <inherit name="editor_object" />
  <inherit name="editor_player" />

  <attr name="parent" type="object">room</attr>

  <attr name="pain" type="int">0</attr>
  <attr name="arousal" type="int">0</attr>
  <attr name="fatigue" type="int">0</attr>

  <attr name="condition" type="string">normal</attr>

  <attr name="changedpain" type="script">

    if (player.pain > 100) {
      player.pain = 100
    } else if (player.pain < 0) {
      player.pain = 0
    }

    if (player.pain = 100) {
      player.condition = "fainted"
      player.pain = 0 // if you want to reset 'pain' after 'fainting'
    }

  </attr>

  <attr name="changedarousal" type="script">

    if (player.arousal > 100) {
      player.arousal = 100
    } else if (player.arousal < 0) {
      player.arousal = 0
    }

    if (player.arousal = 100) {
      player.condition = "orgasming"
      player.arousal = 0 // if you want to reset 'arousal' after 'orgasming'
    }

  </attr>

<attr name="changedfatigue" type="script">

    if (player.fatigue > 100) {
      player.fatigue = 100
    } else if (player.fatigue < 0) {
      player.fatigue = 0
    }

    if (player.fatigue = 100) {
      player.condition = "exhausted"
      player.fatigue = 0 // if you want to reset 'fatigue' after becoming 'exhausted'
    }

  </attr>

</object>

<object name="npc">

  <inherit name="editor_object" />

  <attr name="parent" type="object">room</attr>

  <attr name="condition" type="string">normal</attr>

  <displayverbs type="stringlist">

    <value>sex</value>

  </displayverbs>

  <attr name="sex" type="script">

    if (player.condition = "fainted" or player.condition = "exhausted") {
      msg ("You can't have sex when you're unconscious from fainting or nor if you're exhausted")
    } else if (player.condition = "orgasming") {
      npc.condition = "impregnated"
      msg ("You orgasm while having sex, impregnating her")
    } else {
      player.pain = player.pain + 10
      player.fatigue = player.fatigue + 25
      player.arousal = player.arousal + 50
      msg ("You have sex with her")
    }

  </attr>

</object>

<verb>

  <property>sex</property>
  <pattern>sex</pattern>

  <defaultexpression>You can't have sex with that!</defaultexpression>

</verb>

sex Test NPC
Error running script: Error compiling expression 'player.condition = "fainted" or player.condition = "exhausted"': Unknown object or variable 'player'

I get this error trying to have sex with the npc... Maybe I just need to pick something a little easier or learn how to code better?


that error message is likely due to that you've changed the name of your Player Object, and hence it can't find a 'player' Player Object, which my code uses/is-looking-for (for example: player.condition ---> ERROR: no 'player' Player Object is found, as it doesn't exist, due to you changing its name, and thus its 'WHATEVER_YOU_NAMED_IT_AS' Player Object, and not 'player' Player Object, so change the code to match up, example: WHATEVER_YOU_NAMED_IT_AS.condition)

'player' is the default name of the Player Object, so if you changed the name of your Player Object, then simply put in the name of your Player Object where-ever you see 'player' in the code (replace any/all instances of 'player' with your name of the Player Object within your code), or you can use 'game.pov' instead of 'player' within your code, as well. The built-in 'pov' Object reference/pointer Attribute on your special 'game' Game-Settings-and-Publishing-Info, determines what Player Object (if you got more than one of them) you're currently controlling, and also it will refer to who-ever is your currently controlled Player Object (whatever you got them named as)

example:

using 'game.pov', as this will work regardless of whatever you got your Player Object named as

using 'this' too, which refers to the parent Object of the scripting that you use 'this' within, as again, it'll work regardless of whatever you named your Player Object as

<asl version="550">

  <include ref="English.aslx" />
  <include ref="Core.aslx" />

  <game name="NAME_OF_GAME">

    <!--
    blah Attributes (gameid, author, version, firstpublished, category, cruelty, difficulty, description, subtitle, etc)
    -->

    <attr name="pov" type="object">player</attr>

    <attr name="start" type="script">

      show menu ("Choose your starting Player Object", split ("player;DRICYSTEIN", ";"), false) {
        game.pov = GetObject (result)
      }

    </attr>

  </game>

  <object name="room">

    <inherit name="editor_room" />

  </object>

  <object name="player">

    <inherit name="editor_object" />
    <inherit name="editor_player" />

    <attr name="parent" type="object">room</attr>

  </object>

  <object name="DRICYSTEIN">

    <inherit name="editor_object" />
    <inherit name="editor_player" />

    <attr name="parent" type="object">room</attr>

    <attr name="pain" type="int">0</attr>
    <attr name="arousal" type="int">0</attr>
    <attr name="fatigue" type="int">0</attr>

    <attr name="condition" type="string">normal</attr>

    <attr name="changedpain" type="script">

      <![CDATA[

        if (this.pain > 100) {
          this.pain = 100
        } else if (this.pain < 0) {
          this.pain = 0
        }

        if (this.pain = 100) {
          this.condition = "fainted"
          this.pain = 0 // if you want to reset 'pain' after 'fainting'
        }

      ]]>

    </attr>

    <attr name="changedarousal" type="script">

      <![CDATA[

        if (this.arousal > 100) {
          this.arousal = 100
        } else if (this.arousal < 0) {
          this.arousal = 0
        }

        if (this.arousal = 100) {
          this.condition = "orgasming"
          this.arousal = 0 // if you want to reset 'arousal' after 'orgasming'
        }

      ]]>

    </attr>

    <attr name="changedfatigue" type="script">

      <![CDATA[

        if (this.fatigue > 100) {
          this.fatigue = 100
        } else if (this.fatigue < 0) {
          this.fatigue = 0
        }

        if (this.fatigue = 100) {
          this.condition = "exhausted"
          this.fatigue = 0 // if you want to reset 'fatigue' after becoming 'exhausted'
        }

      ]]>

    </attr>

  </object>

  <object name="npc">

    <inherit name="editor_object" />

    <attr name="parent" type="object">room</attr>

    <attr name="condition" type="string">normal</attr>

    <displayverbs type="stringlist">

      <value>sex</value>

    </displayverbs>

    <attr name="sex" type="script">

      if (game.pov.condition = "fainted" or game.pov.condition = "exhausted") {
        msg ("You can't have sex when you're unconscious from fainting or nor if you're exhausted")
      } else if (game.pov.condition = "orgasming") {
        this.condition = "impregnated"
        msg ("You orgasm while having sex, impregnating her")
      } else {
        game.pov.pain = game.pov.pain + 10
        game.pov.fatigue = game.pov.fatigue + 25
        game.pov.arousal = game.pov.arousal + 50
        msg ("You have sex with her")
      }

    </attr>

  </object>

  <verb>

    <property>sex</property>
    <pattern>sex</pattern>

    <defaultexpression>You can't have sex with that!</defaultexpression>

  </verb>

</asl>

if you want to learn more of using quest and its coding:

http://textadventures.co.uk/forum/general/topic/ljjm32av4e2t9ot49k478g/help#710be61e-eae1-4af1-8363-520cc718ba1c

specifically check out this link on Attributes and the 'if' Script (scroll down a bit past the basic quest coding stuff at the top, to my bolded "The two super scripts...blah"): http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk

you also might want to check this out too, as working directly in-code is so much faster/better/easier than using the GUI/Editor: http://textadventures.co.uk/forum/quest/topic/mu7itzjqv0yxrkdwgsbmzg/how-to-make-npc-confront-you-with-chioces#46cdb25b-4767-40a6-8bf4-3cd84e805781


if you need help with anything or need anything explained, let me know!

also, if you want, I can walk you through, teaching you with, using Attributes and the 'if' script, via creating some sample games, helping you step by step, and explaining it for you, let me know if you'd like this type of help!


I would love this type of help actually. If there is some way you can help me or teach me Im on board!


Way back in PC pre-history... In the time of DOS, Basic was built-in to many computers. So, as a result, everyone learned Basic by buying books with Basic listings that they could type, and mistype, into the computer. Through trial and error, and lots of errors!, people learned Basic. And learned all sorts of tricks to do with it, some to work, and some to play...
Long story short... Follow the tutorial, change it, modify it, screw it up and start over... Check what other people have done, modify their code, learn it, break it, fix it, and make it better...

Which reminds me, I think there needs to be a forum for raw source code that "better" programmers could post to (without the Quest added code that prevents UI viewing), so that people trying to learn this can read and hopefully understand to expand their coding abilities... I think that would be the most helpful to anyone trying to learn Quest.
After all, someone bringing coding background from other languages could teach a few "old dogs" a few new tricks...


@ DRIcyStein:

what do you need help with? everything/all-of-it? or, just some parts of it?

I can walk you through either or both of these:

http://textadventures.co.uk/forum/quest/topic/mu7itzjqv0yxrkdwgsbmzg/how-to-make-npc-confront-you-with-chioces#46cdb25b-4767-40a6-8bf4-3cd84e805781

http://textadventures.co.uk/forum/quest/topic/5387/i-really-need-help#37375

or, we can do one type of Data Type (VARIABLES:Attributes/Variables, and their VALUES) at a time, walking through all of the different Data Types:

http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk


let me know what you need help with, so we got a starting point, let's keep it simple, learning the basics first, one step at a time, just let me know where or what you want to get started on learning


I pretty much need help with everything xD But the basics are always the best place to start. So when ever you have time to coach me I'd love it (If that's what you meant I can read articles and stuff too but I learn better when someone is there to point things out to me. But I don't know your comfort level when it comes to chatting to strangers xD)


first and foremost, if you're using a windows PC:

download this very advanced and totally free text editor software: https://notepad-plus-plus.org

(I don't know if it would work with Apple computers or not)

(I'll help you with how to get it set-up/used with quest's coding language, just let me know when you got it downloaded and installed on your computer, or if you're not able to: such as if using a Apple computer and it doesn't work with it)


if you want to learn to code directly (highly recommended):

(it makes coding/game-making so much faster, better, and easier than in using the GUI's/Editor's options, tabs, and etc)

(and, it makes it easier for me to be able to help you, and for you to be able to understand the help, as well)

then let's start with learning the basics of quest and its code structure (I'll help you through this if/as you need any help):

http://textadventures.co.uk/forum/quest/topic/mu7itzjqv0yxrkdwgsbmzg/how-to-make-npc-confront-you-with-chioces#46cdb25b-4767-40a6-8bf4-3cd84e805781


if you just want to learn about using Attributes and the 'if' Script (which, especially when used together, will enable you to do 90% of everything that you want to do within your game), then we can start with either of these:

http://textadventures.co.uk/forum/quest/topic/5387/i-really-need-help#37375
or
http://textadventures.co.uk/forum/samples/topic/5559/attributes-and-if-script-guide-by-hk


then, we can learn more advanced stuff (first the list/dictionary attributes, and then beyond/even-more-advanced-stuff)


Thank you very much Hegemonkhan! (sorry for late reply been a little busy with irl things xD)


Log in to post a reply.

Support

Forums