Mystic Software Forums

Miscellaneous => Archives => Archive => Topic started by: DarkElite on July 02, 2004, 12:05:17 AM

Title: (no subject)
Post 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:
Title: (no subject)
Post by: Asimir on July 02, 2004, 08:44:14 AM
#person[p!]$=KAIL should be  #person[p!]$="KAIL"

and the variable you use would be potion["KAIL"]!, not potionKAIL!
Title: (no subject)
Post by: DarkElite on July 02, 2004, 10:05:25 AM
well, thats the thing....i had tried that too....but it wouldn't work....
Title: (no subject)
Post by: Xorlak on July 02, 2004, 02:26:55 PM
Quote from: DarkElite,Thursday, July 1, 2004 11:05 PM
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.
Title: (no subject)
Post by: AlienDude on July 02, 2004, 03:47:28 PM
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
Title: (no subject)
Post by: DarkElite on July 04, 2004, 12:03:04 AM
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...
Title: (no subject)
Post by: Dude Man on July 04, 2004, 10:53:12 AM
I know RPG Code can be such a pain.  :angry: I just wish it would :unsure: ....not....be......a pain.... :blink:
Title: (no subject)
Post by: DarkElite on July 04, 2004, 04:50:55 PM
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?
Title: (no subject)
Post by: Spyder on July 04, 2004, 08:19:02 PM
I would imagine file size would be the main issue. How large is an example image, in pixels and file size?
Title: (no subject)
Post by: DarkElite on July 04, 2004, 11:12:15 PM
i think that its 600x300......but something along those lines...
Title: (no subject)
Post by: Spyder on July 05, 2004, 02:10:23 AM
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.
Title: (no subject)
Post by: Xorlak on July 05, 2004, 10:31:38 AM
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.
Title: (no subject)
Post by: DarkElite on July 05, 2004, 11:36:34 AM
i cant, because the large image im using requires for parts of it to be set transparent......any other ways?...  Wink
Title: (no subject)
Post by: Spyder on July 05, 2004, 12:50:00 PM
I wonder if that's what's causing it then, #SetImageTransparent.
Title: (no subject)
Post by: DarkElite on July 05, 2004, 02:50:30 PM
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...)
Title: (no subject)
Post by: DarkElite on July 05, 2004, 03:20:01 PM
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
Title: (no subject)
Post by: Colin on July 05, 2004, 03:30:29 PM
"this is getting happy"

That better not mean what I think...
Title: (no subject)
Post by: Spyder on July 05, 2004, 06:29:29 PM
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".
Title: (no subject)
Post by: DarkElite on July 05, 2004, 08:04:46 PM
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
Title: (no subject)
Post by: Dude Man on July 05, 2004, 08:53:39 PM
Quote from: Spyder,Monday, July 5, 2004 7:29 PM
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...
Title: (no subject)
Post by: Asimir on July 06, 2004, 08:11:02 AM
Quote from: "Spyder"
OK seriously KSNiloc. Your taking things far too seriously.

So do you want him to be serious or not? Razz
Title: (no subject)
Post by: Spyder on July 06, 2004, 09:42:01 AM
Quote from: Dude Man,Monday, July 5, 2004 6:53 PM
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.
Title: (no subject)
Post by: Dude Man on July 06, 2004, 09:48:42 AM
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.....
Title: (no subject)
Post by: Xorlak on July 06, 2004, 10:50:27 AM
Quote from: DarkElite,Monday, July 5, 2004 2:20 PM
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.

Quote
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.
Title: (no subject)
Post by: Spyder on July 06, 2004, 07:08:31 PM
Quote from: Dude Man,Tuesday, July 6, 2004 7:48 AM
so would you call a women who likes women, homosexuals?
Yes
Title: (no subject)
Post by: Dude Man on July 06, 2004, 09:24:17 PM
I see...So yes, my dog, is indeed, a homosexual!
Title: (no subject)
Post by: DarkElite on July 07, 2004, 09:19:09 AM
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:

Code: [Select]
#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...)
Title: (no subject)
Post by: Dude Man on July 07, 2004, 09:54:45 AM
*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)
Title: (no subject)
Post by: DarkElite on July 07, 2004, 10:13:46 AM
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...
Title: (no subject)
Post by: Dude Man on July 07, 2004, 10:16:47 AM
I'll never learn....I never learn anything! I'm just a non-learning guy...
Title: (no subject)
Post by: DarkElite on July 07, 2004, 11:26:24 AM
anyone can learn it!

Spyder, i see your viewing this....check your PM's....
Title: (no subject)
Post by: Xorlak on July 07, 2004, 11:55:22 AM
Quote from: DarkElite,Wednesday, July 7, 2004 8:19 AM
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:

Code: [Select]
#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)
 }

Quote
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:

Code: [Select]
* 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.
Title: (no subject)
Post by: DarkElite on July 07, 2004, 03:59:10 PM
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?
Title: (no subject)
Post by: Xorlak on July 08, 2004, 09:33:38 AM
That's just the name of the variable.  Just use the word "item" for all of them:

#NumMapIn("item",itemname$,Gchar$,1)
Title: (no subject)
Post by: DarkElite on July 08, 2004, 11:11:19 AM
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!   ?
Title: (no subject)
Post by: DarkElite on July 08, 2004, 04:27:01 PM
oh! i get its code now!! all it is is a literal value thats turned into a code played out!! im so dumb!!  Laughing
Title: (no subject)
Post by: Dude Man on July 08, 2004, 06:05:08 PM
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....
Title: (no subject)
Post by: DarkElite on July 08, 2004, 09:35:04 PM
heh, yeah i know...i didnt think of it because i had triedf something similar...and it didnt quite work....hmm..... (heh...)  Laughing
Title: (no subject)
Post by: Dude Man on July 09, 2004, 10:14:38 AM
Laughing LOL! Okay put the post DE just did, and put it right after my post at the top of the page...


Quote
I see...So yes, my dog, is indeed, a homosexual!


Quote
heh, yeah i know...i didnt think of it because i had triedf something similar...and it didnt quite work....hmm..... (heh...)  Laughing 
Title: (no subject)
Post by: Asimir on July 09, 2004, 12:50:45 PM
Lots of people experiment Wink
Title: (no subject)
Post by: Dude Man on July 09, 2004, 04:24:36 PM
You Know, probally nobody did, and you just ruined that joke for me. WHEN WILL YOU LEARN!
Title: (no subject)
Post by: DarkElite on July 09, 2004, 06:08:12 PM
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...
Title: (no subject)
Post by: Xorlak on July 10, 2004, 02:25:07 PM
Does it still end like before? It might be better for you send me the whole thing to look at, if you want.
Title: (no subject)
Post by: DarkElite on July 10, 2004, 04:53:34 PM
do you want the images with it?
Title: (no subject)
Post by: Xorlak on July 11, 2004, 02:26:28 PM
If you think they're neccessary.  ZIP it all up and email it to me.
Title: (no subject)
Post by: Colin on July 11, 2004, 03:06:17 PM
Actually, the next TK3 will feature unlimited dimensions in arrays, and maps.
Title: (no subject)
Post by: Colin on July 11, 2004, 03:09:27 PM
"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...).
Title: (no subject)
Post by: Dude Man on July 11, 2004, 04:55:26 PM
It's not just about you. It's about you, mostly about menu probloms, it's about my dog and it's about cheese!
Title: (no subject)
Post by: Asimir on July 12, 2004, 03:27:57 AM
Yes, but isn't everything ultimately about cheese?
Title: (no subject)
Post by: Dude Man on July 12, 2004, 03:40:04 PM
Speak of the devil, I'm eating cheese! No really, right now, I AM EATING CHEESE!

And yes, cheese rules the world!