FAQ Search Memberlist Usergroups
Jolt Country Forum Index
Register Profile Log in to check your private messages Log in
Log in Log in

Step macro issues

 
Post new topic   Reply to topic    Jolt Country Forum Index -> Adventure Creation Kit
View previous topic :: View next topic  
Author Message
msallen
Guest





PostPosted: Sat Feb 21, 2009 11:26 am    Post subject: Step macro issues Reply with quote

Hi all. First, I came across ACK while I was reliving a little of my youth with ACS on an emulator. ACK is giving me that warm nostalgia I was looking for without all the aggravation of emulation or the horrible ACS interface. THANKS!

I am having a little trouble with macros and items that I wanted to run by y'all. I may be doing something wrong. I may also just be dissatisfied with some of the implementation.

What I would like to do is create a consumable object that provide a short, temporary buff. Here is my code for one that meets the following requirements:

1. Applies a 20 pt bonus to weapon skill for 10 turns
2. Only one buff can be active at a time
3. Applies buff on 'u'se and consumes an object if successful
4. If not successful, does not consume the object

Object 39: usage requires nothing, does not disappear, execute macro on use:
1: IF Z2 = 0 THEN 4 (allow use *only* if not buffed)
2: SMSG 40 (failure message)
3: STOP
4: SET Z2 = 10 (number of turns active)
5: SET WSK = WSK + 20 (buff)
6: SET INV[39] = INV[39] - 1 (consume if successful)
7: SMSG 42 (usage message)

Step macro:
1: IF Z2 = 0 THEN 6 (its not active, so ignore it)
2: SET Z2 = Z2 - 1 (decrement the time)
3: IF Z2 > 0 THEN 6 (still time left on the buff)
4: SET WSK = WSK - 20 (remove the buff)
5: SMSG 41 (expiration message)
6:

I have 2 problems:

1. Using the item takes 2 turns. I can't figure out why this happens. If, say, I use it in melee the monster will get 2 hits on me when I would only expect 1.

2. Every action decrements the counter even if it doesn't consume a turn of time. For instance, if I check my inventory 8 times, the buff expires.

I don't know if 1 is a bug or user error. 2 may not be a bug (I don't know if there are macros that need to be executed on every screen refresh). If its not a bug, it sure would be nice to have a macro that is executed with every action that consumes a game turn.
Back to top
msa



Joined: 21 Feb 2009
Posts: 3

PostPosted: Sat Feb 21, 2009 11:44 am    Post subject: Reply with quote

Quick update: I tried a activate-on-use item that doesn't use a macro in combat and it also took two turns. I guess that is just normal, so ignore problem 1.

Although it would be nice if we could specify how many turns using an item takes. Healing potions, for example, need to be a lot stronger to justify letting all attackers get 2 moves.
Back to top
View user's profile Send private message
Chris H



Joined: 02 Dec 2007
Posts: 272
Location: California, USA

PostPosted: Sun Feb 22, 2009 6:57 pm    Post subject: Reply with quote

Hi,

Those are both bugs, and on my list to address. Issue #2 is because the step macro is firing even during a map refresh (it should only fire on honest-to-goodness actions of the player) ... there are a couple of people waiting for me to fix that one. :) Issue #1 is somewhat related, I'll have to dig into it a little further to find the exact cause. Keep an eye on the ACK updates thread, I'm hoping to patch these issues in a week or two, when I get time to dig into the code again.

And, welcome! I'm glad you found your way here!
Back to top
View user's profile Send private message
msa



Joined: 21 Feb 2009
Posts: 3

PostPosted: Mon Feb 23, 2009 10:27 am    Post subject: Reply with quote

Wonderful!

ACK has some pretty weird, and occasionally non-deterministic, behavior. Using items appears to occasionally take 3 turns, for instance.

I get the impression that you are working with a code base in some sort of savage, archaic tongue like QBasic or TurboPascal. In which case, truly, I wish you the best of luck :)

I get new questions from time to time. Should I just post them in this thread or make a new one when its clear I can't fix them. I'm wrestling with mapchk and mapset problems right now, and when I can get a clear description of my problem (assuming its not between keyboard and chair) I will post it wherever you like.
Back to top
View user's profile Send private message
Chris H



Joined: 02 Dec 2007
Posts: 272
Location: California, USA

PostPosted: Mon Feb 23, 2009 11:11 am    Post subject: Reply with quote

Yes, ACK is written in Turbo Pascal -- it's actually a pretty old program itself, mostly done in the early 90s but revived lately just for the sake of fixing "just a couple more bugs" or adding "just a couple more features."

Anyway, feel free to post about what you're trying to do even before you determine exactly what's going on... someone might be able to hazard a guess and/or suggest what might be an easier way of tackling the problem.

As for using items taking three turns -- that sounds like a bug (and the same one we were talking about earlier) but I'm not sure how it manages three -- I'd like to hear about how that happened so I can try to reproduce it.

It's a known bug right now by the way that step macros that use MAPSET are acting funny right now (MAPSET triggers another step macro run), that should get fixed in the next patch. Is that part of what you're fighting with?
Back to top
View user's profile Send private message
msa



Joined: 21 Feb 2009
Posts: 3

PostPosted: Mon Feb 23, 2009 3:47 pm    Post subject: Reply with quote

No, my mapset/chk problems have nothing to do with steps this time. I am trying to add random herb patches to one of my wilderness maps. The herb patches are a space that does the following when you step on them:

1. Add a random herb to the players inventory
2. Decrement a counter for the number of herb patches
3. Replace themselves with a patch of grass

When you enter the worldmap region, the game runs a macro that does the following:

1. If the number of herb patches is less than 10
1. Find x,y coordinates that contain a patch of grass
2. Replace it with an herb patch
3. Increment the counter for the number of patches
4. Goto 1

The problem is that frequently less than 10 herb patches are placed. And after each round of harvesting, less herb patches spawn in the area. Here are my experiences:

1. In a 16x16 world map, with the player entering in the middle, no herbss spawn
2. In a 48x32 world map, with the player entering from the upper left, most (but rarely all) of the herbs will spawn and every time you leave and reenter less patches will spawn than were picked
3. In scenario 2, but with herbs only spawning in the bottom left 16x16 quadrant, all of them will spawn, and all will be replaced upon reentry

Here is the macro code for the respawn:

1: IF Y2 = 0 THEN 14 (no more herbs to place)
2:
3: SET F = RND(13) + 2 (X)
4: SET G = RND(13) + 2 (Y)
5: MAPCHK F G E
6: IF E = 43 THEN 10 (found a patch of grass)
7:
8: GOTO 3
9:
10: MAPSET F G 42 (place patch of herbs)
11: SET Y2 = Y2 - 1
12: IF Y2 > 0 THEN 3
13:
14: STOP
Back to top
View user's profile Send private message
Chris H



Joined: 02 Dec 2007
Posts: 272
Location: California, USA

PostPosted: Mon Mar 02, 2009 12:39 pm    Post subject: Reply with quote

There's a 3.251 patch now which should fix the first issue you mentioned -- the last issue you described, though, sounds a little more complicated. Can you bundle up whatever test adventure you're using for this, and send it to me so I can try to reproduce the problem?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Jolt Country Forum Index -> Adventure Creation Kit All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Theme by Kage Musha - RPG Garden

Copyrights and trademarks are all of the belonging company. No copyright Infringement intended