Attribute pane and Strife Specibus

sillyEnthusiast
I am completely lost. I was able to play in the HTML enough to change the name of my Status pane to "Player", but now I need to figure out how to make certain character traits add to it as the traits are added/discovered. For example, I would like it to list my character's name, caste, and god tier when I get that far. I'd also like my strife specibus in that list. For those not familiar with homestuck, what I am trying to do, and have seen done in a different sburb-based game, is to use a weapon object (say, a whip) with my strife specibus object, to add the attribute of "strife specibus: whipkind" (or whatever weapon+kind) to my player pane.

I've seen it done before in another Sburb-based game, so I know it's at least doable.

Here's hoping I won't have to be a bother with too many more questions through the course of making this game, and thanks in advance for any help or advice anyone can give me on this.

The Pixie
It is doable. Status attributes are held is a string dictionary called player.statusattributes, so you need to add a new entry to that. I am going to assume you already have at least one status attribute set up for the player (see the Attributes tab).

player.weaponkind = "whipkind"
dictionary add (player.statusattributes, "weaponkind", "strife specibus: !")

So weaponkind is a string attribute of player, and you can update that as the player changes weapons. The "strife specibus: !" bit determines what is shown; the exclamation mark will become the value of, in this case, player.weaponkind.

If you do not have any status attributes on the player from the start, add this line:

player.statusattributes = NewStringDictionary()

This would go before the dictionary add line. You need to make sure it only ever gets called once, so may be better put it in the start script (game object, Script tab).

sillyEnthusiast
Okay. Well the code I messed with was the HTML for the panes. I'm having a bit of a problem with the coding because if I do anything in code view, even if I know it's correct, my entire script is destroyed. It shows a box of red text and tells me that it can't read the script or something to that effect. I also can't figure out how to make the weaponkind by using the weapon object with the strife specibus object.

Edit: I got the weaponkind thing to work, my last problem is making my player attributes appear in the status pane next to the texty bits where player health is displayed.

sillyEnthusiast
This is what I have done so far if that helps.

The Pixie
I added the two lines to this code on the Hall of the Priest Kings and it worked okay:

msg ("\"I hope the teleport didn't startle you too badly.\" ")
msg ("You turn to see that you are not alone in the room. As well as five other people, three men and two women, there is also-")
msg ("What in the name of the Priest Kings is that?! A large, insectoid creature enters the room, a translator hanging about its neck as it appears to wait for you and the others to process what you are seeing.")
msg ("\"What is that?\" you hear one of the women whisper to a large man clad in red, obviously a warrior.")
msg ("Before the man can speak, the creature cuts him off. ")
msg ("\"This,\" he says, gesturing to himself with one hairy appendage, \"is a Priest King, as your people call us.\"")
SetTimeout (4) {
msg ("Soft murmurs of disbelief echo through the spacious hall until the sharp sound of the Priest King's foreleg striking the stone floor restores the silence.")
SetTimeout (3) {
msg ("\"Now,\" the creature says, \"I have brought you all here on a matter of great importance. I'm not entirely sure you're the people I would choose for the task, but it appears you six are the only Prospit and Derse dreamers on this planet.\"")
SetTimeout (3) {
ShowMenu ("On what planet do you dream?", Split ("Prospit;Derse",";"), false) {
player.dreamer = result
msg ("\"In two days,\" it continues, \"you will be summoned here again to take on your task. Go home and gather what you need. Take these as well. This technology will help you carry the things you will need for this.\"")
AddToInventory (Fetch Modus)
AddToInventory (Captchalogue Cards)
msg ("\"Now, go.\"")
wait {
AddToInventory (Strife Specibus)
MoveObject (player, sleeping quarters)
player.weaponkind = "whipkind"
dictionary add (player.statusattributes, "weaponkind", "strife specibus: !")
}
}
}
}
}


Quest will try to correct your code if you get brackets or quotes wrong, and that will occasionally results in in losing part of your code. If you are writing long chunks of code, it might be a good idea to copy-and-paste to a text editor like Notepad so you have the original.

sillyEnthusiast
Well when you set player.whatever that sets a status attribute, yes? If so I was able to get that part done with each of my weapon options throughout the house in normal view in the "use object with" settings on the Strife Specibus object. I couldn't figure it out because I was thinking about it wrong, if that makes sense. Now it's just the pesky side pane I have to figure out.

HegemonKhan
conception of general coding terminology vs quest terminology:

VARIABLES:
-> Variables (local~temporary: usable only within its own script block)
-> Attributes (global~permanent: save'able and thus load'able, can be used in any scripting anyhwere in your game, so long as the Object that it is 'attached' to, exists)

------------------------

in-code, here's the general syntax:

Atttributes:

Object_name.Attribute_name = Value_or_Expression

examples:

String Attribute:

(=Value)

(the value must be within the quotes,as this tells the quest engine that it is a String Attribute, as the value is a String via being within the quotes)
player.condition = "poisoned"
game.event_flag = "0"
HK.gender_string = "male"
HK.race = "human"
HK.class = "warrior"

(=Expression)

player.greeting = "Hi, my name is HK."
player.greeting = "Hi, my name is " + player.alias + "."
player.hit_points = player.current_hit_points + "/" + player.maximum_hit_points + " HP"
player.mana_points = player.current_mana_points + "/" + player.maximum_mana_points + " MP"

