This is what tifreak has as his "matrix event checker" on his tutorial:


Code:
prgmYCH:


:ClrHome
:If [A](C,D)=3:Then
:If L=1 and M=1:Then
:ClrHome
:Disp "THERE IS NO","VILLAGE
:Pause
:C-1→C
:prgmYLVL
:End:End
:If [A](C,D)=4:Then
:If L=2 and M=2:Then
:Disp "THERE IS NO","TOWER
:Pause
:prgmYLVL
:D-1→D
:End:End


Now, since I will have universal events for the different map symbols (i.e. a "B" will always stand for a bonus supply stash that fully stocks all of your ammo and health), I took from the movement program the sub() command and ended up with the following:


Code:
:If sub(Str4,T,1)="B":Then
:ClrDraw
:Text(15,10,Str2," FOUND A BONUS SUPPLY STASH!
:Text(25,10,Str2," STOCKED UP ON AMMO.
:Pause
:ClrDraw
://increase ammo code will go here
://increase ammo code will go here
://increase ammo code will go here
://increase ammo code will go here
://increase ammo code will go here
://increase ammo code will go here
://increase ammo code will go here
://increase ammo code will go here
:End
:If sub(Str4,T,1)="P":Then
:ClrDraw
:Text(15,10,"THIS IS A SIDE
:Text(25,10,"PORTAL THAT TAKES YOU
:Text(35,10,"BACK TO THE START (JUST
:Text(45,10,"FOR THE FUN OF IT)
:Pause
:ClrDraw
:4→Q
:2→P
:1→L
:2→M
:prgmZLVL
:End
:If sub(Str4,T,1)="G":Then
:Y+1→Y
:"?→L  //not sure what the starting positions will be on the next level
:"?→M  //not sure what the starting positions will be on the next level
:"?→Q  //not sure what the starting positions will be on the next level
:"?→P  //not sure what the starting positions will be on the next level
:End


At one point, it worked, but only when you stepped OFF of the event spot. Now it doesn't do anything.
1) Is T guaranteed to not be modified inside those Then/End statements?
2) I assume Str2 is your player name?
3) Are you positive that T has the correct/expected value?
4) Where exactly does this code get triggered from? Your main movement loop? Before or after the value of T gets adjusted from GetKey?
KermMartian wrote:
1) Is T guaranteed to not be modified inside those Then/End statements?
2) I assume Str2 is your player name?
3) Are you positive that T has the correct/expected value?
4) Where exactly does this code get triggered from? Your main movement loop? Before or after the value of T gets adjusted from GetKey?


1) T is only modified in prgmZGA, where it is the number of characters into Str4 that the player is. (Sorry - poor syntax Sad )

2) Yes, Str2 is the player's name (Str1 is the weapon name and Str3 is the enemy name).

3) I'm fairly certain - the only time it gets modified is after the player has moved, which would then place T in the same spot as the varying letter (which should trigger the event).

4) This code is triggered after every move command (so from the main movement loop). T is only adjusted by getKey in that the direction the player goes determines whether T adds or subtracts 1/15/16/112.
Beta7 wrote:
4) This code is triggered after every move command (so from the main movement loop). T is only adjusted by getKey in that the direction the player goes determines whether T adds or subtracts 1/15/16/112.
So you mean that after it changes the value of T (your position on the map, I take it) it will then go through this check?
Yes - and if the spot in the string that T points to is "B", "P", or "G", then it is supposed to trigger these events.
Sorry there bud, but it sure as heck sounds like it's doing these checks before it modifies T. Could you provide more code, or is all of the code in question already posted on this topic?
Movement Program:


Code:
prgmZGA

