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

0 favourites
  • 11 posts
From the Asset Store
Source code, art assets and music tracks to remake this game
  • 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:

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

    So for example stuff like:

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

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

    Sincerely,

    Jesse Jarvis

  • 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.

  • 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 ...

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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!

  • You can always use CC to make this project , who said it wasn't good ?

  • Maybe this recent topic will help you: http://www.scirra.com/forum/topic64881.html

  • Project files, server, XML, CSV, JSON (array, dictionary, etc). Take your pick :) There is info on all of this in the manual.

  • 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.

  • Okay this is what I got:

    dl.dropbox.com/u/73299017/capx/MyORPG.capx

    I ran into a couple problems though.

    Edit: Solved #1, still not #2 although it's not too big of a deal, just means a blank end, I've seen other games do it now I know why! :P PS: Updated the capx.

    1: {SOLVED} Everything runs fine except I can't make the "name" disappear when the training dummy dies, I tried having it so that it destroys when it dies and the animation is over, but if I do that the name destroys within a few seconds on startup.

    2: in the xml file I have to have a blank end, because it will not load whatever is at the end of the xml file.

    3: How can I make a spawn timer? You'll see how I have spawn_timer in the xml file, and st as a global variable. Working on it now but help would be nice. (I could easily make one spawn timer, but how to do it individually for each npc).

    Is there a way to fix this?

    Thanks! :)

    Sincerely, Jesse Jarvis

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)