How i "reset" the game or some element (for make levels)

Yukari
Hi! After a lot of "why it dont work!!!!? I am doing as the tutorial!! :cry: :cry: :cry: " I complete the first mission of my game: "reach the office".

The thing is that now i want that, when the player enter the office, the score of the mission appear and the rooms and other things reset.

The real problem is a character called: " the guard". In the start i speak to him to ask for the elevator key. But now i want he to "reset" and be ready for act his part in the mission 2. (the verb list need to change)

The same with a intercom. When the player enter the code for his office he see a print "oh, i was waiting for you...". Now that he reacg the office that print need to change.

Some advice or solution?

(sorry for my english)

adammadam
well idk if this is the best idea because im new to using quest as well. But what I'd do is probably copy all of the rooms I have and name them by their levels. So lounge level 1, office level 1, bathroom level 1 etc.. then I would copy them all and rename them lounge level 2, office level 2 etc.. and for every level which I need. since you said you want some things to change, then you can make what edits you want in the rooms and to all the objects in them for the next levels. Then it's just a matter of triggering the restart, well lets say for example your player starts off in their bedroom and the level is won when the player reaches the office, then you could have it so that there is an exit from office level 1 to bedroom level 2, from office level 2 to bedroom level 3 etc. And you could even rename the exit level 2, level 3 etc.

Yukari
Yes. I was thinking in something like that, using the "show" and "hide" options. Is a lot of work but i dont know much about programing :/

adammadam
well you wont have to use show and hide. You can make a kind of master room to put all the other rooms in. Make a room called level 1 and inside that put all the rooms which are level 1 rooms like kitchen level 1, office level 1 etc put your level 2 rooms all inside a room called level 2. Then you can simply have the exits all go where you want them to. Theres no need to hide the level 2 rooms whilst the player is in level 1 since the only way they should be able to get to them is through the exit to a level 2 room you make in the last room of level 1.

adammadam
It is a bit of work but at least you can copy and paste all the rooms and then make what minor changes you want to them depending on the level they are in

HegemonKhan
this is quite complex in what you want to do, but in essense, here's in conception, a way of doing it, is this:

create~add an Integer Attribute to your 'game' Game Object, such as for example:

(Object Name: game)
Attribute Name: global_game_state
Attribute Type: int (integer)
Attribute Value: 1

in code conception:

game.global_game_state = 1 ~~~ mission 1 phase of game
game.global_game_state = 2 ~~~ mission 2 phase of game
game.global_game_state = 3 ~~~ mission 3 phase of game
etc etc etc

all of your Objects and their Verbs (or any other used Elements for scripting: Functions, Commands, Turnscripts, Timers, etc) which change depending on what mission you're on (game.global_game_state), will need to start with an 'if' Script, in code example of a Verb:

<object name="guard">
<talk type="script">
if (game.global_game_state = 1) {
msg ("Hi.")
} else if (game.global_game_state = 2) {
msg ("Bye.")
} else if (game.global_game_state = 3) {
msg ("The guard is dead, you can't talk to him anymore.")
}
</talk>
<bribe type="script">
// blah script(s)
</bribe>
<kill type="script">
// blah script(s)
</kill>
<displayverbs type="simplestringlist">talk;bribe</displayverbs>
</object>


as for changing the Verbs, based upon the mission (game.global_game_state), see this thread's post (using the same 'if' Script shown design above with this below):

viewtopic.php?f=10&t=5322#p36859

an example:

(you'll also have to change the global game settings~options too, and~or the individual Object's settings options too, due to some options with the 'displayverbs~inventoryverbs' in them)

<object name="guard">
<talk type="script">
if (game.global_game_state = 1) {
msg ("Hi.")
} else if (game.global_game_state = 2) {
list remove (this.displayverbs, "bribe")
list add (this.displayverbs, "kill")
msg ("Bye.")
} else if (game.global_game_state = 3) {
list remove (this.displayverbs, "kill")
msg ("The guard is dead, you can't talk to him anymore.")
}
</talk>
<bribe type="script">
// blah script(s)
</bribe>
<kill type="script">
// blah script(s)
</kill>
</object>


------

if you need any help with any of this stuff, let us know, as this stuff is quite advanced for a new person to quest and~or especially to coding~programming.

adammadam
here is a little template for a game I made you can use to see

So in each of these rooms, you can put different things like you can have "wife level 1 in the level 1 bedroom, wife level 2 in the level 2 bedroom etc" and have the different ones say different things depending on the level. You can pretty much do what you want. If there's a lot of levels it might just end up being loooads but at least you can copy and paste what you need as well, maybe you will only have to make minor changes to many things, or keep many things the same.

magano
In my own way, you need to store the levels in a string list full of texts and responses for each level
To reword what HK said but in GUI view, you need to use the Switch for all things on your game which differs on each level

This code
<object name="guard">
<talk type="script">
if (game.global_game_state = 1) {
msg ("Hi.")
} else if (game.global_game_state = 2) {
msg ("Bye.")
} else if (game.global_game_state = 3) {
msg ("The guard is dead, you can't talk to him anymore.")
}
</talk>
<bribe type="script">
// blah script(s)
</bribe>
<kill type="script">
// blah script(s)
</kill>
<displayverbs type="simplestringlist">talk;bribe</displayverbs>
</object>


Can be translated in the GUI view as:
1. Create object with name = Guard (you should have the object by now)
2. Go to Verbs and add a verb called "talk"
3. Go to the Attributes tab and add an attribute (Under Attributes) called global_game_state (or anything you prefer)
4. At the bottom, choose "Run a script"
5. Click Add script => Switch... (Below Scripts group)
6. Type global_game_state at the textbox, click Add..., and type 1 (Level 1)
7. A dialog will open. Click Add Script => Print message => Type the message you wanted the guard to say
8. Repeat step 6 and 7 for all levels you have
9. Add more verbs (bribe and kill, according to HK) and repeat step 4 to 7 for all those verbs. You can add additional script (like deducting your money)
10. Update your display verbs in Objects tab
11. (Optional) Uncheck the Disable Automatically Generated verbs checkbox in the Object tab

Yukari
I will try all and see what works better for me. I dont know much about of programing but the idea is learn hehe.

Thanks!

HegemonKhan
this stuff is quite advanced (unfortunately, seemingly simple things done in a game to a person new to game making and coding, seem like they would be simple to do, but they actually aren't), so ask us for help all you want, we'll do our best to help you step by step, if you need it.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums