command <use #@object#> {
if property <#object#; weapon> then {
for each object in <#quest.currentroom#> if property <#quest.thing#;npc> then {
if property <#quest.thing#;scared> then move <#quest.thing#;new-room>
}
}
else msg <You use your object or whatever would normally happen.>
}
command <use #@object#> if property <#object#; weapon> then {
for each object in <#quest.currentroom#> if property <#quest.thing#; scared> then {
msg <The crowd panics in fear and runs for their lives!>
move <#quest.thing#; inven>
}
}
else msg <You use your object or whatever would normally happen.>
command <use #@object# on #@quest.thing#> if property <#object#; weapon> then {
if property <#quest.thing#; scared> then {
msg <The crowd panics in fear and runs for their lives!>
move <#quest.thing#; inven>
}
}
else msg <You use your object or whatever would normally happen.>flag off <msg>
for each object in <#quest.currentroom#> {
if property <#quest.thing#; scared> then {
if not flag <msg> then {
msg <The crowd panics in fear and runs for their lives!>
move <#quest.thing#; inven>
flag on <msg>
} } }This kind of thing I use a lot, you can use a variable instead if you want.
The bold lines are all I've actually changed, just insert them in the same fashion with the other code.flag off <msg>
for each object in <#quest.currentroom#> {
if property <#quest.thing#; scared> then {
if not flag <msg> then {
msg <The crowd panics in fear and runs for their lives!>
move <#quest.thing#; inven>
flag on <msg>
} } }
command <use #@object#>{
flag off <msg>
if property <#object#; weapon> then {
for each object in <#quest.currentroom#> if property <#quest.thing#; scared> then {
if not flag <msg> then {
msg <The crowd panics in fear and runs for their lives!>
move <#quest.thing#; inven>
flag on <msg>
} }
else msg <You use your object or whatever would normally happen.>
}
command <use #@object# on #@quest.thing#> {
flag off <msg>
if property <#object#; weapon> then {
if property <#quest.thing#; scared> then {
msg <The crowd panics in fear and runs for their lives!>
move <#quest.thing#; inven>
flag on <msg>
} }
else msg <You use your object or whatever would normally happen.>
}There you go!
Ye Mighty Manual wrote:#object name:property#
For example, if you have an object called "cod" and it has a "smellstrength" property, you could read this in an msg command using:
msg <The cod has a smell strength rating of #cod:smellstrength#.>
define object <man>
look <The man eyes you menacingly.>
speak <He doesn't want to talk.>
prefix <the>
use anything if ( #quest.thing:weapon# > 0 ) then {
msg <He begs for mercy!>
}
else msg <He laughs at you>
end define define object <small gun>
alt <gun>
look <This weapon wouldn't hurt a fly. Well that's not true. It would kill it. Let's say this gun wouldn't hurt a dungeon troll unless it was at point blank.>
take <You take the gun and feel happy.>
speak <Hi gun, how are you?>
prefix <the>
displaytype <little weapon>
article <it>
gender <it>
properties <weapon=1>
end define define object <man>
look <The man eyes you menacingly.>
speak <He doesn't want to talk.>
prefix <the>
use anything if ( #(quest.thing):weapon# > 0 ) then msg <He begs for mercy!>
else msg <He laughs at you>
end defineelexxorine wrote:It's not working because #quest.thing# is for 'for each object in' scripts, not 'use' scripts. Use #quest.use.object.name#. Man that took finding in the documentation, it's not listed under built-in string variables, but if you look under the basic object stuff, use section it says it. Try it with that string instead, it should work.