Project

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, joltcountry

Totoro

Project

Post by Totoro »

Hi ACKers,

Having spent many, many hours many, many years ago with Stuart Smith's ACS, I've been thrilled to tinker with ACK.

I usually don't like to post previews, ideas, etc. until there is something for real. I am having some problems with the marco language and wanted someone to look it over and tell me if I'm doing something wrong.

The title sequence runs the following macro to set up T = 1 (meaning our heroine is dehydrated and thirsty):

Macro 11: INITIAL MACRO
1: SET T = 1
2: STOP

Then, I want her to lose HP every turn until she finds water:

Macro 8: HOURLY MACRO
1: IF T = 1 THEN 3
2: STOP
3: SET HP = HP - 1
4: SMSG 2
5: STOP

Finally, she discovers a drinking pot that refreshes her and gives EXP, unless she is no longer thirsty:

Macro 12: DRINKING POT
1: IF T = 0 THEN 5
2: SMSG 9
3: SET T = 0
4: SET EXP = EXP + 100
5: STOP

So far, it isn't working. Macro 8 does not fire. It's previous version fired no matter what:

Macro 8: HOURLY MACRO
1: IF T = 0 THEN 4
3: SET HP = HP - 1
4: SMSG 2
5: STOP

It's probably one of those silly things I'm doing wrong with the macro language, and I will feel dumb when someone points it out. The only programming I ever did was in basic, and that was sooooo long ago.

Anyway, thanks for the help and here is a little gallery preview:

Image[/img]

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Re: Project

Post by Garth's Equipment Shop »

Totoro wrote:Hi ACKers,

Having spent many, many hours many, many years ago with Stuart Smith's ACS, I've been thrilled to tinker with ACK.
Hi, and welcome! Indeed the spirit of ACS lives on here.
Totoro wrote:I usually don't like to post previews, ideas, etc. until there is something for real.
That's normally good tact on a much busier forum but here it is so slow most of the time you don't have to worry about posting too much or how 'real' it is. If you like to mess around making funny little comics in paint when your bored, go ahead and post it. If you'd like to flesh out a story idea and get people's feedback or ideas for it go ahead and start a thread for it, write whatever you have so far and invite others to add to it like an interactive story writing thread or brain-storming thread whatever you want. Review some classic retro pen and paper rpg modules you'd like to see made in ACK, or classic retro crpgs you think has some magic formula that makes them great examples for crpg designers. Just some random ideas.
Totoro wrote:I am having some problems with the marco language and wanted someone to look it over and tell me if I'm doing something wrong.
I'll be testing your macros out in my own test adventure and get back to you on that. First thing I notice without any testing is that you said you wanted her to lose hp every turn but you put the lose hp code in an hourly macro.
Totoro wrote:Then, I want her to lose HP every turn until she finds water:

Macro 8: HOURLY MACRO
1: IF T = 1 THEN 3
2: STOP
3: SET HP = HP - 1
4: SMSG 2
5: STOP
Every turn would be step macro.


Totoro wrote:Anyway, thanks for the help and here is a little gallery preview:

Image[/img]
WOW, that is some really awesome pixel work there! Did you make them in some paint program and then import them with a custom palette? Thats how I usually do it. By the way, with that style of graphics you should take advantage of the transparency option in the tile editor. Look it up in the manual if your interested.

Totoro

Re: Project

Post by Totoro »

Thanks for they reply!

I meant an hourly instead of a step macro - otherwise we kill our heroine too soon.

