RPG ( ish )Advice

Get help using Construct 2

Post » Tue Apr 08, 2014 12:17 am

Hey guys! Have consulted these forums many times before and found answers quickly, this time I really need some advice on a couple of things, it may seem long and expansive but I'll try to be concise!

I am wanting to create a turn based RPG ish (maybe more roguelike) game where you are in a post apoc environment. You can have weapons that increase hit points to enemies, armor that decreases hit points when attacked, and randomized scenery and enemies that you encounter. Nothing too complex graphically just one screen that displays a nice background and the enemy in front of you. When the screen has nothing there, you click to move to another location. At that point a random variable determines what will be next; an enemy, an item to grab etc.

This is ok for me, I know how to randomize variables and scenery quite easily, the problem I'm having is that to determine if the enemy has a weapon/armor , what weapon/armor the player might have and so forth, I am using a buttload of variables. I feel I am doing it the long way. Based on this premise would anyone out there have an idea for a way to simplify the event sheet? I know I should be using arrays and functions but not as experienced there despite browsing through the forums and tutorials. I can wrap my head around what arrays do but not how to practically implement them for such a game.

Sorry guys big post. I'm not expecting anyone to solve my problem entirely, just maybe throw some ideas around to better implement those changing variables you get in an RPG like HP, Attack points, item drops, random enemies. Like I said I can do it my way, but I know you guys would have some great input here.
B
7
S
2
Posts: 24
Reputation: 569

Post » Tue Apr 08, 2014 3:24 am

You can write a JSON object outside of C2. If you play some funny games with the C2 string object you can load them.

String items = {C2Dictionary/Array/blah : data="}
items append json.file
items append ""}

Or you can use XML files too.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Tue Apr 08, 2014 3:53 am

I use arrays for large quantities of data, but the information in it isn't all that complex. Like i have a cell dedicated to what item is in a certain inventory slot. It could be a number value from 0 to whatever I want. Then, when I need to do something with it, I just see if array.at(0,3,4) value = 17, do this, else, do this. You can do the same with ranomizing things and setting a bunch of variables. Make a google spreadsheet or excel document as reference for yourself. Maybe your 5th column always has enemy info. If enemy = 5, set array.at(0,6,0) to 5. Then you can just call, change, and reference your different cells like that instead of having a gigantic list of variables. Just keep a spreadsheet around for your reference so you don't get lost.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Tue Apr 08, 2014 4:56 am

Thankyou guys I will investigate XML files, and C-7 your example of using arrays gave me a clearer picture of what I can do.
B
7
S
2
Posts: 24
Reputation: 569

Post » Tue Apr 08, 2014 11:51 am

OK so after playing around a little I still get a little stuck. I've read and re-read the stuff on arrays, having some difficulty finding an example that works.

For the sake of understanding , lets say I have two enemy types, two weapon types and their corresponding power (or hit points of damage to be deducted from
player health on attack).

On the start of layout I want to spawn either enemy A or B, with weapon A or B, and when they attack the player subtract either value A or B from player health depending
on what weapon they hold.

Can someone detail how they would set this up? I feel like I am waiting to read something that helps the whole array thing click for me, it just hasn't happened yet, no matter
what I attempt in C2 or read in the FAQ sections.
B
7
S
2
Posts: 24
Reputation: 569


Return to How do I....?

Who is online

Users browsing this forum: PROxMTswatTR, sean080 and 36 guests