The tips and tricks thread

OurJud
13 Dec 2015, 21:34
Maybe I should have made sure I had some of my own at hand before posting this, but I don't.

Anyway, idea is to post any little tips and tricks you've picked up / created over your time using Quest. Things like shortcuts, (harmless) hacks, clever scripts that do fancy things, etc etc etc.

TinFoilMkIV
19 Dec 2015, 20:48
One thing I like to do is to create a room that will never be used in the game for organization, and use the object tree inside it kinda like folders. I use it for things like menu control and general systems like combat or extensive player effects/stats to prevent the actual objects themselves getting cluttered and being able to fairly easily find the code that does general use stuff that isn't room specific.

The Pixie
19 Dec 2015, 21:39
Similar to TFM4, I often set up rooms as zones, and have all the actual locations inside them. For example, one room might be the castle, and all the locations inside the castle go in the room; there might be a forest room that holds all the locations in the forest. It keeps rooms together, makes them easier to find, and also easier to hide when I am working on other stuff. I can also check if the player is in the castle:
if (player.parent.parent = zone_castle) {
...



I have said this before, but when creating a new command, and good way to approach it is to go though all the conditions it will not work for.
If the player is not holding a certain item, it is not going to work
If she is not in the right room it is not going to work
If somethng is not turned on it is not going to work
If it passes the above, it works

Convert that in to a cascade of if/else if/else.
if (not certain_item.parent = player) {
msg("You are not holding a certain item.")
}
else if (not player.parent = certain_room) {
msg("You need to be in another room.")
}
else if (not something.switchedon) {
msg ("You need to turn something on.")
}
else {
msg ("You do that thing, and solve the puzzle")
player.parent = prize_room
}

OurJud
19 Dec 2015, 22:06
Great stuff. Anything that can help organise the jumble of rooms and locations that build up while creating these games has got to be useful.

And the if stacking is also very good to know: if >> else if (until all criteria is met) >> else

HegemonKhan
20 Dec 2015, 12:53
there's ton of code you can look up (google) for doing various stuff (lots of programming sites with forums of code posts), though you do got to know what you're looking for, to look for it, which is a problem.

take for example, basic 'searching' and 'sorting' code functionalities...

here's a good site on the different sorting code algorithms:

http://www.sorting-algorithms.com/

and an example of a google search for 'linear' and 'binary' searches:

http://www.cprogramming.com/discussiona ... ching.html