Thanks for the compliments on the pixel work (did alot of that with Civ2 in its' day). To be honest, the crab was adapted from a dwarf fortress tileset. The dog and the tiger from Nethack.

Been working on the transparency as you mentioned, here is another advance. Our heroine, threatened by snakes.

Image

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

OK after much testing it looks as if the game clock itself is sort of behaving unexpectedly or at least the variables responsible for keeping up with the hours and minutes as can be seen in this screenshot.

Image

I set up sayval hour at 1 1 and sayval minute at 4 1, STOP, in a macro which i then attached to an extra key which was the shift/question-mark key combo (originally wrote plus sign but forgot I changed it when I was reminded by ACK that it already uses that key to speed up combat).

I also made another macro with advtime 60 and attached that to the greater than sign (shift key and period key). I put the dehydration macro in the hourly slot and added a thirst quenching flask to the test map (the flask sets the T variable back to zero when used).

So I tested this at first by running around and hitting my display "time" key every so often to watch time advance. Oddly, not even the minutes seemed to be counting down. After what seemed like many moves in the game i finally saw the minute counter flip. After some testing I'm guessing that about 12 steps or moves actually amount to one in game minute.

Where the manual says advtime advances time by x minutes, it means in game minute increments as far as I can tell. I think something is off though in the game's translation of minutes into hours, that or game minutes which advtime goes by are not exactly equal to in game steps/moves. When I increment the game clock by 60 advtime minutes I see the hour advance but I also see the minutes advance slightly each time and they add up each time I flip the hour.

That still doesn't explain though why the hours just keep right on counting into the nineties like in my screenshot. If it is in 24hr military time as the manual says then the hour counter should reset at 2400. Anyway, that might explain why the hourly macro isn't firing. Perhaps it is because the clock doesnt reset.

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Further test results. Was bugging me that I couldn't figure out what it was doing so I did a more careful test and wrote down each new hour/minute value I got after each 60 minute advtime addition. The results were very strange indeed.

I have the game clock starting at 12. The first sayvals report:
12 hours and zero minutes like it should.

12 0
(pressing ">" key I set up to run advtime 60 once)
13 0
(good, as expected the hour was advanced by 1. So I press > again)
14 1
(whoa! where did the extra minute come from!? It will do this again for a while then it gets really weird)
15 2
16 3
17 4
18 5
19 6
20 7
21 8
22 9
23 10
03 11 (hour flipped back from 23 to 03)
13 11 (hour gains 10 back making 13, min.no change)
23 12 (hr gains back another 10 making 23 again)
33 13 (and so lets keep adding 10 from now on the time keeper muses to itself)
43 14
53 15
63 16
73 17
83 18
93 19
10 20 (ok i at least respect the 2 digit limit but i still wanna keep it in the tens so lets go back to 10 shall we?)
11 21 (ok i changed my mind, now i want to count normally again. K thanks.)
12 22
13 22 (yes minutes repeated here, or rather no minute was added which is actually what is supposed to happen)
14 23
15 24
16 25
17 26
18 27
19 28
20 29
21 30
22 31
23 32
03 33 (Counting by single digits is so tiring. I think Ill flip the hour back early this time instead of going all the way into the 90s, but not all the way back I have a rep to keep you know...)
13 33 (ah counting by 10s is my favorite thing! woopee!)
23 34
33 35
43 36
53 37
63 38
73 39
83 40
93 41
10 42 (K. Since im so into the 10s groove again lets go back to 10 instead of 3 this time.)
11 43
12 44
13 44
14 45
15 46
16 47
17 48
18 49
19 50
20 51
21 52
22 53
23 54 (Hmm. I seem to have forgotten how to count past 23... O wait! Now I remember. By golly this is how I was supposed to be counting all along!)
03 55 (Damnit, what were those two numbers that went before 3? Its been so long since I counted that low...)

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

More testing done. I forgot that ACK games can be set to show the clock. So I turned that on and did test again. This time I changed the starting time to zero hundred hours. Which displays as 12:00 AM on the in game display clock. But as you can see from my own hour and minute variable display its actually zero.

Image

So the in game clock display seems to keep the hour perfectly for a while.

Unfortunately the minutes keep adding up when you increment an hour at a time for a while so eventually it gets to 17:59 and then instead of switching to 1800 hours it jumps to 1900 because it adds that extra minute to the 59 making its own hour jump on top of the hour you are already adding. And as for the HOUR and MINUTE variable values. They still behave exactly as I showed in last post even while the game display clock seems to be disregarding it's counting by tens.

Isn't the built in game clock display kind of mixed up? I mean we can see it definitely counting 24 hrs instead of flipping at 12 like a normal clock does yet when I set the game to start at zero hours the game's clock starts at 12. Doesn't that throw it completely off?

When I changed the minutes added by the advtime macro from 60 to 59 it managed to keep the hours on track. The minutes then appear to decrease rather than increase. So that the hour never skips ahead from those mysterious extra minutes piling up.

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Ugh I hate it when I'm stupid. Well I'm sort of stupid and lucky at the same time. Stupid because I did all that testing without thoroughly checking out the options set for the map i was using for my tests. Lucky in that what i found there doesn't necessarily make all that work for nothing. Only thing really is now I realize why I couldn't see any correlation between steps and and time passed, it was because this map had steps set to equal 5 seconds of time. Best to make your own testing game and map from scratch rather than try to edit someone else's premade one. Also it was set to not use any step macro global or otherwise. Fortunately I wasn't testing the step macro I was testing the hourly macro. Now I will try to get the thirst macro to work as a step macro. Hmm. I wonder if I could have the step macro keep tabs on the game clock and fire the hourly macro from there every hour... Ill keep ya posted...

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Damn.
Image
I somehow got the hourly macro to fire but I'm not sure how I did it. So I guess I'll just have to list any changes I just made before it happened.

#1. I went into the test map's options and changed steps to equal 1 minute so that I could see the clock tick with each step. That worked very nicely.
#2. I made a minor adjustment to my advance time macro in an attempt to offset that strange counting problem it seems to have. So now every time I hit the > key to add an hour to the clock it alternates between adding 60 minutes and 59 minutes. That also worked out almost perfectly. First time it adds an hour and a minute. Next it adds 59 minutes thus bringing the minutes back to zero (assuming no other moves have been made to advance the clock of course).
#3. I moved the setup variables macro from the global game intro macro to the room map's entrance macro. And I added a message to it letting me know it was firing.
#4. I had the player start position in the test map and when I was starting a new game the message from the variable setup macro wasn't firing so I used a portal to leave that map and come back. Soon as I came back I saw the message letting me know that macro had fired thus setting up my variables. Including turning on the thirst variable for testing purposes.

Now as I was traveling and the clock flipped from one hour to the next all of a sudden I saw the getting thirsty message fire from the hourly macro! And my hp was hit for 1 damage. WOOHOO!

Conclusion. Perhaps using the global game intro macro for setting up variables isn't such a good idea. Well, that or setting your steps to equal only 5 seconds isn't such a good idea.
Last edited by Garth's Equipment Shop on Sun Mar 23, 2014 11:32 am, edited 1 time in total.

Totoro

Post by Totoro »

Thanks for all of that!

Now I run the thirstiness as a macro you trip near the beginning, and voila - our heroine is dehydrating.

I was still having problems with having the drinking water actually work - it would not run "Set t = 0" (not thirsty). I would also not jump ahead and not run the macro if she was not thirsty. ("if t = 0 then..."). Maybe I need "If t < 1"?

Anyway, I worked around it by having the macro triggered directly by a macro square that disappears and always makes t = 0.

It works. Not as elegant as having macros that skip from one line to another depending on conditions, but for now, the creation process continues!

Now that I have started, I'll have to post some stuff as I get it ready...

Thanks again, Garth!

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Totoro wrote:Thanks for all of that!

Now I run the thirstiness as a macro you trip near the beginning, and voila - our heroine is dehydrating.

(snip)...

Now that I have started, I'll have to post some stuff as I get it ready...

Thanks again, Garth!
Glad it helped. I had fun trying to figure it out and was able to clear a few cobwebs out of the old ACK section of my memory. ;)

