Super nooby questions about modifying attributes during play

reverendanthony
I want to make a really, really simple gag game where you have a big horde of enemies and use a single verb like "shoot scavs" to reduce the number of enemies. Just as a way of poking fun of first-person shooters.

I've got a "hordenumber" attribute running for the "scavs" object that gives it a number, so when you look at it it tells you the attribute, but I don't know:

- How to connect the verb "shoot" to reducing "hordenumber" by one
- How to check for the "hordenumber" and if it's at a certain amount, to display something different on the room description (like ending the game when you get to 0 Scavs remaining, or having the enemies occasionally drop meaningless items you can pick up)
- How to pick a random death description every single time you type "shoot" (I'd write like 50 death descriptions and it would pick one randomly)

Any help would be appreciated! And sorry for wasting your time with such simple questions, I just couldn't figure out the expressions for the life of me.

Avantar
Unfortunately I can not open your game - I still have an old version and would like to keep it like in which I am busy with my game. (I guess I can 'change' my ASL version somewhere - but, for now, I'd rather not)

What you ask is surely not easy for me to accomplish but I will take a stab at some hints:
Shoot will be a verb on the player object. (game.pov)
For the script you will use GetRandomInt(x,y) [x being the min number and y the maximum]
Then you will use a For loop (foreach(){}) to loop through all the 'scavs' and use RemoveObject(scav number) when the random number is the same as the scav attribute number using an if statement.

Use a script for the room description and an if statement with switch and case for the different endings. (If it is only a couple of events, if and else would work fine) I guess a turn script might even work.
To end the game use the command 'finish' - you can call this anywhere in your script.

Dropping random stuff: I would say - create a room where you keep all these items and on the shoot script where the 'scav' has been selected and Removed, generate a random number again and use if, switch, case again to define which item you clone fro the room full of items to the room the 'scav' gets killed.

I would say - get a general understanding of the statements I have listed here. That should get you at least started.

I will leave it to HK to help a bit more. :-)

jaynabonne
Attached is an updated game that at least answers your first and third questions. Maybe that will help with some of the rest. It decrements the scav count on each shot, finishing the game when the count gets to zero. It also prints a random string on each kill. There is a string list attribute attached to the scavs called "shottext" that you can add strings to.

For the rest, I'd have to know more details if you want concrete code. :)

reverendanthony
Aw man, thanks so much! That's incredibly kind of you.

One more quick question:

Is there an easy way to add a verb that doesn't require an object? I basically want to hide dorky little goofs for if you happen to type in, I dunno, "fart" or "sing" that just have one-off results that don't interact with anything else.

jaynabonne
Create a command instead. :) That's how things like "help" and "undo" are implemented.

reverendanthony
Aha! Thank you so much.

HegemonKhan
My 'help' often hinders (confuses, or more recently I've posted some incorrect content in my posts, sighs), more than it helps, lol. I do try, though sometimes I take on stuff beyond my ability, or with code when they want GUI~Editor (as I can only help via code), or I try to answer something that I'm not actually sure~accurate about, sighs.

Jay's posts are true expert level of help (able to help via the GUI~Editor and~or Code), hehe :D

reverendanthony
Okay, one more dumb question, sorry:

How do I fiddle with the default commands in the game? I don't want "jump" to say "you jump but it does nothing," for instance, I want it to say "you jump really high cause you're in low gravity" or whatever. I also want to make it feasible to type "look scavs" instead of "look at scavs".

Silver
I believe this is in templates.

http://docs.textadventures.co.uk/quest/ ... lates.html

jaynabonne
For either of these, you need to do this first:

1) Click on the "Filter" drop down in the bottom left, and
2) Select "Show Library Elements"

This will make all the core library elements visible in your tree. They will show up as gray, as they are not directly editable - yet.

For the "jump" case, you can do one of two things:
1) Under "Commands", find the "jump" verb. By default it prints out the DefaultJump template. You can modify the command script directly. First click Copy in the top right to copy the command into your game. It will no longer be gray in the left pane after that. Then you can change the text directly. You can change it from "expression" to "message" and then just type in the text you want.
-- or --
2) Modify the DefaultJump template (leaving the command alone). Templates are under Advanced, and there are a lot of them. But once you find the one called "DefaultJump", copy it into your game with the "Copy" button and then modify the text.

For the "look scav" case, you can modify the "lookat" command to generally accept "look" as well. Again, with library elements shown, find "lookat" under "Commands". Copy it into your game with the "Copy" button. Then add "look #object#;" to the front of the pattern. Your pattern will then look like:

look #object#; look at #object#; x #object#; examine #object#; exam #object#; ex #object#


This does mean that the plain "look x" pattern will work with all objects, not just the scavs.

reverendanthony
You are my hero! Thanks!

reverendanthony
It looks like "look" broke "look at" -- is there a way to make those both work simultaneously?

EDIT: Attaching file so you can see.

jaynabonne
Ah, sorry. Make it this instead:

look at #object#; look #object#; x #object#; examine #object#; exam #object#; ex #object#


Put "look at" before "look". That makes it match "look at" first. Otherwise, it tries to find an object with the word "at " on the front, and it never does.

HegemonKhan
take a look at this thread, as I talk about the math computational expressions:

viewtopic.php?f=10&t=4643

(and if you search this forum, I got a lot of older posts~threads on modifying stats~attributes too, which are more detailed)

reverendanthony
Looks like I'm pretty much all done with the game!

Just to be sure -- there's no tremendously easy way to export the game file so that I could, say, host it on my own website or anything, is there?

Silver
reverendanthony wrote:Looks like I'm pretty much all done with the game!

Just to be sure -- there's no tremendously easy way to export the game file so that I could, say, host it on my own website or anything, is there?


I believe that was something Alex had planned for Quest 6 which suggests it currently isn't supported. Although I don't know if you can currently or not as he says 'host a game easily on your own website' which doesn't necessarily imply it currently can't be done.

viewtopic.php?f=15&t=3816

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

Support

Forums