scars and tattoos

J_J

I realize this should be pretty straight forward, but I think I need it explained to me in really simple instructions.
I have wearable scar or tattoo objects. I can move them into the inventory, but how do I move them on to the player so that they are wearing them?
They need to be non removable. I understand that I have to change the attribute... but I don't understand how I do this. I maybe don't actually understand how attributes work.

@[email protected]' thanks


Io

So click on the object in your editor. You should see a screen with several tabs at the top. Setup, Object, Inventory, Verbs, Features, Attributes, Objects.

Go to Attributes. You'll see two windows; Inherited Types and Attributes. Go to Attributes, and click the 'Add' button. This will give you a new Attribute.

Attributes are just that. Something about the object in question. They can be simple presets like 'do we call this thing he, she, or it?' or they can be something wacky like 'HasBeenCrushed'.

The way I would do what you do is this: Add. Call the attribute TattooLocation. Then I'd go to the new Attribute - it's in the little box you're looking at - and keep its type as String.

I don't know how you want to move it around, but lets create a new object and call it TattooMoveCheater. For it, I create the verb 'Move Tattoo'.

From here you can get fancy, but I'll do the simple version. Move Tattoo runs a script. The script is simple: "Set an Object's Attribute (named by an expression)". I'd tell it to set the object Tattoo's TattooLocation to... I don't know. "Head". Head in quotation marks, since it's a string.

So now the Tattoo's attribute says it's on your head. But how do you tell that? Well let's have another Set Object Attribute in the script. But this one set's Tattoo's alias. We can rename what we see it as. Let's have this button rename it "Head Tattoo".

But what if we want to Look At the tattoo? {if Tattoo.TattooLocation=Head:This tattoo is on your head.} (Note, no quotations around the String here. I know, weird, right?)

{if Tattoo.TattooLocation=Chest:This tattoo is on your chest.}

And etc. etc. Hope that clears it up? I feel I was pretty wordy.


J_J

Thank you! I think I understand, I will try it out : )


A better way to do tattoos instead of them being wearable things is to make them booleans. If you do that...you can have something like...

Player Object: Attributes
scarnamehere = False

Then when something in-game happens...
player.scarnamehere = True

{if player.scarnamehere=True:You have a scar across your cheek.}

Make sense?

Anonynn.


J_J

...I feel like I should be able to get this, so I apologize for this being a ridiculous question:
Do I need to have made a player object? A player exists when I play through the game, but I can't find it where it lives in the editor. And where do I put the if script? I don't understand how to have both a Boolean and an if script in the attribute.
Thanks in advance.


(filler for getting my edited post, updated/posted)


@ JJ:


http://textadventures.co.uk/forum/quest/topic/mu7itzjqv0yxrkdwgsbmzg/how-to-make-npc-confront-you-with-chioces#46cdb25b-4767-40a6-8bf4-3cd84e805781 (help with quest coding and its code structure)


if you removed the built-in default 'player' Player Object, I think quest will create one (as quest engine does require a designated Player Object) for you // Objects are referenced (ID'ed) via their 'name' (which acts as the ID for quest) String Attribute, for quick direct code scripting example: player.strength = 100

if you re-named it (or have multiple Player Objects), you'd either (1) use that new name for it (or them), or (2) use 'game.pov' for it // (the 'game.pov' built-in Object Attribute stores the currently controlled Player Object, as you can have multiple Player Objects, switching between them)


Anonynn is talking about the easiest/quickest way of doing display/output/msg scripting, which uses the 'text process commands' ( http://docs.textadventures.co.uk/quest/text_processor.html ), so for example (using a String Attribute instead of a Boolean Attribute):

direct code scripting example:

player.scar_description_string_attribute = "deep scar diagonally from the bottom of your left ear to the left corner of your mouth"

msg ("You have a {player.scar_description_string_attribute}, making you less approachable.")
// output: You have a deep scar diagonally from the bottom of your left ear to the left corner of your mouth, making you less approachable.


<asl version="550">

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

  <game name="example_game">

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

      player.scar_description_string_attribute = "deep scar diagonally from the bottom of your left ear  to the left corner of your mouth"

      msg ("You have a {player.scar_description_string_attribute}, making you less approachable.")

    </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>

</asl>

<asl version="550">

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

  <game name="example_game">

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

      msg ("You have a {player.scar_description_string_attribute}, making you less approachable.")

    </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>

    <attr name="scar_description_string_attribute" type="string">deep scar diagonally from the bottom of your left ear  to the left corner of your mouth</attr>

  </object>

</asl>

I don't know if you're using a gamebook or not, but if you're using a text adventure, you should have a starting object called "player" in your tree of stuff (the list on the left that has all your objects in it). If you click on the "player" object, you'll see a variety of tabs (on the right of the editor screen), among them Attributes. Click on the Attributes. Find the bottom section called "Attributes". Click the ADD button. Type scaroncheek or whatever scar or tattoo you want, then make it a boolean.

During the game, if you create a msg (message) script. You can have a message like...

msg ("You're walking along....suddenly WHAM! You get hit in the cheek with a sharp branch")
if (player.scaroncheek=False) {
msg ("And now you have a deep scar on your cheek! Oh crap!")
player.scaroncheek=True
}
else {
msg ("Luckily, you already have a scar on your cheek so it's no big deal.")
}

If you were going that simple route that I suggested, you just do...

if (player.scaroncheek=True) {
msg ("You now have a scar on your cheek!")
}

or via the text processor in MSG descriptions...

BLAH BLAH BLAH, you also have a{if player.scaroncheek=True: scar on your cheek} which people find a little intimidating! 

Make sense :D?

Anonynn.


J_J

This looks really straight forward! Thank you...

But, when I go to the object list there is nothing called player. When I search player in the search tab nothing comes up. When I look through the entire tree there are only objects I have created for the game. Do you have any idea where the player character might be in the game? I'm a little concerned : / I know it must be somewhere in the game, because I've been using player as an expression.


On the "player" tab of the game object, there's an option to choose which object will be controlled by the player.

If one isn't selected, it chooses an object named "player".

If there isn't one, it creates an object named "player" in the first room in the game.

So… try looking in the room you start the game in. If there isn't a player object there, then you must have deleted it, so the game creates a new one whenever you start playing.


J_J

If I somehow must have deleted it @[email protected]' if I make a new player object, will it make me go through and change everything in the code up to this point?
Like, when I renamed an object once, everything stopped working and I had to go through and find everywhere in the code that had the old object name and change it manually. Would I have to do that if I made a new player object? Because I don't want to accidentally make my game unplayable :/


The default player object that gets created is called "player". When you type player in your code, it means whatever object has that name, so it will keep on referring to the new player. If you created a player object with a different name, you'd probably have to change it.

In most cases, it's better to refer to the player object as game.pov, which is a magic attribute referring to the object that the player is currently giving commands to; using that guarantees that you won't have to change everything if you change the name of the player object later.


J_J

Thanks! I was so lost, and everyone's help has been amazing. I have now edited this post three times because I keep thinking I'm failing, but its all fixed. I now have a player character, and they can have a tattoo and it totally works. I'm giving everyone internet hugs, I don't know what I would do with out you guys :)


Glad to hear it! :D If you have other questions let us know! Also, thanks for the assist Mr.Angel and HK!

Anonynn.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums