in the GUI~Editor:
run as script -> add a script -> output (or whatever it's category name) -> print a message -> [EXPRESSION] -> (see below)
or, in code:
the 'trick~rule' is to break it down in chunks:
text
" + Object.Attribute + "
and~or
"text"
+ Object.Attribute +
also, there must be an equal number of total quotes too.
so, for an example:
(in playing a game, after I finish a character creation function at the start of the game)
player.alias = "HK"
player.age_integer = 18 // (I wish, lol)
player.age_string = "adult"
player.gender_string = "male"
player.race_string = "european"
player.species_string = "human"
player.class_string = "warrrior"
output of the 'msg' Script below: HK is a 18 year old adult male european human warrior.
('game.pov' references whoever is your currently controlled Player Object, be it the default "player" Player Object or a custom:self-made Player Object)
msg (game.pov.alias + " is a " + game.pov.age_integer + " year old " + game.pov.age_string + " " + game.pov.gender_string + " " + game.pov.race_string + " " + game.pov.species_string + " " + game.pov.class_string + ".")
the 'chunks' :
game.pov.alias +
" is a "
+ game.pov.age_integer +
" year old "
+ game.pov.age_string +
" (space) "
+ game.pov.gender_string +
" (space) "
+ game.pov.race_string +
" (space) "
+ game.pov.species_string +
" (space) "
+ game.pov.class_string +
"."
-------
make sure that your Attributes (Object.Attribute) in your 'msg' Script exist (were created~added to your Object), as you can't act (which is what a Script does) upon something, if that something (your Attributes) doesn't exist, obviously.
to create (add) Attributes to an Object (in the GUI~Editor):
(whatever) Object -> Attributes (tab) -> Attributes -> Add ->
Attribute Name: _______
Attribute Type: ________ (String, Int:Integer, Double:Float:Floating Point:Decimal Number, Script, Boolean:Flag, List, Dictionary, etc)
Attribute Value: ________ (depends upon your Attribute Type)
-------------
another example (in code, as it's quicker, and I'm lazy, lol):
('this' refers ONLY to the Object that it's scripting is attached to, aka is within. So for the "orc_1" Object's Scripting's, the "this" within that scripting, refers to the Object, in this case below, to the "orc_1" Object)
<object name="orc_1">
<inherit name="editor_object" />
<alias>orc</alias>
<attr name="dead" type="boolean">false</attr>
<attr name="changeddead" type="script">
if (this.dead = false) {
this.status_effect = "alive"
} else if (this.dead = true) {
this.status_effect = "dead"
}
on ready {
msg ("The " + this.alias + " is " + this.status_effect + ".")
}
</attr>
<attr name="status_effect" type="string">alive</attr>
<attr name="fight" type="script">
if (this.dead = false) {
this.dead = true
} else if (this.dead = true) {
this.dead = false
}
</attr>