What I would do to ensure my setup variables for this test map fired properly without having to leave the map and reenter it is start the player off in a different place like a start room which is extremely limited and forces the player to take the only exit which is a portal to the map I actually wanted the player to start at.

If I already have this big fancy map made for the player to start at there are a few options I could take. One copy the map and add it to the game as a new map, then surround the player start tile with portals disguised as the grass or whatever terrain is there in your map and have them go to the same tiles in the original map.

Or, heres a few brainstorming ideas to disguise the fact that you are just providing an excuse to force the player to teleport at the very beginning of the game so that the first real playable map of the game gets it's entrance macro triggered so your variables get setup.

Add a little intro scene to the game, perhaps even a nice mosaic cut scene which when finished leaves the player somewhere appropriate to your story which could be anything you can imagine really. A room that is just all black named ASLEEP, or DREAMING, or WAKE-UP!. So basically the player has to run around in the dark till they find the secret door to leave the sleeping or dreaming state and wake up in which ever map you want them to.

The mosaic (if you use one) could be a dream the player just had. If you don't want to put much work into that you can just have them teleport (wake up) as soon as they step on any tile. Or get creative and have a room with many doors which all have different weird dream/nightmare rooms but one of them leads to consciousness.

Or the start room could be the belly of an airplane which the player is jumping out of. To jump out the player just exits through the open door of the plane and then you can just describe the player's act of skydiving and parachuting down or actually show it in a cutscene with images.

Or the player could start off in some room with a wardrobe or magic mirror or anything that could be a portal to another world.

If your game uses a world map there are lots of ways to do it depending on how much actually happens on the worldmap. If the worldmap is basically just to show the player traveling from one place to another and all the real game play happens in other maps accessible from worldmap icons representing towns or other locations then you can just start the player on the worldmap and pretty much any place on the map the player is able to enter can trigger your setup variables.

Or if the worldmap is actually much more a part of the actual game play then you can start the player off in a room represented by a spot on the map where there isn't much of anything going on like an abandoned shack, a cave, or a clearing the player was taking shelter or camping for the night. When the player leaves that location he/she finds him or herself on the worldmap.

Heres what I did for the flask.

My Flask Object:

Image
No on use message because I want the macro to decide what message to show if any. I'd probably add another message saying your not thirsty to the macro for when you try to use the flask when T=0. But I didn't bother for the test.

Image

Message when used is set to my msg #13:
Image

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh »

I'll have to look into all this whenever I have the time. I never had problems with step macros, hourly/daily macros, and the passage of time - and I have many regions with 5-second step intervals.
- A:A:

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Lookin forward to reading your expert opinion on the matter Admiral

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh »

Garth's Equipment Shop wrote:Lookin forward to reading your expert opinion on the matter Admiral
I'll start next week. This month has been a very busy one for me, with little time left for ACK-ing.
- A:A:

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Re: Project

Post by Admiral Ackguh »

Totoro wrote:The title sequence runs the following macro to set up T = 1 (meaning our heroine is dehydrated and thirsty):

Macro 11: INITIAL MACRO
1: SET T = 1
2: STOP

Then, I want her to lose HP every turn until she finds water:

Macro 8: HOURLY MACRO
1: IF T = 1 THEN 3
2: STOP
3: SET HP = HP - 1
4: SMSG 2
5: STOP

Finally, she discovers a drinking pot that refreshes her and gives EXP, unless she is no longer thirsty:

Macro 12: DRINKING POT
1: IF T = 0 THEN 5
2: SMSG 9
3: SET T = 0
4: SET EXP = EXP + 100
5: STOP
In this post, many people pointed out many issues, so I will handle the first one first.

Could there be a problem with the T variable? I know this sounds strange, but if you are using or have switched to one of the Mega Patches, this could be it. Some of the patches do use the T variable to stop creature movement. I use only the last official ACK version (3.251) with no patches, and everything works right for me.

Try using the same code with a variable other than T, and see if that makes a difference. Also, check your macro and dialogue code thoroughly to see if anything else uses T. To do this, export macros & dialogues to a searchable text file.

And do you use ACK with any Mega Patches? If so, see if using basic ACK makes any difference.

A helpful debugging tool is to put SOUND commands at various points in Macro 8.

1: SOUND 1
2: IF T = 1 THEN 4
3: STOP
4: SOUND 2
5: SET HP = HP - 1
6: SMSG 2
7: SOUND 3
8: STOP

That way, you can see (hear) if this macro really fires or not, and at which points.
So far, it isn't working. Macro 8 does not fire. It's previous version fired no matter what:

Macro 8: HOURLY MACRO
1: IF T = 0 THEN 4
3: SET HP = HP - 1
4: SMSG 2
5: STOP
- A:A:

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh »

Garth's Equipment Shop wrote:Further test results. Was bugging me that I couldn't figure out what it was doing so I did a more careful test and wrote down each new hour/minute value I got after each 60 minute advtime addition. The results were very strange indeed.

I have the game clock starting at 12. The first sayvals report:
12 hours and zero minutes like it should.

[deletion]
21 8
22 9
23 10
03 11 (hour flipped back from 23 to 03)
13 11 (hour gains 10 back making 13, min.no change)
23 12 (hr gains back another 10 making 23 again)
33 13 (and so lets keep adding 10 from now on the time keeper muses to itself)
43 14
53 15
63 16
73 17
83 18
93 19
10 20
I found out myself that SAYVAL simply overwrites without erasing anything. So when HOUR is 23, it writes 23 left-justified at the specified spot on the screen: 23.

