If within If?

XanMag
24 Dec 2015, 15:56Would this work out okay? I tested it in my game and it appears there are no loopholes here (but that has backfired on me before!). Please let me know if this would work because I have a lot of commands to add where you can use objects on other objects in different locations. And, of course, I already have them in the use this on other object option, but for many things I also want to give the option of alternative commands that, in many cases, make sense/seem more natural and also work. All of my other commands I need to add are similar to this one.
In addition: does this seem like more trouble (or will cause more trouble) than it is worth? For example, I have a landmine that the player needs to 'use on tank'. Should I bother with these commands - "put landmine under tank; hide landmine under tank; put landmine under track; etc" or is relying on 'use landmine on tank' sufficient?
Thanks!
if (Got(honey)) {
if (Got(long thread)) {
msg ("You drizzle the honey all over the long thread. Now you have a long sticky thread... Now what?")
RemoveObject (honey)
AddToInventory (long sticky thread)
RemoveObject (long thread)
}
else {
msg ("I don't see that you are carrying the long thread.")
}
}
else {
msg ("It does not appear you are carrying the honey.")
}
In addition: does this seem like more trouble (or will cause more trouble) than it is worth? For example, I have a landmine that the player needs to 'use on tank'. Should I bother with these commands - "put landmine under tank; hide landmine under tank; put landmine under track; etc" or is relying on 'use landmine on tank' sufficient?
Thanks!

OurJud
24 Dec 2015, 16:15I'm not good enough with scripts to confirm whether yours would work, but as for the other question, I think the player is more than likely going to use 'use landmine on tank'. For what little extra work it requires, though, what's the harm in including the others any way?
The Pixie
24 Dec 2015, 16:42Code looks fine to me.
Try to cover everything the player could type. But you should be able to do it in one command. Is "track" a synonym of tank? If it is, your command pattern is:
put #object1# under #object2#; hide #object1# under #object2#
Try to cover everything the player could type. But you should be able to do it in one command. Is "track" a synonym of tank? If it is, your command pattern is:
put #object1# under #object2#; hide #object1# under #object2#