[How Do I] - Load NPCs/Weapons From files

Get help using Construct 2

Post » Thu Mar 14, 2013 10:58 pm

Hello, going to state now that I hope I'm not posting/asking too many questions, just making good use of this :D

However, how do I load info from text files, such as for an npc:

[Code][ObjName]
Title=
Name=
Type=
Var1=
Var2=
Var3=
Var4=
X=
Y= [/Code]

So for example stuff like:

[Code][Sprite1]
Title = The Evil
Name = Person
Type = Human
MinHP = 20
MaxHP = 20
X = 25
Y = 30 [/Code]

And stuff like that for Objects (Such as npcs) and items (such as weapons/armor/potions).

Sincerely,
Jesse Jarvis
B
26
S
5
G
5
Posts: 98
Reputation: 4,734

Post » Thu Mar 14, 2013 11:48 pm

I do not think that you can do such a thing with text file but you could do object variables on the NPC's that you would like to do that with.
B
7
S
2
Posts: 18
Reputation: 891

Post » Thu Mar 14, 2013 11:51 pm

I don't think it's possible , not because C2 is limited ( CC did it , C2 could do it with no problems ) but because of the browser

In fact , The browser doesn't allow you to load files from the drive for some security reasons ...

You could always search for a way to load databases using ajax ... ( Don't ask me , I'm a newb like you at those things :P )

Hope that helped ...

Cheers ...
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Fri Mar 15, 2013 12:02 am

Ooohhh riiiight..... sometimes I forget that this runs in a browser and limits it significantly, forgot about that.. I miss exe days.. Don't get me wrong playing in a browser is wicked at times, but the feel is off.

Alright thanks then, I'll find a way to load files from a database then, eventually it'll be an mmo anyways so I suppose it don't matter.
B
26
S
5
G
5
Posts: 98
Reputation: 4,734

Post » Fri Mar 15, 2013 12:08 am

@Equinox80 Have you looked into loading from an XML file?

Otherwise if you have a server you could set up a database and read values out of it.

But I think XML would be the way to go unless you need to save data back to the database.
B
31
S
8
G
5
Posts: 436
Reputation: 5,836

Post » Fri Mar 15, 2013 12:10 am

@czar - Thank yes I could look into XML that would work, then if I do actually decide to go the MMO route I will use a database, want to keep it small for now. And since I have no artists and its just me using what I find, it's slow lol.

Thanks alot!
B
26
S
5
G
5
Posts: 98
Reputation: 4,734

Post » Fri Mar 15, 2013 12:32 am

You can always use CC to make this project , who said it wasn't good ?
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Fri Mar 15, 2013 1:37 am

Maybe this recent topic will help you: http://www.scirra.com/forum/topic64881.htmlXavier2013-03-15 01:38:05
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Fri Mar 15, 2013 1:39 am

Project files, server, XML, CSV, JSON (array, dictionary, etc). Take your pick :) There is info on all of this in the manual.Tokinsom2013-03-15 01:39:33
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Fri Mar 22, 2013 9:19 pm

Server eventually, I want to complete the game for solo experience, and then once it's done make it ORPG, that way the basis of the game is done first and save the hardest for last.

Programming is something I enjoy but I have absolutely NO idea of how to do networking for programming.

This program is mostly Drag & Drop but there is still unlimited power to it.

I am going to look though for how to make it connect to a mysql database and load characters/items from tables maybe.
B
26
S
5
G
5
Posts: 98
Reputation: 4,734

Next

Return to How do I....?

Who is online

Users browsing this forum: Artpunk, gregorysforster, Matthew de, onzephyr and 1 guest