Then HOUR goes to 0, and SAYVAL writes a 0 over the 2 without erasing the 3, leading to: 03.

See the pattern? The first column is the actual value of HOUR, the second is what it seems to be:

Code: Select all

23 23 
 0 03 
 1 13 
 2 23 
 3 33 
 4 43 
 5 53 
 6 63 
 7 73 
 8 83 
 9 93 
10 10 
I find it useful to DRAW a small black blotch on the same part of the screen before I use SAYVAL, unless I am sure the screen is freshly-drawn with no previous SAYVAL results.
- A:A:

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh »

Garth's Equipment Shop wrote:#1. I went into the test map's options and changed steps to equal 1 minute so that I could see the clock tick with each step. That worked very nicely.
Step length makes no difference. For testing purposes, I set it to 0 (no time passes), and still get problems with ADVTIME.
#2. I made a minor adjustment to my advance time macro in an attempt to offset that strange counting problem it seems to have. So now every time I hit the > key to add an hour to the clock it alternates between adding 60 minutes and 59 minutes. That also worked out almost perfectly. First time it adds an hour and a minute. Next it adds 59 minutes thus bringing the minutes back to zero (assuming no other moves have been made to advance the clock of course).
You may have discovered a bug.

I have found if you ADVTIME for 60 minutes or more, the system sometimes adds an extra minute. The first time, it doesn't. The second time, it does. And it alternates. It does not depend on the current time. There seems to be no way to add only 60 minutes for the even-numbered iterations.
#3. I moved the setup variables macro from the global game intro macro to the room map's entrance macro. And I added a message to it letting me know it was firing.
That is strange. The TITLE and INTRO macros always work for me (except for HELLO variables, as detailed in Bug Reporting Thread.) If the thirst flag applies only to that room, then setting it in the room's entrance macro makes more sense anyway. Also remember:

TITLE fires first - when engine starts before ENTER/C prompt
INTRO fires second - only for creating new game
Conclusion. Perhaps using the global game intro macro for setting up variables isn't such a good idea. Well, that or setting your steps to equal only 5 seconds isn't such a good idea.
There may be a system bug, not firing the intro macro when it should. But setting steps to 5 seconds makes no difference. In most of my games I have at least one region with 5-second steps.
- A:A:

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh »

Totoro wrote:I was still having problems with having the drinking water actually work - it would not run "Set t = 0" (not thirsty). I would also not jump ahead and not run the macro if she was not thirsty. ("if t = 0 then..."). Maybe I need "If t < 1"?
This is very strange. If T is equal to zero, then both "IF T = 0" and "IF T < 1" should execute. Have you tried checking your code to see if anything else changes T? Have you tried using another variable for your thirst flag?
Anyway, I worked around it by having the macro triggered directly by a macro square that disappears and always makes t = 0. It works. Not as elegant as having macros that skip from one line to another depending on conditions, but for now, the creation process continues!
I am happy you found a workaround.
- A:A:

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Very thorough report Admiral, excellent work. Thanks for the clarifications. Its amazing that after all these years I'm still learning stuff about ACK lol. You solved the riddle of the advance time keeping variables! I would have never caught that non-clearing before screen update/overwrite bug. I can finally sleep a little easier knowing what the heck was going on with that! I hope you will be available for bug testing games because you will be the first on my list I call when I need a game tester! Nothing gets past the eagle eyes of the Admiral!

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh »

Garth's Equipment Shop wrote:I hope you will be available for bug testing games because you will be the first on my list I call when I need a game tester! Nothing gets past the eagle eyes of the Admiral!
Thank you. I pride myself on attention to detail, and sheer perfectionism.
- A:A:

Admiral Ackguh
Posts: 137
Joined: Sat Nov 03, 2012 11:26 am
Location: Canada
Contact:

Post by Admiral Ackguh »

Issues so far:

1) Definite bug: ADVTIME for 60 or more minutes.

2) Possible bug: TITLE, INTRO, HOURLY event macros not firing.

3) Possible bug: T variable handling in Mega Patches.

4) Not a bug: SAYVAL behaviour. It would be nice, however, if there was a new command (or DRAW patch) that painted a blank 8x8 pixel square at the given text coordinates.
- A:A:

Post Reply