You are in a lounge.
You can see a TV, a sofa, a table, a lamp, a newspaper, a defibrillator and Bob.
You can go south.
This is quite a plain lounge with an old beige carpet and peeling wallpaper.
> look at bob
Bob is lying on the floor, a lot more still than usual.
> use defibrillator on bob
Miraculously, the defibrillator lived up to its promise, and Bob is now alive again. He says his head feels kind of fuzzy.
> look at bob
Bob is sitting up, appearing to feel somewhat under the weather.
> use defibrillator on bob
WHAT!?! You don't want to do that! Bob is alive! Using the defibrillator on a living person could kill them.
<object name="bob">
<inherit name="editor_object" />
<inherit name="maleobject" />
<alive type="boolean">false</alive>
<useon type="scriptdictionary">
<item key="defibrillator">
if (bob.alive) {
msg("WHAT!?! You don't want to do that! Bob is alive! Using the defibrillator on a living person could kill them.")
} else {
bob.alive=true
msg("Miraculously, the defibrillator lived up to its promise, and Bob is now alive again. He says his head feels kind of fuzzy.")
}
</item>
</useon>
</object>
<object name="bob">
<inherit name="editor_object" />
<inherit name="maleobject" />
<warning type="boolean">false</alive>
<alive type="boolean">false</alive>
<useon type="scriptdictionary">
<item key="defibrillator">
if (bob.alive) {
if (bob.warning) {
SetObjectFlagOff(bob, "alive")
msg("Despite his struggling, you use the defibrillator on Bob, and he falls over dead.")
}
else {
SetObjectFlagOn(bob, "warning")
msg("WHAT!?! You don't want to do that! Bob is alive! Using the defibrillator on a living person could kill them.")
}
else {
SetObjectFlagOn(bob, "alive")
msg("Miraculously, the defibrillator lived up to its promise, and Bob is now alive again. He says his head feels kind of fuzzy.")
}
</item>
</useon>
</object><object name="bob">
<inherit name="editor_object" />
<inherit name="maleobject" />
<count type="int">0</alive>
<alive type="boolean">false</alive>
<useon type="scriptdictionary">
<item key="defibrillator">
if (bob.alive) {
bob.count = bob.count + 1
if (bob.count > 2) {
SetObjectFlagOff(bob, "alive")
msg("Despite his struggling, you use the defibrillator on Bob, and he falls over dead.")
}
else {
msg("WHAT!?! You don't want to do that! Bob is alive! Using the defibrillator on a living person could kill them.")
}
else {
SetObjectFlagOn(bob, "alive")
msg("Miraculously, the defibrillator lived up to its promise, and Bob is now alive again. He says his head feels kind of fuzzy.")
}
</item>
</useon>
</object>
Pertex wrote:Then you have to do some scripting. First you need a variable or attribute, something like "alive", Then you must add the key defibrillator to the use-command of Bob and add a script. Something like this
<object name="bob">
<inherit name="editor_object" />
<inherit name="maleobject" />
<alive type="boolean">false</alive>
<useon type="scriptdictionary">
<item key="defibrillator">
if (bob.alive) {
msg("WHAT!?! You don't want to do that! Bob is alive! Using the defibrillator on a living person could kill them.")
} else {
bob.alive=true
msg("Miraculously, the defibrillator lived up to its promise, and Bob is now alive again. He says his head feels kind of fuzzy.")
}
</item>
</useon>
</object>
var1="test"
var2=2
<object name="vars">
<PersonPatrickStatus type="int">0</PersonPatrickStatus>
<PersonKennethStatus type="int">0</PersonKennethStatus>
<Spielername type="string"></Spielername>
<Spielervorname type="string"></Spielervorname>
<Spielergeschlecht type="string"></Spielergeschlecht>
</object>
<object name="bob">
<inherit name="editor_object" />
<inherit name="maleobject" />
<warning type="boolean">false</alive>
<alive type="boolean">false</alive>
<useon type="scriptdictionary">
<item key="defibrillator">
if (bob.alive) {
if (bob.warning) {
SetObjectFlagOff(bob, "alive")
msg("Despite his struggling, you use the defibrillator on Bob, and he falls over dead.")
}
else {
SetObjectFlagOn(bob, "warning")
msg("WHAT!?! You don't want to do that! Bob is alive! Using the defibrillator on a living person could kill them.")
}
}
else {
SetObjectFlagOn(bob, "alive")
msg("Miraculously, the defibrillator lived up to its promise, and Bob is now alive again. He says his head feels kind of fuzzy.")
}
</item>
</useon>
</object>Jimmy Janiform wrote:I guess it's easier to make more objects. number 1 brings him back to life, but afterwards it disappears. The player won't get to see this though, because at the same moment you make number 2 disappear. This one gives you a warning and afterwards number 3 appears and 2 gets hidden. The 3rd one will be able to kill Bob.
It's what I always do and much simpler if you ask me.