Mystic Software Forums
Miscellaneous => Archives => Archive => Topic started by: DarkElite on July 02, 2004, 12:05:17 AM
-
I've been working on my menu system, but I've come to a problem... I'm trying to make it so every character has their own item inventory, and so, I've done this:
#If (kail!=1)
{
#p!=p!+1
#person[p!]$=KAIL
}
Now, person1$=KAIL, and so, because this is true now (with kail!=1 of course), I'm making it so the player can selecton one of the charater's iventory. The problem now, is that I'm also trying to show their inventory when they are highlighted (but not selected), and so, I must access the item depending on the player. So I have set it up like this:
#char$=person[p!]$ *This makes the equation simplify. When pressed left or right, it changes p!.
#iy!=35.7
#FontSize(8)
#ColorRGB(255,255,255)
#If (potion[char$]!>=1)
{
#i!=i!+1
#itemload[i!]$="#Load_Potion()"
#itemuse[i!]$="#Use_Potion()"
#iy!=iy!+1.25
#Text(29,iy!,"Potion <potion[char$]!>")
#Titem!=Titem!+1
}
But, instead of being able to make potionKAIL! the variable, it seems to be unable to do this (with potionKail! equal to something). This would also change depending on which character it seleced, like potionFIONA!.
So, does anyone know what I am doing wrong in this? :unsure:
-
#person[p!]$=KAIL should be #person[p!]$="KAIL"
and the variable you use would be potion["KAIL"]!, not potionKAIL!
-
well, thats the thing....i had tried that too....but it wouldn't work....
-
But, instead of being able to make potionKAIL! the variable, it seems to be unable to do this (with potionKail! equal to something). This would also change depending on which character it seleced, like potionFIONA!.
Could you expand on this description a bit more?
What you have looks correct. Are you saying potion[char$]! isn't the value it should be? That would suggest that char$ isn't correct, which means person[p!]$ isn't correct, which suggests the value of p! may be off (could be a simple off-by-one error, which I do all the time, heh...) In your program, check the values of these variables with #mwins when testing to see if they are what you expect them to be.
-
Cant you just set up separate arrays for each of the characters:
#charitem[x!]$="blah.itm"
...
and make methods that edit these arrays and tidy them up ie move items to the higher position if a higher slot opens up, etc.
more later, brain needs break after accessing old HDD Wink
-
heh...never mind, what asimir said was a correct way of doing it...but im not sure why the other way was wrong....it seemed perfectly elegable...
-
I know RPG Code can be such a pain. :angry: I just wish it would :unsure: ....not....be......a pain.... :blink:
-
lol, yeah...
i have a question mainly for Xorlak (but any one can answer...) im using some large images (not in file size, but actual X and Y size) and it puts it on the feild slowly...is there a way to speed it up?
-
I would imagine file size would be the main issue. How large is an example image, in pixels and file size?
-
i think that its 600x300......but something along those lines...
-
608x352 is the default 19x11 board size in pixels, and should draw at least near-instantly to the screen, even in TK2 on a 100MHz PC.
-
If you're using #setimage, you may want to consider resizing the image to full screen and use #bitmap, which tends to be faster for large images. Also, I found that BMPs, though quite large, actually draw to the screen a little faster than GIFs.
-
i cant, because the large image im using requires for parts of it to be set transparent......any other ways?... Wink
-
I wonder if that's what's causing it then, #SetImageTransparent.
-
hmm...posibly...
this is getting happy......now there's something else....when ever i have a selection that only allows the user to press left, right, confirm, or back butons....it wont let the cursor moves....also, if they press something besides the allowed buttons, it will screw up.....(i have something that check if its not any of the buttons used to...)
-
ok...i got rid of the problem with the moving the cursor left-right.....but there is still something wrong with it when you press a wrong button.....i just tested it, and when i pressed it, it closed the program.... Wink
-
"this is getting happy"
That better not mean what I think...
-
OK seriously KSNiloc. Your taking things far too seriously. One time I was looking at a catalog and a friend was explaining something to me in it and I said "That's happy" and someone came up to me and ripped into me saying "Really? Really John? It's happy? It's homosexual? Is it really?" etc, etc, etc. I wasn't trying to imply that homosexuals were stupid, or even reffering to anything homosexual; but the guy got pissed off because he took offense to something that was never even said offensively.
If he's not using the term in a harmful manner, and especially if he's not even using the term, then keep your comments to yourself. The only reason the word happy is taken offensively is because your choosing to take offense to it.
BTW, the only reason it even says happy is because I added a word filter to change the word happy to happy. Why? Because that is it's true meaning. If I had instead changed it to "homosexual", I would imagine that the sentance "This is getting homosexual" would be quite a bit more offending than "This is getting happy".
-
umm...well, i originally put in happy ( if that changes it to happy again....i put g-a-y Laughing )
now i have a new problem.....im need to put in two variables into a single variable....example:
["potion"][char$]!=2
-
OK seriously KSNiloc. Your taking things far too seriously. One time I was looking at a catalog and a friend was explaining something to me in it and I said "That's happy" and someone came up to me and ripped into me saying "Really? Really John? It's happy? It's homosexual? Is it really?" etc, etc, etc. I wasn't trying to imply that homosexuals were stupid, or even reffering to anything homosexual; but the guy got pissed off because he took offense to something that was never even said offensively.
If he's not using the term in a harmful manner, and especially if he's not even using the term, then keep your comments to yourself. The only reason the word happy is taken offensively is because your choosing to take offense to it.
BTW, the only reason it even says happy is because I added a word filter to change the word happy to happy. Why? Because that is it's true meaning. If I had instead changed it to "homosexual", I would imagine that the sentance "This is getting homosexual" would be quite a bit more offending than "This is getting happy".
Yeah, KSNiloc dose seem to take thing abit to seriously. Now, not that there is a problom with this, and I don't mean offenice in this, but I kinda think that KSNiloc, is well, shall we say happy...
Now seriously I don't mean any offenice of that, I saying what I think here...
-
OK seriously KSNiloc. Your taking things far too seriously.
So do you want him to be serious or not? Razz
-
but I kinda think that KSNiloc, is well, shall we say happy...
Since you don't visit the TKZ forums much, if at all, I wouldn't expect you to know that he is in fact a homosexual. I don't have a problem with that at all, I just have a problem with people trying to make it look like the person saying "that's happy" is trying to make it look like homosexuals are stupid, when in reality, they're only trying to say what they're talking about is stupid.
-
Ah ha. Well I guess I'm cool with him being a homosexual. There is nothing wrong with it, like, my dog is a homosexual...well my dog is a girl, so would you call a women who likes women, homosexuals?
Anyways back on topic, is the menu working good? Is not, back on topic, if yes, back on off topic, if it's not my choice (and I know is isn't) I wish it was, because I want to be in carge of something Sad.....
-
ok...i got rid of the problem with the moving the cursor left-right.....but there is still something wrong with it when you press a wrong button.....i just tested it, and when i pressed it, it closed the program.... Wink
Sounds like you don't have it contained in a #while loop. Post your code.
now i have a new problem.....im need to put in two variables into a single variable....example:
["potion"][char$]!=2
Check out Asimir's 2D array methods, available here.
-
so would you call a women who likes women, homosexuals?
Yes
-
I see...So yes, my dog, is indeed, a homosexual!
-
hmm...i check it out Xorlak....(does it work? :huh: )
well, most of them desire the word lesbian, but it still has the same meaning...
(really?...i didnt know he was a homosexual.......)
(how did this topic get into this copnversation anyways?... Wink ....heh....)
Heres the code you wanted Xorlak, I have it set up so that it checks for what the variable is out side of the #While loop so that I can animate a cursor....here's and example:
#a$=""
#arrowY!=i!*10+269
#SetImageTransparent("/Menu/Left_Vertical_Arrow1.gif",200,arrowY!,20,25,0,0,255)
#a!=75
#While(a$="")
{
#a!=a!+1
#If (a!=150)
{
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#SetImageTransparent("/Menu/Left_Vertical_Arrow2.gif",200,arrowY!,20,25,0,0,255)
}
#If (a!=300)
{
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#SetImageTransparent("/Menu/Left_Vertical_Arrow1.gif",200,arrowY!,20,25,0,0,255)
#a!=1
}
#Get(a$)
}
#If (a$=confirm$){#RPGCode(itemuse[i!]$)}
#If (a$="UP")
{
#If (i!=1){#Branch (:itemselector)}
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#i!=i!-1
#Branch (:itemselector)
}
#If (a$="DOWN")
{
#If (i!=Titem!){#Branch (:itemselector)}
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#i!=i!+1
#Branch (:itemselector)
}
#If (a$=back$)
{
#SetImage("/Menu/UnDescription.gif",200,280,260,226)
#SetImage("/Menu/UnDescription.gif",472,280,215,226)
#Kill(i!)
#Kill(Titem!)
#Kill(itemuse1$)
#Kill(itemuse2$)
#Kill(itemuse3$)
#Kill(itemuse4$)
#Kill(itemuse5$)
#Kill(itemuse6$)
#Kill(itemuse7$)
#Kill(itemuse8$)
#Kill(itemuse9$)
#Kill(itemuse10$)
#Kill(itemuse11$)
#Kill(itemuse12$)
#Kill(itemuse13$)
#Kill(itemuse14$)
#Kill(itemuse15$)
#Kill(itemuse16$)
#Kill(itemuse17$)
#Kill(itemuse18$)
#Kill(itemuse19$)
#Branch (:itemcheckstart)
}
#If (a$~=confirm$)
{
#If (a$~=back$)
{
#If (a$~="UP")
{
#If (a$~="DOWN")
{
#Branch (:itemselector)
}
}
}
}
(Note: any Branches are out of this given program...also, this is an older version of my program...but it still gives the idea of what Im doing...)
-
*Dude Man looks at the program, sees a bunch of commands and dosen't understand why it works, and his programs don't. His head starts to hurt, so he sits down a throws the program away*
Ack...it's not fair.... (http://http://ibforums.mysticsoftware.net/style_images/Hardwire-608/icon2.gif)
-
practice daily is the key B)
actually, i really only just learned how to do animation and multi-animation a couple weeks ago...
Xorlak, i need a lot of help understanding the 2D array thing....its really confusing...
-
I'll never learn....I never learn anything! I'm just a non-learning guy...
-
anyone can learn it!
Spyder, i see your viewing this....check your PM's....
-
Heres the code you wanted Xorlak, I have it set up so that it checks for what the variable is out side of the #While loop so that I can animate a cursor....here's and example:
Uh oh, branches... (heh...)
It looks like the :itemselector branch gets hit if you press a wrong key, which is what you want. But I'm guessing the program ends because of something in that branch. You want nothing to happen when the user presses a wrong key, right? Here's a quick re-write that does that and eliminates that final branch:
#a$=""
#arrowY!=i!*10+269
#SetImageTransparent("/Menu/Left_Vertical_Arrow1.gif",200,arrowY!,20,25,0,0,255)
#a!=75
#done!=0
#while(done!=0)
{
#While(a$="")
{
#a!=a!+1
#If (a!=150)
{
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#SetImageTransparent("/Menu/Left_Vertical_Arrow2.gif",200,arrowY!,20,25,0,0,255)
}
#If (a!=300)
{
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#SetImageTransparent("/Menu/Left_Vertical_Arrow1.gif",200,arrowY!,20,25,0,0,255)
#a!=1
}
#Get(a$)
}
#If (a$=confirm$)
{
#done!=1
#RPGCode(itemuse[i!]$)
}
#If (a$="UP")
{
#done!=1
#If (i!=1){#Branch (:itemselector)}
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#i!=i!-1
#Branch (:itemselector)
}
#If (a$="DOWN")
{
#done!=1
#If (i!=Titem!){#Branch (:itemselector)}
#SetImage("/Menu/UnDescription.gif",200,arrowY!,20,25)
#i!=i!+1
#Branch (:itemselector)
}
#If (a$=back$)
{
#done!=1
#SetImage("/Menu/UnDescription.gif",200,280,260,226)
#SetImage("/Menu/UnDescription.gif",472,280,215,226)
#Kill(i!)
#Kill(Titem!)
#Kill(itemuse1$)
#Kill(itemuse2$)
#Kill(itemuse3$)
#Kill(itemuse4$)
#Kill(itemuse5$)
#Kill(itemuse6$)
#Kill(itemuse7$)
#Kill(itemuse8$)
#Kill(itemuse9$)
#Kill(itemuse10$)
#Kill(itemuse11$)
#Kill(itemuse12$)
#Kill(itemuse13$)
#Kill(itemuse14$)
#Kill(itemuse15$)
#Kill(itemuse16$)
#Kill(itemuse17$)
#Kill(itemuse18$)
#Kill(itemuse19$)
#Branch (:itemcheckstart)
}
Xorlak, i need a lot of help understanding the 2D array thing....its really confusing...
Hmmm, actually you want to do something like this, right?
#item["Potion"][char$]!=1
That'd require a 2D map rather than a 2D array, but I think I can modify Asimir's code to support that:
* Asimir's modified code
#method NumMapIn(arrayname$,arrayx$,arrayy$,arrayvalue!)
{
#command$ = "#" + arrayname$ + "." + arrayx$ + "." + arrayy$ + "! = arrayvalue!"
#rpgcode(command$)
#kill(arrayname$)
#kill(arrayx$)
#kill(arrayy$)
#kill(arrayvalue!)
#kill(command$)
}
#method NumMapOut(arrayname$,arrayx$,arrayy$,arrayvalue!)
{
#command$ = "#arrayvalue! = " + arrayname$ + "." + arrayx$ + "." + arrayy$ + "!"
#rpgcode(command$)
#kill(arrayname$)
#kill(arrayx$)
#kill(arrayy$)
#returnmethod(arrayvalue!)
#kill(arrayvalue!)
#kill(command$)
}
Now to do this:
#item["Potion"][char$]!=1
You would do:
#NumMapIn("item","Potion",char$,1)
And to get the value of that variable, you would do:
#NumMapOut("item","Potion",char$,dest!)
And dest! will be where to store the value of what you're looking for.
-
unfortunately...im not sure if that would work....it actually two variables.... #[itemname$][Gchar$]! (both are in quotations...) and there is no item going before it....or wouold there have to be?
-
That's just the name of the variable. Just use the word "item" for all of them:
#NumMapIn("item",itemname$,Gchar$,1)
-
so, that would mean that i could also just take out the item and have just a "" and it would just be (if itemname$="potion" and char$="Kail") potionKail! ?
-
oh! i get its code now!! all it is is a literal value thats turned into a code played out!! im so dumb!! Laughing
-
Even ME cud hav finded dat out! Laughing
Sorry, I didn't mean any ufence...errr...offenince...errr....god damn I can't spell...meh at least I'm close enough....
-
heh, yeah i know...i didnt think of it because i had triedf something similar...and it didnt quite work....hmm..... (heh...) Laughing
-
Laughing LOL! Okay put the post DE just did, and put it right after my post at the top of the page...
I see...So yes, my dog, is indeed, a homosexual!
heh, yeah i know...i didnt think of it because i had triedf something similar...and it didnt quite work....hmm..... (heh...) Laughing
-
Lots of people experiment Wink
-
You Know, probally nobody did, and you just ruined that joke for me. WHEN WILL YOU LEARN!
-
hey xorlak...once i added that extra #while, it still seems to have the same problem....when you press something besides what you can, it will screw up...
-
Does it still end like before? It might be better for you send me the whole thing to look at, if you want.
-
do you want the images with it?
-
If you think they're neccessary. ZIP it all up and email it to me.
-
Actually, the next TK3 will feature unlimited dimensions in arrays, and maps.
-
"I added a word filter to change the word happy to happy"
Ah, good.
I suppose I shouldn't take things so 'seriously' but in reality things like that are to be taken seriously.
It's not so much that I was offended, but that homophobia is so deeply ingrained in out society that instances even slightly involving it must be dealth with immediately.
Just my thoughts.
I also find it interesting that this topic became about me (heh...).
-
It's not just about you. It's about you, mostly about menu probloms, it's about my dog and it's about cheese!
-
Yes, but isn't everything ultimately about cheese?
-
Speak of the devil, I'm eating cheese! No really, right now, I AM EATING CHEESE!
And yes, cheese rules the world!