SLG game combat encounters!

Get help using Construct 2

Post » Wed Nov 13, 2013 4:34 pm

Hello everyone!

I've been working on a project that keeps getting me stumped, but I keep going back to it and making a tiny bit of progress here and there. There is one issue I just can't seem to solve though, so that is what this post is about.

I'm using Rex's SLG-movement and Board-plugins, which are quite amazing. I don't want to keep bothering his thread any more though, so I will try and turn to the general community!

The moving around part works pretty well so far, and I have a good idea of how to make combat resolution work. My issue is making player units and enemy units engage in combat though!


Now to click that grey guy....

When an enemy is within range of a unit, I want to be able to click it, have the unit move next to the enemy, and start the combat resolution. All I try is for naught though....


Nooo don't go that way, silly!

Since I'm no good at explaining things, and I'm aware this post makes no one smarter on what is wrong with my code, I'm more than happy to send my Capx for a closer look to anyone willing to help!
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Wed Nov 13, 2013 4:49 pm

here is a potential option

Compare 2 values


distance(user1.X,user1.Y,user2.X,user2.Y)
smaller then
100

Add that compare to the event where you can click user2.
It will only be clickable when player 1 is closer then 100 pixels to player 2.


Might not be what your looking for, but its a start :D
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Wed Nov 13, 2013 8:55 pm

Hmm won't work here I don't think. Not a bad idea though!
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Wed Nov 13, 2013 9:23 pm

btw, I had to look it up and get the database from an old archive file, .. but your game reminds me a lot of something I made some years ago with lots of javascript and a php back end. Its a 4 player max multiplyer, real time stratgey ...

battletac


I should port it to construct 2 hehe :D
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests