プレイ日記
Jacob KulcakKid4
How do I set a minimum for a random number?
1そうだね
プレイ済み
返信[1]
親投稿
Stewart segludian1
Just add your minimum value to the random number. Of course you would have to adjust the maximum passed to the rnd() function to compensate. x% = 5 + RND(10) would set x% to a number between 5 and 14 for example.
2そうだね
プレイ済み
返信[2]
親投稿
Hanzo rzsense
The following formula gives you a random number within the range of MN to MX (MN<MX). MN+RND(MX-MN+1)
0そうだね
未プレイ
返信[3]
親投稿
Jacob KulcakKid4
Thank Stewart and Hanzo, it works now. For some reason, when I make the sprite bigger, it acts as if the sprite is at the top left corner of the bigger sprite. Do you know why?
0そうだね
プレイ済み
返信[4]
親投稿
Stewart segludian1
I think you have to use sphome to to change the location a sprite rotates around. However from your description, it may be that you didn't set the flag in spcol that says to take scaling into account. Hard to say without code or a screenshot.
1そうだね
プレイ済み
返信[5]
親投稿
Jacob KulcakKid4
Ok, I'll get a picture. I'm thinking it's the spcol thing.
0そうだね
プレイ済み
返信[6]
親投稿
Jacob KulcakKid4
So when I make the sprite bigger, It's Spcollision point is the top-left corner. You can see from the picture that the spcollision isn't working on the top middle.
0そうだね
プレイ済み
返信[7]
親投稿
Jacob KulcakKid4
And when it's normal size, It can't go outside of the screen. But when it's bigger, Its top-left corner is the point it stops at.
0そうだね
プレイ済み
返信[8]
親投稿
Jacob KulcakKid4
Ok, I fixed the spcol problem, but I'm still having trouble with the walls.
0そうだね
プレイ済み
返信[9]
親投稿
Jacob KulcakKid4
If their a command that allows something to happen if a sprite hits a certain part of the map?
0そうだね
プレイ済み
返信[10]
親投稿
Hanzo rzsense
BGGET(L,X,Y,1) gives you BG part number under the sprite. L:BG layer number(0-3) X,Y:coordinates of the sprite
0そうだね
未プレイ
返信[11]
親投稿
Jacob KulcakKid4
What is the 1 for?
0そうだね
プレイ済み
返信[12]
親投稿
Jacob KulcakKid4
It's not working for me. The x,y coordinates are the coordinates for the tile I want it to happen on.
0そうだね
プレイ済み
返信[13]
親投稿
Hanzo rzsense
You should correct at least two things as follows. #1:Write variables of your sprite coordinates for second and third arguments of BGGET. #2:Return value of BGGET is certain character number of BG tile. Every BG tile has its own character number. You can confirm it with smile tool. I guess you should write line 128 as follows. IF BGGET(0,X,Y,1)==(the character number) THEN...
0そうだね
未プレイ
返信[14]
親投稿
Jacob KulcakKid4
Ok, I'm trying to see if i'm understanding this correctly. IF BGGET (0/layer,X,Y/the sprite's x and y positions,1/so that it registers the tiles in pixel form? something like that)==(24)/the tile I want it to do something on THEN... If that's correct, the only problem i have is figuring out which tile it is.
0そうだね
プレイ済み
返信[15]
親投稿
Jacob KulcakKid4
I don't know how to use the smile tool to find the tile-number. On my the comment where it shows the game i'm making, the top door is the place i'm trying to use. it's position is 12,1(I'm pretty sure)
0そうだね
プレイ済み
返信[16]
親投稿
Hanzo rzsense
Could you see grp5 with smile tool? If you find U and V coordinates of the BG tile on grp5, you will get the tile-number with the following formula. N=(V DIV 16)*32+(U DIV 16) For example, (U,V) of closed door tile are (64,432), and 868 is given by the formula.
0そうだね
未プレイ
返信[17]
親投稿
Jacob KulcakKid4
It finally works! Thanks for your patience with me. But to go through the door, the sprite has to be in the exact center. Is there a way to make the sensing point wider?
0そうだね
プレイ済み
返信[18]
親投稿
Jacob KulcakKid4
I mean the exact center of the door tile.
0そうだね
プレイ済み
返信[19]
親投稿
Hanzo rzsense
Do BGGET only when both X and Y are multiples of 16 as follows. IF(X MOD 16)==0 && (Y MOD 16)==0 THEN IF BGGET... ENDIF
0そうだね
未プレイ
返信[20]
親投稿
Jacob KulcakKid4
What is the MOD for? This is my last post. For some reason I didn't get any new posts today.
0そうだね
プレイ済み
返信[21]
親投稿
Hanzo rzsense
MOD stands for modulo. A MOD B yields the remainder from the division of A by B.
0そうだね
未プレイ
返信[22]
親投稿
Jacob KulcakKid4
Ok, when I do that, it dosen't do anything when the sprite hits the door. (something happened with my posts, so now i have 17 left. I think it's because of slow internet)
0そうだね
プレイ済み
返信[23]
親投稿
Jacob KulcakKid4
Here's the picture. (if it helps)
0そうだね
プレイ済み
返信[24]
親投稿
Hanzo rzsense
Do you use SPHOME? If so, tell me arguments of SPHOME.
0そうだね
未プレイ
返信[25]
親投稿
Jacob KulcakKid4
No, I don't use SPHOME.
0そうだね
プレイ済み
返信[26]
親投稿
Hanzo rzsense
Could you try to replace line 128 with the following codes? IF((X MOD 16)>=12 || (X MOD 16)<4)&&((Y MOD 16)>=12 || (Y MOD 16)<4)THEN
0そうだね
未プレイ
返信[27]
親投稿
Jacob KulcakKid4
When I put this down, it says syntax error.
0そうだね
プレイ済み
返信[28]
親投稿
Hanzo rzsense
I'm sorry for wasting your remaining posts for today. I guess the vertical bars you typed are wrong. Correct bar character is yielded by the key to A's immediate left on the keyboard.
1そうだね
未プレイ
返信[29]
親投稿
Jacob KulcakKid4
No, I'm pretty sure i wasted your posts today. Helping me with stuff that you already know. So I fixed that bar, but now its acting as if that command isn't there. Sorry for making you use all your posts on this, by the way. I'll make a new play journal sometime later, most likely asking a question.
0そうだね
プレイ済み
返信[30]
親投稿
Hanzo rzsense
Could you modify line 129 as follows? IF BGGET(0,X+8,Y+8,1)==869 THEN...
1そうだね
未プレイ
返信[31]
親投稿
Jacob KulcakKid4
Thanks, it works now.
1そうだね
プレイ済み
返信[32]
親投稿
Jacob KulcakKid4
(sorry for not asking until now, I've been busy. But anyways) could you tell me how to put something like IF BUTTON==#UP THEN BGGET... I already tried that, but it didn't work. The reason I need this, is because when you come back to the main room, you go back through the door again.
0そうだね
プレイ済み
返信[33]
親投稿
Jacob KulcakKid4
Also, what are the || lines for? (hopefully you remember what I'm talking about)
0そうだね
プレイ済み
返信[34]
親投稿
Hanzo rzsense
I guess "IF BUTTON(2)==#UP THEN..." is correct. "||" is a kind of logical operator. A || B yields TRUE when either A or B are TRUE, and it yields FALSE when both A and B are FALSE.
0そうだね
未プレイ
返信[35]
親投稿
Jacob KulcakKid4
Ok, when I put SPHOME just before spset, an error occurs, so I took that out. Hopefully changing to the circle-pad didn't mess it up. I can change it back to the d-pad if needed. And last, where would I put the IF BUTTON(2) == #UP THEN?
0そうだね
プレイ済み
返信[36]
親投稿
Jacob KulcakKid4
Fixed the x+8,y+8 thing. It works really well now.
0そうだね
プレイ済み
返信[37]
親投稿
Hanzo rzsense
Not "just before" but "just after". SPSET should be followed by any other sprite related commands (of course SPHOME is one of them).
0そうだね
未プレイ
返信[38]
親投稿
Hanzo rzsense
What's wrong about circle-pad? Unfortunately it is hard for me to give you any suggestion about the position of BUTTON(2) because I haven't grasp the overall structure of your program.
0そうだね
未プレイ
返信[39]
親投稿
Jacob KulcakKid4
There's nothing wrong with the circle-pad. I just thought you would have to change up the X DEF 16 stuff because of it. I could give you a key for the game if you want. Just so you know, if you look at the code, it's messy.
0そうだね
プレイ済み
返信[40]
親投稿
Hanzo rzsense
OK could you upload your program on the cloud server temporarily and give me a key? I'll try to analyze and modify it.
0そうだね
未プレイ
返信[41]
親投稿
Jacob KulcakKid4
Ok, let me know if it doesn't work. And just so you know, it will probably be messy and maybe a little confusing.
0そうだね
プレイ済み
返信[42]
親投稿
Jacob KulcakKid4
And thanks in advance.
0そうだね
プレイ済み
返信[43]
親投稿
Hanzo rzsense
I've downloaded your program and confirmed it works. I'm sorry that I'll make you wait.
0そうだね
未プレイ
返信[44]
親投稿
Jacob KulcakKid4
It's fine. I'm glad you're putting in your time to help me.
0そうだね
プレイ済み
返信[45]
親投稿
Hanzo rzsense
I've modified your program and uploaded on the cloud server. Could you download 93ANV4ZP and refer to SPRITES?
0そうだね
未プレイ
返信[46]
親投稿
Jacob KulcakKid4
Thanks! This helps a lot. My only questions are fairly simple. What are "!" marks for in the buttons area? And do the "&&" signs do the same thing as the "||" lines? I'll be sure to put you in the credits.
0そうだね
プレイ済み
返信[47]
親投稿
Jacob KulcakKid4
Unfortunately, I'm going to be busy today, so I'll have wait until tomorrow to work on it.
0そうだね
プレイ済み
返信[48]
親投稿
Hanzo rzsense
"!=" stands for "not equal". "(B AND #RIGHT)!=0" is almost same as "B==#RIGHT", but when you press RIGHT on D-pad and another button (e.g. A button) at the same time, the former can detect RIGHT press but the latter cannot.
0そうだね
未プレイ
返信[49]
親投稿
Hanzo rzsense
Both "&&" and "||" are logical operators. The difference of them is as follows. (TRUE && TRUE)==TRUE (TRUE && FALSE)==FALSE (FALSE && TRUE)==FALSE (FALSE && FALSE)==FALSE (TRUE || TRUE)==TRUE (TRUE || FALSE)==TRUE (FALSE || TRUE)==TRUE (FALSE || FALSE)==FALSE
0そうだね
未プレイ
返信[50]
親投稿
Jacob KulcakKid4
Ok, thanks for all your help. I'll go to the sphome post that I made and ask the other people about it.
0そうだね
プレイ済み
返信[51]
親投稿
Hanzo rzsense
I believe SPHOME issue has been also fixed by my modification.
0そうだね
未プレイ
返信[52]
親投稿
Jacob KulcakKid4
Well, it's doing pretty much the same thing as before. (the picture is from your modification)
0そうだね
プレイ済み
返信[53]
親投稿
Jacob KulcakKid4
Do you think putting "SPHOME 1,8*SX,8*SY" would work? SX and SY are the mutiplication numbers for spscale.
0そうだね
プレイ済み
返信[54]
親投稿
Jacob KulcakKid4
The SX and SY thing didn't work, so I took it out.
0そうだね
プレイ済み
返信[55]
親投稿
Hanzo rzsense
I'm sorry I misunderstood the boundary issue. We should shift all boundaries in proportion to the arguments of SPHOME as follows. (before correction) IF X<0 THEN X=0 IF X>385 THEN X=385 IF Y<18 THEN Y=18 IF Y>225 THEN Y=225 (after correction) IF X<8 THEN X=8 IF X>393 THEN X=393 IF Y<26 THEN Y=26 IF Y>233 THEN Y=233
0そうだね
未プレイ
返信[56]
親投稿
Hanzo rzsense
Same as before, we should shift initial location of coins as follows. (before correction) SPOFS N,RND(383),16+RND(208) (after correction) SPOFS N,8+RND(383),24+RND(208) Replace N with 2 to 5.
0そうだね
未プレイ
返信[57]
親投稿
Hanzo rzsense
You seem to try to shrink boundaries in proportion to player size to avoid protrusion of enlarged player sprite. However, I guess this challenge will yield the new issue, the collision detection between player and doors(stairs).
0そうだね
未プレイ
返信[58]
親投稿
Jacob KulcakKid4
Ok, I'll do that. I'll just set the grown sprite boundaries as something to fix in an "update" of the game. It's really slowing my progress of the game, so I'll work on it later.
0そうだね
プレイ済み
返信[59]
親投稿
Jacob KulcakKid4
And again, thanks for all your help.
0そうだね
プレイ済み