General RGSS/RGSS2/RGSS3 Help

Started by G_G, March 04, 2009, 12:14:28 am

Previous topic - Next topic

G_G

exactly how is it layed out though?
[1 => 3, 4=> 4]



Ryex

it's in an array but stupid enterbrain decided to but the array in a table so you can really print it
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

yea but I wanna know how to set it up still
[1 => 3, 4=> 4] is this what you mean in your post before?

And then how would I change an efficiancy of an element?

Ryex

June 20, 2009, 07:10:39 pm #123 Last Edit: June 20, 2009, 07:17:00 pm by Ryexander
it is layed out in and array where the position is the elamit id and the value is the rank
so
for the default ghost his array look like this

[ 0, 2, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3]

1 => A
2 => B
3 => C
4 => D
5 => E
6 => F

EDIT: sorry had the data wrong now it is right
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G

ah ok so the first one, nil, is element id 0 which there isnt one
then it goes on I see ok thanks ryex *lv's up* will level you up again when I can this'll help out alot for this boss

Ryex

edit recheck my post i had the data wrong
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

G_G


Blizzard

June 21, 2009, 06:35:15 am #127 Last Edit: June 21, 2009, 06:36:19 am by Blizzard
Iteration through tables:

(0...table.xsize).each {|x| (0...table.ysize).each {|y| (0...table.zsize).each {|z| table[x, y, z]}}}


Keep in mind that your table might be 2 dimensional so you would have to use table[x, y] and only 2 loops.
Also, tables cannot be printed like other things. They are internally defined in a different way and nobody implemented a proper inspect method in them. :/
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

Quote from: Blizzard on June 21, 2009, 06:35:15 am
Iteration through tables:

(0...table.xsize).each {|x| (0...table.ysize).each {|y| (0...table.zsize).each {|z| table[x, y, z]}}}


Keep in mind that your table might be 2 dimensional so you would have to use table[x, y] and only 2 loops.
Also, tables cannot be printed like other things. They are internally defined in a different way and nobody implemented a proper inspect method in them. :/


this is why i think it is stupid that they are using a table for this; its a ONE dimensional table, EXACTLY like an array but no! they had to make it more complex than it should be.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

fugibo

Quote from: Ryexander on June 21, 2009, 01:58:02 pm
Quote from: Blizzard on June 21, 2009, 06:35:15 am
Iteration through tables:

(0...table.xsize).each {|x| (0...table.ysize).each {|y| (0...table.zsize).each {|z| table[x, y, z]}}}


Keep in mind that your table might be 2 dimensional so you would have to use table[x, y] and only 2 loops.
Also, tables cannot be printed like other things. They are internally defined in a different way and nobody implemented a proper inspect method in them. :/


this is why i think it is stupid that they are using a table for this; its a ONE dimensional table, EXACTLY like an array but no! they had to make it more complex than it should be.


Okay, okay, I can take a hint! I need to sublcass Array, gotcha. >_>

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

There's a reason Table exists. It's much faster than multidimensional arrays.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

that may be true but why in the world would you use a ONE dimensional table?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Again, speed. But tables are fixed sized and they only support integers from -32768 to 32767. That's the limitation.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

fugibo

Quote from: Blizzard on June 21, 2009, 03:49:11 pm
Again, speed. But tables are fixed sized and they only support integers from -32768 to 32767. That's the limitation.


Any particular reason it's 16-bit?

Blizzard

Probably because most data in tables doesn't need to have such a big range and probably for performance reasons. Table was made due to performance problems after all.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

fugibo

How much of an increase could it really get over 32-bit (that's usually just a signed int, right?) It seems like the millions of more values would make it more than worth it.

Blizzard

June 22, 2009, 10:04:06 am #137 Last Edit: June 22, 2009, 10:05:37 am by Blizzard
Ok, now slowly reread my post from before and this time please don't skip the part where I said that a table is not resizable (realloc is an expensive operation, hint, hint -_- ). Along with that I would assume that there are other tweaks for faster access. It's very probable that Ruby's Array class is actually an implementation of a list. Tables in that case would be even faster since they seem to definitely be arrays.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Another question......

How do I call up the message screen via script call? At the beginning of every battle I want a message to display that shows what the terrain is like
"Desert ~ Fire Power increased etc."

So at the beginning of every battle I want it to show a message all I need to know how is to call the message screen. I already ahve everything else setup.

Blizzard

Use a variable where you assign the player's terrain tag to. Just check the variable and you will know which tag it is. Then you simply do a conditional branch with text at the beginning of a battle.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.