How to load Armour/Weapons smoothly & easily?

0 favourites
  • 5 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • Hi, i'm currently developing an RPG game that is based on skills, and training your stats up to get better weapons but I have managed to encounter an issue in which after 3 days of pondering and testing I have not been able to find a solution for.

    I wish to ask how would I go about creating a single weapon into the layout that the player has equipped/bought and I only want 1 weapon to be loaded onto the layout at a time because I don't want a lot of memory in the graphics processor taken up by unused entities/sprites.

    I wish to make the game work something like this:

    On start of layout: System.CreatePlayer(x, y) then System.CreateWeapon(x, y) then System.CreateArmour(x, y) BUT the issue is how would I make the system only create the specific weapon without having to have all the weapons and armour loaded into the game at one time?

    It would be great if anyone who has surpassed this issue before could quickly post a response on how to fix this soon

  • <bump> Anyone? </bump>

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Give it some time mate , bumping after 1 hour of waiting won't help much ;

    And moreso , Don't worry , there's plenty of mem' out there , just don't use high-res textures too much

  • If you absolutely want to have only 1 weapon loaded in the layout, I don't see other technique but a layout per weapon, and dynamic loading of everything else, as you can't create an object in a layout in C2 if it wasn't created at the start of the layout.

    In that case, I would still use the same layout for multiple weapons that have the same animations, as you may be able to spare a little more memory here too.

    That being said, you sure can put more than 1 weapon in a layout. Plus, if you destroy it at the start, depending on the device, the memory will be free automatically (I may be mistaking, if anyone has more precise info).

  • If you absolutely want to have only 1 weapon loaded in the layout, I don't see other technique but a layout per weapon, and dynamic loading of everything else, as you can't create an object in a layout in C2 if it wasn't created at the start of the layout.

    In that case, I would still use the same layout for multiple weapons that have the same animations, as you may be able to spare a little more memory here too.

    That being said, you sure can put more than 1 weapon in a layout. Plus, if you destroy it at the start, depending on the device, the memory will be free automatically (I may be mistaking, if anyone has more precise info).

    So you are telling me if I place every piece of weapon and armour into the layout but when the layout is officially loaded when previewing the game I can run a line saying something like:

    OnStartOfLayout - *armour.destroy() and *weapon.destroy()

    ?

    Now if that is possible(I will test later) will I be able to do something like this?

    (While in shop)

    Player.BuySword2

    Sword1.Unpin, Sword1.destroy, Player.createSword2(x,y), Sword2.Pin(Player, x, y) ? or with any other sword and armour?

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