No longer running out of ideas: Now I don't know how to impliment them

Lighnagain
21 May 2016, 20:18
OK -- first game, and it's getting out of hand. Is there a way to do this...

I would like to have three different sets of statistics, and each decision you make is categorized into one of these three statistics, and it keeps a "score" of which decision you make the most. (Evil/Good/Neutral, lets say.) So that at the end, it displays what you are--good, evil, or somewhere in between? Is this even possible?

Marzipan
23 May 2016, 20:47
Unless I'm not understanding something, wouldn't you just make three variables, or even just one overall 'morality' one, and have the game check what the value is at the end?

This kind of thread normally goes on the main Quest board, btw.

XanMag
23 May 2016, 22:07
Definitely doable.

HegemonKhan
23 May 2016, 23:25
as Marzipan has stated already (to just further comment of my own):

yes, this is done through Attributes and the 'if' Script, a brief simple quick example:

(I used the special 'changed' Script Attribute too)

<asl version="550">

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

<game name="sample">
<gameid>b073bbfb-0e99-45d3-9786-bb395a6bc6b0</gameid>
<firstpublished>2016</firstpublished>
<author>HegemonKhan</author>
<version>1.0</version>
</game>

<object name="room">

<object name="player">
<attr name="alignment_integer" type="int">50</attr>
<attr name="alignment_string" type="string">neutral</attr>
<attr name="changedalignment_integer" type="script"><![CDATA[

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

if (player.alignment_string <> "good" and player.alignment_integer > 66) {
player.alignment_string = "good"
} else if (player.alignment_string <> "neutral" and player.alignment_integer > 33) {
player.alignment_string = "neutral"
} else if (player.alignment_string <> "evil") {
player.alignment_string = "evil"
}

]]></attr>
</object>

<object name="npc">
<attr name="kill" type="script">
player.alignment_integer = player.alignment_integer - 5
</attr>
<attr name="kiss" type="script">
player.alignment_integer = player.alignment_integer + 5
</attr>
<attr name="displayverbs" type="simplestringlist">kill;kiss</attr>
</object>

</object>

<verb>
<property>kill</property>
<pattern>kill</pattern>
<defaultexpression>You can't kill that.</defaultexpression>
</verb>

<verb>
<property>kiss</property>
<pattern>kiss</pattern>
<defaultexpression>You can't kiss that.</defaultexpression>
</verb>

</asl>