|
Axe Software Forums
Quest Developer Forum Very long coded demo....
|
Author | Topic: Very long coded demo.... |
Computer Whizz |
posted 21-08-2001 20:36 GMT
Here. I've fooled about with it a bit and two things are obvious from the start: 1. The timer (for reasons unknown to me!) doesn't work. Maybe I have got something like #quest.thing# wrong! If anyone could help me out by pointing out some wrong code : =========START CODE======== define game <Shooting Demonstration!> define variable <HP> define variable <HP_display> define variable <9mm> define variable <armed> command <shoot #monster#> do <shoot_proc> define room <room1> south <room2> define object <handgun> end define define object <monster1> end define end define define room <room2> north <room1> define object <vase> end define end define define room <room3> north <room2> define object <Boy> end define define object <monster2> end define define object <monster3> end define define object <monster2> end define define object <chair> end define end define define procedure <shoot_proc> end define define procedure <hit_proc> end define define procedure <arm_proc> end define define procedure <moving_mons_proc> end define define procedure <start_proc> end define define procedure <dead_proc> end define define text <intro> end define define text <win> end define define text <lose> end define define timer <moving_monsters> end define =======END GAME======= Computer Whizz |
Computer Whizz |
posted 21-08-2001 20:39 GMT
Aye-aye! Just saw something..... I've got two shoot commands..... that's a bit of a bummer! .....CORRECTING..... Computer Whizz |
Alex |
posted 21-08-2001 20:47 GMT
I've not run your code in Quest due to laziness but here are some things I've noticed from the code: Answer #1. You said: for each object in <quest.currentroom> Our survey said (insert loud grunting bleep): for each object in <#quest.currentroom#> Answer #2. Yes it's probably the alias. You'll need to get disambiguating what the player types - basically, convert the name the player types into Quest's name for the object. Always in your code you need to use the Quest object name - the alias is only used for player input. The magic words are "$getobjectname(...)$ function".
if (%$objectproperty(#armed#;BULLETS)$% > 0) I don't know what those % signs are doing there but it looks nasty. |
Computer Whizz |
posted 21-08-2001 20:59 GMT
Alex: If you look at the object "handgun" then you'll see the property BULLETS=9mm. Now up in the status variable's you have the variable 9mm. I wanted to give others the possibility of many different bullets/guns. I *think* that the #quest.currentroom# thing went wrong inside quest, so I re-did it to quest.currentroom. I'll have another try but.... I'm going to moan now about the alias business..... AAAARRRRGGGGGHHHHHH!!!! Now, I'm going off to do those! Computer Whizz |
MaDbRiT |
posted 22-08-2001 10:48 GMT
ALEX!! A BUG??? Playing with C W's code I sort of have it working after a fashion with some tweaks here and there, but there are a couple of odd things I spotted that look suspiciously like BUGS! Firstly, using %% in a display string for a status variable prints -32767 (i.e. generates a missing variable) rather than printing a % sign as per the manual. Secondly, when CW's code tries to SET the HP status variable (numeric) like so :- set <HP; %HP% - %damage%> it crashes Quest completely. I can't see why it should do that, but comment out the set line and Quest runs - leave it in and it crashes... fairly conclusive that! I can't replicate this in a simple test, so there's something well weird happening here! Oh yes CW - the timer IS working as written, the routine it calls isn't ;-) Al |
Computer Whizz |
posted 22-08-2001 11:31 GMT
MaDbRiT.... Yes. I altered this, changed that, and got to the stage you are now. Where Quest crashes when trying to re-write the HP variable! I just thought it was a crap piece of coding that I had done in either the "onchange" or in the procedure somewhere. If this allows it to work, could you have a look for me? Here I can only get 2.19 to work :( Computer Whizz |
Computer Whizz |
posted 22-08-2001 11:37 GMT
One more thing: I tried the "arm #weapon#" command. But it comes up with some weird stuff!! Like " 'intproc~192' not found!" and stuff like "object 'armed; #weapon' not found" and all this other stuff. Computer Whizz |
MaDbRiT |
posted 22-08-2001 12:21 GMT
AHA!! I think I know what is happening! By changing the HP_display status variable in the 'onchange' of the HP status variable, you force Quest to call the onchange routines again - which then call the onchange routines again which must then call the onchange routines again.......... BLEEHHHHHH... I may be wrong, but I smell an OOZULUM ( never ending loop of recursive code ) :-( I've not had a chance to look at the ARM bit yet.... ;-) Al |
Computer Whizz |
posted 22-08-2001 12:39 GMT
What about the "if (%HP% > 20)" bit? If, for some reason, this goes arry, and set's it to 20, that would make it do the "onchange" bit again, which would set it again, which would do the onchange again, set, onchange, set, onchange, CRASH!!!! I'm going to remove that part when I get home..... Computer Whizz |
MaDbRiT |
posted 22-08-2001 12:48 GMT
CW - I have your 'arm' routine working now - it's just that you used the wrong sort of brackets here and there.... e.g. if got (#weapon#) then { MUST be coded as; if got <#weapon#> then { the same applies to 'if here', that needs <> and not () to work ;-) Check through these and a lot of mysteriously non working code will be cured! The "if (%HP% > 20)" to call the die routine is fine - I presume because it doesn't alter a status variable so the 'recursive' call to 'onchange' doesn't happen. Al Al |
Computer Whizz |
posted 22-08-2001 13:01 GMT
No. Al, you're looking at "if (%HP% < 20)" and not the "if (%HP% > 20)" I'm talking about the first IF where it sets HP to 20 if the value is OVER 20 (in theory!) but that might be causing the problem :) Thanx for the info on the <>'s instead of the ()'s. I'd have thought they'd have been fully converted for Quest 3.0, but I'll have a go! Computer Whizz |
Computer Whizz |
posted 22-08-2001 13:05 GMT
:::NOTE TO SELF::: remove exessive else's from the HP variable's onchange bit. --CW-- |
MaDbRiT |
posted 22-08-2001 15:08 GMT
Sorry - misread your question - yes resetting the HP variable inside it's 'onchange' will cause a problem for sure it seems :-( On 'losing the elses' - how about if (%HP%<=0) then do <dead_proc> That WOULD work - if it wasn't for the recursion problem of changing stuff in an onchange routine that is... LOL Al |
Computer Whizz |
posted 22-08-2001 19:00 GMT
Well, actually I was planning on doing it the opposite way, but now I see what you are doing, I'm going to do it that way :) I'm still thinking that the set <HP; 20> shouldn't effect it! Because it shouldn't be above 20!! Computer Whizz |
MaDbRiT |
posted 22-08-2001 20:35 GMT
Yo! C.W. Rather than post a whole wodge of revised code here, I've e-mailed you my hacked about version of your code which is basically functional now. Al |
Computer Whizz |
posted 23-08-2001 01:30 GMT
Yep. Have got MaDbRiT! I'll be taking a look on Saturday..... I'm busy until then! Computer Whizz |