Array Database (need advanced users help :P)

For questions about using Classic.

Post » Wed Nov 02, 2011 8:56 am

So, i found a way to make system use some king of database and it's hopefully works except one thing.

(You need to download this file :3)

You have 3 arrays.

1. Inventory
2. In-game objects
3. Database

The database represents the tablet with object "id" and name.
What i'm using in my example:
     x1    x2    x3
y1   1     2     3
y2 stick stone apple

and when you drop item, system compare item's id and id in array and using name under this id to create object.

This is pretty fine system but i can't make it works to load objects on start up. (?21 and ?25 events in example).
And i again hoping on your help guys :PVladoss2011-11-02 08:58:12
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Post » Wed Nov 02, 2011 1:31 pm

[QUOTE=Vladoss]This is pretty fine system but i can't make it works to load objects on start up. (?21 and ?25 events in example).[/QUOTE]
I'm not sure what you mean. It works for me, loads the items from the array and shows them at the correct places. I can place items in the inventory, I can move them around and they get saved when exiting the application. The next time I start everything is loaded correctly as it was when exiting.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Nov 02, 2011 1:45 pm

[QUOTE=tulamide] [QUOTE=Vladoss]This is pretty fine system but i can't make it works to load objects on start up. (?21 and ?25 events in example).[/QUOTE]
I'm not sure what you mean. It works for me, loads the items from the array and shows them at the correct places. I can place items in the inventory, I can move them around and they get saved when exiting the application. The next time I start everything is loaded correctly as it was when exiting.[/QUOTE]

I want these events to replace on these but i when i'm trying to do it, it doesnt works.Vladoss2011-11-02 13:46:26
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Post » Wed Nov 02, 2011 1:52 pm

Please excuse me, but I still don't understand.
Do you want the inventory to be saved everytime when it is changed, instead of just on exiting?

I mean, it works, right? Why would you want to change it?tulamide2011-11-02 13:54:08
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Nov 02, 2011 2:07 pm

[QUOTE=tulamide] Please excuse me, but I still don't understand.
Do you want the inventory to be saved everytime when it is changed, instead of just on exiting?[/QUOTE]

Sorry for my bad english.
So ok, there are 2 ways to create necessary object.

First one:

It's inconvenient way, because you need to add every id by yourself every time when you wanna add new object in game.

Second one:

This way using database array to detect necessary object and it's even more easier then first

On startup event, i have first way to create objects (where i need to type every id) but i want make it like in second one but I can't do it.

I hope now you understand :<
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Post » Wed Nov 02, 2011 2:12 pm

Ah, yes, now I see! I'm sorry for being so numb sometimes :)

I'll try to make it work.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Nov 02, 2011 2:42 pm

Here you are:

http://www.mediafire.com/file/3rb8r4xz1gzdkd5/database_array_simplified.cap

It was just a matter of indirect referencing, if you look at the events you will instantly see what I mean. But feel free to ask, if it is not obvious.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Nov 02, 2011 2:47 pm

[QUOTE=tulamide] Here you are:

http://www.mediafire.com/file/3rb8r4xz1gzdkd5/database_array_simplified.cap

It was just a matter of indirect referencing, if you look at the events you will instantly see what I mean. But feel free to ask, if it is not obvious.[/QUOTE]

Thank you very much!
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Post » Wed Nov 02, 2011 4:51 pm

[QUOTE=tulamide] Here you are:

http://www.mediafire.com/file/3rb8r4xz1gzdkd5/database_array_simplified.cap

It was just a matter of indirect referencing, if you look at the events you will instantly see what I mean. But feel free to ask, if it is not obvious.[/QUOTE]

I found some kind of bug. When system using id from array it uses id thats compare of array index (id = 3 array = 3,1)
I added 3 objects that is not compare array's indexes and 1 which is compare. First 3 doesn't work and last one works fine.

screen of array

cap fileVladoss2011-11-02 17:12:18
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Post » Thu Nov 03, 2011 7:37 am

[QUOTE=pangqiuqiu25] The next time I start everything is loaded correctly as it was when exiting. ...


___________________
Diablo 3 Items[/QUOTE]

try to do it with colorblock1 colorblock2 and stoneblock ._.
B
38
S
15
G
6
Posts: 238
Reputation: 7,760

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests