[Plugin] slg_movement

Post your completed addons to share with the community

Post » Tue Mar 26, 2013 1:20 pm

Hello again! I've been using your plugins for movement with good success so far. Been trying to make something based on your examples in the "test_slg_movement.capx" and have chess pieces moving around as they should without overlapping each other and all.

I'm a bit stumped on how to make them interact with 'enemy' chess pieces however. You wrote something about using filters to pick enemies, but I guess I'm not quite advanced enough yet to completely understand how to use it.

Mostly I'm looking for something that does:
"Click enemy chess > move to enemy chess > do stuff."

Any hints?
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Tue Mar 26, 2013 2:57 pm

@Vati-nyan

It seems
"Click enemy chess > move to enemy chess > do stuff."
is not like
"Using filter to pick enemy in a range"

Do you mean that "move above enemy chess (overlap), then do something"?
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Tue Mar 26, 2013 3:38 pm

Yeah, that would be it.
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Tue Mar 26, 2013 11:33 pm

@Vati-nyan

What's the rule of get enemy chess? Is it picked by slg_movement object?
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Wed Mar 27, 2013 1:15 am

You would select your own chesspiece, then (if able to reach it) click the enemy chess and select it that way, yes.
B
10
S
3
G
3
Posts: 110
Reputation: 2,206

Post » Wed Mar 27, 2013 2:55 am

@Vati-nyan

Sound nice, what's the problem? Do you mean select the enemies in the range of 4 cells (for example)?
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Fri Mar 29, 2013 9:51 pm

Hello Rexrainbow,

My project is growing nicely with your great plugings (player chess can move & target easily, & enemies chess can target player chess).

However, I can't find a way to make the enemy chess move toward a player chess (when it is the "enemy turn").

Is there a command to make enemies "autoselect" the tile that would be closest to one of the player chess?

As always, your help is greatly appreciated!

ThanksSobieski742013-03-29 21:51:58
B
26
S
9
G
1
Posts: 13
Reputation: 3,258

Post » Sat Mar 30, 2013 1:46 am

@Sobieski74

"make enemies "autoselect" the tile that would be closest to one of the player chess"

The logic might be complex, just like player to select the moving target. "closest" is one of possible condition.
Anyway, I will think about it when I have time.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

Post » Mon Apr 01, 2013 3:05 am

Hello Rexrainbow,

I have manage to circumvent a few issues with the enemy chess movement. It is now possible for an enemy chess to automatically select a tile nearby a player chess (it is done awkwardly, with some strange behavior but it work nonetheless).

---- SEE GROUP: "E_MOVE1" : (note: Only one enemy chess will move per turn)

https://www.dropbox.com/s/t5u5awsbp74jpwr/SLGMOV_Test101.capx

However, when the enemy chess is too far (i.e. the moveable area (tileframe = 1) is not within range of the player chess), the enemy chess can't move towards the player chess, and instead just run away to the left of the layout (I don't know why).

Do take a look at my capx, maybe there could be a way to allow enemy chess that are too far from the player chess to select a tile (tileframe =1) that would be in the right direction, towards the player chess (i.e. so as to eventually be "within the moveable area" on a next turn).

I hope this makes sense, do let me know what you think!

Thanks, as always!
B
26
S
9
G
1
Posts: 13
Reputation: 3,258

Post » Mon Apr 01, 2013 4:30 am

@Sobieski74

Get all of distance between move-able tiles and target tile, then pick the minimum one.
I had not make a plugin for this, maybe someday.
B
97
S
22
G
178
Posts: 4,121
Reputation: 104,049

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 5 guests