RPG Parties

This forum is currently in read-only mode.
From the Asset Store
Helping streamers give their viewers more excitement.
  • I'm really curious how Construct would handle parties.

    For example.

    variables: name, hp, maxhp, sp, maxsp, xp, slot; // note I'm just using programming for examples, not construct or actual python coding.

    Now, when a game starts you see a few splash screens, then your title, you go through an introduction blah blah blah, etc. By the time it's all over, you should have 1 player to walk around with.

    I'm just wondering how you would setup a database for players and able to remove them, then add them at any point in your game, with constructs default coding.

  • you could always stuff the data on arrays

    as for character sprites, you could either have one object per party member slot and load animations on runtime (can one add frames on runtime? set frames other than the first? never tried) or you could have a different object per character and spawn them accordingly.

  • Yeah, keep the info for the characters in the array, then use the array to also remember who's currently in the party. Like:

    Character 1's hp

    Character 1's mp

    Party member slot 1: character 1

    Then when starting a battle or such, if the value in party member slot 1 is character 1, create a character 1.

  • I didn't know arrays were possible to use without python scripting? What behavior/button is it?

    In Game Maker I did it like this.

    globalvar actor, name, lv, hp, maxhp, sp, maxsp, str, pow, def, spd, xp;
    globalvar char1;
    
    actor[char1,name] = "Character 1s Name"; 
    [/code:otpwuf2s]
    
    I always was never able to create a party add/remove system, but in python it could be like this.
    
    [code:otpwuf2s]
    class Party:
        pass
    
    Duran = Party() # Create a Party Member  also can be done by arrays
    Duran.name = "Duran";
    Duran.hp = 75;
    # More stat stuff here
    Duran.slot = ''; // slots are only added when a party member is called. 
    
    define add_actor(actor)
      i = actor.length # Don't know if python has a length thingy like javascript
     if actor !=3
       actor[i] = new object();
       actor[i].Name = Actor[actor].name;
        Actor[actor].slot +=actor.length;
    [/code:otpwuf2s]
  • It's in the list of objects when you insert an object.

  • Coolies.

    so I did it like this.

    var Durran // player

    array[Durran,name] = "Duran";

    array[Durran,slot]' = ''; // only when added.

    how would the adding/removing of the player work?

    "I'm use to programming, kinda wish python was ready"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have no understanding of python - here's how to do it via events.

    Set the values at array's x, y to the character's stats. Like the stuff in column x1 is for character 1, column x2 is character 2, etc.

    So set value at x:1 y:1 Charater 1's hp

    Set value at x:1 y:2 Character 1's mp

    Somewhere else, have a few slots on the array available to tell who's currently in the party.

    Upon adding a character to the party, set the slot in the array to their name.

    Set value at x, y to: "Character 1"

    At the start of battle:

    At start of layout

    Array: value at x, y is equal to "Character 1"

    • create Character 1

    Removing a character:

    Set value at x, y to: "None"

    Important! There's currently a bug in the array that retrieving values from either x1 or y1 doesn't work correctly, I can't remember which. Start at x2/y2 and it should work. You also might need to increase the side of the array, done in its properties.

  • "I'm use to programming, kinda wish python was ready"

    Me too

    But then again using events has been really fast and easy. It's just event-oriented code. Kinda like javascript/actionscript, only loops are special events here (that still throws me off)

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