Turn Based Attacks

Get help using Construct 2

Post » Wed Jun 19, 2013 11:13 pm

Hey you,

I am making an RPG game, where all the fighting is "instanced". Like Final Fantasy fighting. Under certain conditions I want the current player to jump out, attack and jump back to its starting position.

I have got this part down pat. But, looking at all the other variables I am going to need to calculate and so on, the way I am doing it now just seems wrong.

I am used to Functions in C++. I know there are Functions available in Construct 2. Do they run the same way as C++? Can I pass variables between them?

Here is a screen of the code I am using right now. Should I continue using this format or switch to Functions? Got any tips/advice?

B
54
S
15
G
13
Posts: 821
Reputation: 17,565

Post » Thu Jun 20, 2013 1:44 pm

[quote=Manual]When calling a function, you can also pass parameters. These are simply numbers or strings that are made available to the function.[/quote]
For simple questions about what the different features do you should just look it up in the manual.

It's also a bit difficult to imagine exactly what happens with that screenshot since we know nothing about the position of the objects or what they are there for. It's easier if you share your file, so we don't have to spend ages interpreting your event sheet and just guessing what it looks like in your layout.

If you don't want to share your file for some reason, you can recreate the bit you need help with in a smaller project.

Anyway, I'd love to help, but I'm not really sure what the problem is, and what your events are meant to do, and I'd rather not spend the next 30min trying to figure it out when I could just press the preview button and see it in a few seconds.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Jun 20, 2013 4:55 pm

@Nimtrix Okay, I have posted it to my Dropbox. Hopefully this link works for you.

Link Removed

Simply put, I wanna know if I should start using functions for this part of my game? This turn based fighting is the most complex thing I have made, thus far.Tekniko2013-06-20 20:52:25
B
54
S
15
G
13
Posts: 821
Reputation: 17,565

Post » Thu Jun 20, 2013 6:09 pm

Link works. What exactly do you intend to do with the functions, replace your current setup? Or what kind of variables do you need to, as you say, calculate?

I'm sorry, I'm just having a hard time figuring out which parts you're happy with and what you want to change. Nimtrix2013-06-20 18:10:05
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Thu Jun 20, 2013 7:18 pm

@Nimtrix This is what I think needs to happen...

Check which player can attack
Check which spell/skill user selected
Check which enemy the user selected
Wait for attack button pressed
On attack button pressed, jump to selected enemy
Cast previously selected spell/skill
Calculate damage
Return player to starting position
End players turn
Calculate which player goes next

(I was thinking of using a timer for each enemy/player)
So someone with a lower attack-time could attack sooner then someone else with a higher attack-time.

So, you wouldn't see its switch up like, Enemy/Player/Enemy/Player
Instead you would see something like, Enemy/Enemy/Player/Player/Player/Enemy/Player

Here's an example of what I am thinking of doing. Notice the wait time in the bottom right hand side of the screen for each character.

https://www.youtube.com/watch?v=hD_akZhtMgI#

Skip to 18:20Tekniko2013-06-20 19:36:41
B
54
S
15
G
13
Posts: 821
Reputation: 17,565

Post » Thu Jun 20, 2013 8:50 pm

I give up for now. I don't understand functions or anything really, lol.

Here is the latest build I was working on.

.capx
B
54
S
15
G
13
Posts: 821
Reputation: 17,565

Post » Fri Jun 21, 2013 3:17 am

Well, almost the end of the day now. Can anyone else give me some advice on how to handle this?
Even if you just have turn based attacks with the ability to select a target and use skills...
Any example capx's I could dissect?

Thank you,
StephenTekniko2013-06-21 03:17:21
B
54
S
15
G
13
Posts: 821
Reputation: 17,565

Post » Fri Jun 21, 2013 5:05 pm

I'm gonna try and put something together for you, but it could take a little while.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Jun 21, 2013 7:26 pm

Alright, I'm sharing what I've got so far. There's a lot of stuff to add before everything is covered, but hopefully you can get some ideas from this. I planned on making the animations follow the green squares before I posted it, but I need a break right now, so here ya go:

TurnBased_tekniko.capx (r134)
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Jun 21, 2013 7:31 pm

Wow, thank you for taking the time to put this together. I can see how what I was doing wrong with my functions. I was calling Global variables instead of parameters.
Again, thank you so much. I'm going to sit down in a bit and try to figure out what you did here.

Thank You,
Stephen
B
54
S
15
G
13
Posts: 821
Reputation: 17,565

Next

Return to How do I....?

Who is online

Users browsing this forum: istero, zenox98 and 8 guests