:While 1
:¦ Output(Q,P,"θ
:¦ getKey→K
:¦ If K=23:Then
:¦ ¦ prgmHALOMENU
:¦ ¦ prgmZLVL
:¦ ¦ prgmZGA
:¦ End
:¦ If K=24:Then
:¦ ¦ If P=1:Then
:¦ ¦ ¦ L-1→L:T+15→T
:¦ ¦ ¦ P+15→P
:¦ ¦ ¦ prgmZCH
:¦ ¦ ¦ prgmZLVL
:¦ ¦ ¦ prgmHALOENCO
:¦ ¦ End
:¦ ¦ If P>1:Then
:¦ ¦ ¦ If sub(Str4,T-1,1)≠"X":Then
:¦ ¦ ¦ ¦ prgmZCH
:¦ ¦ ¦ ¦ Output(Q,P," "
:¦ ¦ ¦ ¦ P-1→P:T-1→T
:¦ ¦ ¦ ¦ prgmHALOENCO
:¦ ¦ ¦ End:End:End
:¦ If K=25:Then
:¦ ¦ If Q=1:Then
:¦ ¦ ¦ M-1→M:T+112→T
:¦ ¦ ¦ Q+7→Q
:¦ ¦ ¦ prgmZLVL
:¦ ¦ ¦ prgmHALOENCO
:¦ ¦ End
:¦ ¦ If Q>1:Then
:¦ ¦ ¦ If sub(Str4,T-16,1)≠"X":Then
:¦ ¦ ¦ ¦ prgmZCH
:¦ ¦ ¦ ¦ Output(Q,P," "
:¦ ¦ ¦ ¦ Q-1→Q:T-16→T
:¦ ¦ ¦ ¦ prgmHALOENCO
:¦ ¦ ¦ End:End:End
:¦ If K=26:Then
:¦ ¦ If P=16:Then
:¦ ¦ ¦ L+1→L:T-15→T
:¦ ¦ ¦ P-15→P
:¦ ¦ ¦ prgmZLVL
:¦ ¦ ¦ prgmHALOENCO
:¦ ¦ End
:¦ ¦ If P<16:Then
:¦ ¦ ¦ If sub(Str4,T+1,1)≠"X":Then
:¦ ¦ ¦ ¦ prgmZCH
:¦ ¦ ¦ ¦ Output(Q,P," "
:¦ ¦ ¦ ¦ P+1→P:T+1→T
:¦ ¦ ¦ ¦ prgmHALOENCO
:¦ ¦ ¦ End:End:End
:¦ If K=34:Then
:¦ ¦ If Q=8:Then
:¦ ¦ ¦ M+1→M:T-112→T
:¦ ¦ ¦ Q-7→Q
:¦ ¦ ¦ prgmZLVL
:¦ ¦ ¦ prgmHALOENCO
:¦ ¦ End
:¦ ¦ If Q<8:Then
:¦ ¦ ¦ If sub(Str4,T+16,1)≠"X":Then
:¦ ¦ ¦ ¦ prgmZCH
:¦ ¦ ¦ ¦ Output(Q,P," "
:¦ ¦ ¦ ¦ Q+1→Q:T+16→T
:¦ ¦ ¦ ¦ prgmHALOENCO
:¦ ¦ ¦ End:End:End
:End


Level Load Program:


Code:
prgmZLVL

:If Y=1:Then
:¦ If L=1 and M=2:"XXXXX XXBXXXXXXXX   X  XXX     XX  XX   XX  XX XX      X X X   XX    XX  X  X  XX X   X   XX   XX   X   X      XXXXXXXXXXXXXXXXX→Str4
:¦ If L=1 and M=1:"    XXX  XXXXXXX   X   XX         X    X   XXXXX X X            X   X XXXXX  XXXX     X    XX   X XXXXX XX    X X     X  XXXXXXX→Str4
:¦ If L=2 and M=1:"XXXXXX XXXXXXXXXX     X      X  XXX X   XX X  X    X XXXX XXX  XX            X  XXXXXXXXX XX  XX   X    X X X   XX X XX X X  XXX→Str4
:¦ If L=3 and M=1:"XXXXX  XXX X XXX     XX   XXXX X X   X    X    XX  X X  X  X X X  X   X X XP X XXX   XX X  XXX X  X     X      XX XXXXXXXXXXXXXX→Str4
:¦ If L=2 and M=2:"X  X XX X X  XXXX X   X   XX X  X X   XXXXX  X  X  XX  X    XXXXXX X  X  XX     X  X   X XXXXXXXX X    X   X    X  XX  X XXX XXX→Str4
:¦ If L=3 and M=2:"X XXXXXXXXXXXXXX  X X   XXX    X  X   X   X X X X   XXXXX   X  X  X   X   XX  X XXXXX X XX     X    X   X  XXXX XXX XXXXX XXXXXX→Str4
:¦ If L=1 and M=3:"XXXXXXXXXXXXXXXX X              X   XX XXX  XX   X X  X   XX  XXX  XX   X        X       XXXXXXXX  X X X         XX X X XXXXXXXX→Str4
:¦ If L=2 and M=3:"X  XX  X XXX XXX  X  X  XHX  X   X    X X X XX XX   X     X  X    XX   XXX X  XXXX  XXX   X X  X        X      XXXXXXXXXXXXXXXXX→Str4
:¦ If L=3 and M=3:"XXX XXXXXXXXXXXX    X    X   XGXXXXX X X X X X X     X X X X X XXXXX X X X X X XX      X   X   XX   X  XX   X XXXXXX XX  XXX XX →Str4
:End
:  //more "Y=" will go here, which are the different sets of 9 maps each
:ClrHome
:Output(1,1,Str4


And then the event checker is posted above (prgmZCH).
Could you tell me what the variables P,L,M,Y, & Q are?
MufinMcFlufin wrote:
Sorry there bud, but it sure as heck sounds like it's doing these checks before it modifies T. Could you provide more code, or is all of the code in question already posted on this topic?
That's what it sounds like to me too. I didn't get to look over that code above, but I'll edit (or post) once I get to do so.
MufinMcFlufin wrote:
Could you tell me what the variables P,L,M,Y, & Q are?


Q is Y-coord in the map
P is X-coord in the map

Output(Q,P,"θ
-----------------------
L is X-coord between maps (which column)
M is Y-coord between maps (which row)

2-3-4
1-5-6
7-8-9

Each number is an 8x16 map; map 3 is L=2 (second column), M=1 (first row)
-------------------------
Y is what level the player is on (currently only 1 '9-map' level, but there will be more)

--------------------------(Below is a separate post combined
--------------------------into one so I don't double post >.>)

MufinMcFlufin wrote:
Sorry there bud, but it sure as heck sounds like it's doing these checks before it modifies T.


This is what I thought as well - but it can't be, because after I move off of the event spot, it would check T before modifying it, and since T would then be the location of the event, it would trigger. But it doesn't (nothing triggers anymore).

Oh, and I'm having slight problems with T being used in the movement program itself (as of now, if I save the game, it saves the L/M/Q/P/Y/T info, but when I load the game, the map is all messed up like it was before); since I believe they might be related, I'll try to track down all instances of T and see how they relate to each other.
I thought that T was the position on the map of your character. Could you let me know what T is, if Q and P are that?
Sorry - T is your position IN THE STRING (and no, Kerm, that isn't shouting, it's accenting a short part of 1 sentence that is quite important - without using BBCode Wink ).

After messing around with the programs a little more, I've gotten the event checker to work. But now I have the same problem after the event runs as I do when I load a saved game - the Q, P, and T variables are correct, but when you go off the side to another8x16 map, it just loops around to the opposite side of the screen. But this only happens after events/loading a game, NOT for a new game.
There has to be an inconsistency with loading a previous game against starting a new game. I'd say check the code that sets the variables in a loaded game, in a new game, while saving a game, and while loading a game.
I did, and the list slots that I assigned Q/P/T to upon saving are correctly lined up for the loading process.
Beta7 wrote:
Sorry - T is your position IN THE STRING (and no, Kerm, that isn't shouting, it's accenting a short part of 1 sentence that is quite important - without using BBCode Wink ).

After messing around with the programs a little more, I've gotten the event checker to work. But now I have the same problem after the event runs as I do when I load a saved game - the Q, P, and T variables are correct, but when you go off the side to another8x16 map, it just loops around to the opposite side of the screen. But this only happens after events/loading a game, NOT for a new game.
So it doesn't actually go to the other map, it just ends up on the other side of the screen with the same map? Can you check T/Q/P when you're at the left edge, and check the map index before and after the edge switch?
Y variable
Acts funny on the graph screen
Try another one
Weregoose wrote:
Y variable
Acts funny on the graph screen
Try another one


I'm sorry - I don't understand what you mean. "P" (the Y variable) is acting up?
"Feature" of ClrDraw:
Uses the dependent var
Tends to wipe it clean
*Deleted old post because I just wanted to make a new one w/o double-posting. Wink

Weregoose, that was exactly it - before the load, Y was coming up as 1, but after the load (after exiting the game with a "DelVar all variables") it was 0. I changed Y to S and it works great now.

I've changed a couple other little bits as well, and will send the new zip to Archives (and ask Kerm to admit it). It will be called "Haloesque" once I submit it.
Weregoose, I highly approve of you writing your posts in Haiku form. Please continue to do so. Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 3 of 5
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot 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

 

Advertisement