Boolean (or quest's specific term usage of: flag) Attribute:

orc.dead = false
orc.dead = true
player.poisoned = false
player.poisoned = true
player.flying = false
player.flying = true

Integer Attribute:

(=Value)

player.strength = 100
orc.strength = 25
game.event_flag = 0

(=Expression)

game.y = x + 5

player.physical_damage = player.weapon.physical_damage + player.weapon.physical_damage * player.strength / 100 - orc.armor.physical_defense - orc.armor.physical_defense * orc.endurance / 100

Double (Float; Floating Points) Attribute:

(they're just using decimal numbers instead of integers: 38.142)

Object Attribute:

(no quotes on the value, as remember the quotes turn it into a String, instead of it being an Object; an Object's name: an Object's ID)

(the below examples of the Values: 'helmet', 'arrow', 'dragon_mail', 'sword', and 'shield', have to be actual created~added Objects within the game, obviously)

player.head = helmet
player.quiver = arrow
player.chest = dragon_mail
player.left_hand = sword
player.right_hand = shield

Lists (Stringlists and Objectlists):

HK.favorite_colors = split ("black;red", ";")
player.equipment = split ("helmet;dragon_mail;arrow;sword;shield", ";")
player.condition = split ("poisoned;confused", ";")

Dictionaries (Stringdictionaries, Objectdictionaries, Scriptdictionaries):

(too tired, and am not sure on the syntax; too lazy to look how Pixie did it, lol)

----------------------------

Variables:

(notice how there's no 'attachment' to an Object)

variable_name_string = Value_or_Expression

(built-in Variables)
result = Value_or_Expression
value = Value_or_Expression

(custom: self created~added~used Variables)
handled = (true or false)
you_go_first = (true or false)
y = x + 5
weapon = sword
enemy = orc
self = player
etc etc etc

-------------------------

In the GUI~Editor:

for creation only:

'whatever' (Object) -> Attributes (Tab) -> Attributes -> Add -> (see below)

(Object Name: 'whatever' )
Attribute Name: (whatever)
Attribute Type: (String, Boolean~Flag, Integer, Double, Object, Lists, Dictionaries, etc)
Attribute Value: ( 'whatever', but it depends upon the Attribute Type, of course)

for scripting in the GUI~Editor:

(this includes Boolean Attributes too)

run as script -> add a~new script -> variables -> 'set a variable or attribute' Script -> [EXPRESSION]:write in its code syntax, or choose [whatever] choice

or, just specifically for Boolean Attributes only:

run as script -> add a~new script -> objects -> 'SetObjectFlagOn' or 'SetObjectFlagOff' Scripts

------------

Basic Math Computational '=Expressions' :

using for examples:

player.strength = 0
player.endurance = 4

Addition:

(simple '=expressions' )
player.strength = player.strength + 5
(result: player.strength = 0+5 = 5)

or

(complex '=expressions' )
player.strength = player.strength + player.endurance / 2
(result: player.strength = 0 + 4/2 = 0+2 = 2)

conceptually:

original~initial~old setting: player.strength = 0

player.strength (new) = player.strength (old) + 5
player.strength (new) = (0) + 5

new: player.strength = 5

old: player.strength = 5

player.strength (new) = player.strength (old) + 5
player.strength (new) = (5) + 5

new: player.strength = 10

old: player.strength = 10

player.strength (new) = player.strength (old) + 5
player.strength (new) = (10) + 5

new: player.strength = 15

Subtraction:

player.strength = player.strength - 8

Multiplication:

player.strength = player.strength * 3

Division:

player.strength = player.strength / 2

------------

Buying:

player.cash = player.cash - item.cash
store_owner.cash = store_owner.cash + item.cash
item.parent = player

Selling:

player.cash = player.cash + item.cash
store_owner.cash = store_owner - item.cash
item.parent = store_owner

-----------

ask if you got any questions, or need any help

HegemonKhan
SillyEnthuist wrote:Well when you set player.whatever that sets a status attribute, yes?


no,

player.(whatever), sets an Attribute (the Attribute itself)

-------

unless the 'whatever' (and the Object too) is specifically:

game.statusattributes = (I don't know its syntax, I'd have to look at Pixie's usage, or look it up, lol)
or
player.statusattributes = (I don't know its syntax, I'd have to look at Pixie's usage, or look it up, lol)
or
HK.statusattributes = (I don't know its syntax, I'd have to look at Pixie's usage, or look it up, lol)
or
SillyEnthuist.statusattributes = (I don't know its syntax, I'd have to look at Pixie's usage, or look it up, lol)
or
player2.statusattributes = (I don't know its syntax, I'd have to look at Pixie's usage, or look it up, lol)

sets your StatusAttributes

-----

Attribute: your actual Attributes (your states~data within the game)

StatusAttributes (a special built-in StringDictionary Attribute): is merely to~for display~ing *ONLY* your Game Object's or your Player Object's (default: 'player', or custom ones, such as 'HK' or 'SillyEnthuist' or 'player2' ) Attributes (which must be created~exists aready) on the right pane during game play.

The Pixie
sillyEnthusiast wrote:Well when you set player.whatever that sets a status attribute, yes? If so I was able to get that part done with each of my weapon options throughout the house in normal view in the "use object with" settings on the Strife Specibus object. I couldn't figure it out because I was thinking about it wrong, if that makes sense. Now it's just the pesky side pane I have to figure out.

No, setting player.whatever just sets up an attribute. You also have to tell Quest that it is also a status attribute.

To do that you also have to set it up in player.statusattributes:

dictionary add (player.statusattributes, "whatever", "Whatever is: !")

sillyEnthusiast
Awesome :D I got it working! I was having more trouble than I should have because I kept using quotations :oops:

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

Support

Forums