About remembering the coordinate of respawn

Get help using Construct 2

Post » Thu Dec 08, 2016 9:04 am

You are right, best way gonna be an array. I did not expect a 50 seconds, and that the player will be able to kick others in the mean time (not mentioned). I try to make an example, when i got time.

Thinking about an array that adds on the end. And reads the first index (every second), spawns if needed, and then deletes the first index. A dt corrected time is essential in this.

One question, dont you need a grid move ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Dec 08, 2016 6:10 pm

Okay.

I have an Azerty keyboard. WASD is hellish for me. Changed keys, but that should not be a problem.
Made the kicking more simple.
Added an array to manage the re-spawning.

https://www.dropbox.com/s/wurz9rr7133r9 ... .capx?dl=0

Hope this helps.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Dec 08, 2016 11:52 pm

Grid move ? Do you mean locking a player's movement in 4 direction (when a player move upward, left and right direction are locked ?). I could do that but it will take over 25 events ( it is a 4 players game). The 100 events limitation is a hell. It takes over 50 events just for a perfect control. :)
B
7
S
1
Posts: 16
Reputation: 409

Post » Fri Dec 09, 2016 9:11 am

I made the kicking 1/4 th of your code, and it can all be done even smarter.
Seen that way, the 100 events limitation is a blessing. You got to outsmart it, to start with as beginner.
Cant think of a better environment. : )
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Dec 09, 2016 12:04 pm

Just to illustrate my point.

My previous capx had 13 events.
This one has 15 events including a system to move precisely over the grid.
And it corrects a logic flaw, where spheres returned to place of last kick, not to where they started.

https://drive.google.com/open?id=0B1SSu ... l9sdTVNZEU

You need the MoveTo behavior.
behavior-moveto_t63156

Hope this helps.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sun Dec 11, 2016 11:00 am

Sorry for the late answer.
For some reason, The first CAPX you sent to me (KickEm) doesnt do the respawn at all. (But the script is all make sense)
When the spheres kicked to wall, it seems like it will spawn another object, before the wall coordinate (presumably because the spawning position is the same with the ball movement, or the "thisX" or "thisY" coordinates counted not when the sphere being kicked, but AFTER it).

Then I tried to modified the separated layout in many different manners, but it always doesnt do the respawn thing. (this is very strange ,and make me sratch my head many times because the script is almost the same with my first attempt :?: ) . Next time I come back I will include the "working" CAPX.

This maybe embarrassing, but the second CAPX you sent me (the compressed one) dont work at all. I've download the rex behavior MoveTo plugins, but no matter what I do, it always show error in plugins/ javasript.

I've consult with my friend about this matter, and he suggested me to use the System : Wait.
Basically it means that when a sphere is kicked, it will do the Wait (such as 5 secs) and then reposition the kicked sphere to starting position, WITHOUT DESTROYING it ( this actually make possible by turning off all of the collision trigger and turning off the visibility of the sphere, which is hypothetically effective because it uses the same UID and IID / not change the ID at all). But I guess it is not possible to do in my game , because the sphere can collides with other spheres and have to be destroyed when hitting certain objects).

I did some research a while ago about UID and IID. I strongly believe that the most correct way of doing this respawning problem is to use IID.
Given if IID will sort the multiple instances of an object (Ball) and always has consistent value even when any instances is being manipulated (destroyed/ changed) , I have an idea (but i dont know how to put it on code)
Basically, it will do these things :
1. Store an instance variable of IID in an instance (such as ,in any Sphere , put an "thisIID" instance variable)

,which have 2 alternative possibilities :
a. Putting a value of -1 in "thisIID" of every instances onscreen , and fill the value at the Start of Layout with Self.IID
(maybe using "For each")
b. Putting value of "thisIID" with Self.IID

2. Always compare / pick the IID of the Sphere that currently being kicked or starting respawn counter, with Self.IID
(also, maybe using For Each), basically, it will perform the spawning if the IID of kicked sphere is the same as the IID in instance variable.

Or maybe uses expressions like, Pick Nth instance....

I might be gravely wrong about this, but I cant think of other possibilities. (the more I dwelve into IID explanations, I getting even more confused :) )

I really need to overcome this matter, as it seems to be my last hurdle in completing my game.

About your opinion that 100 event limitations is a blessing, somewhat I have to agree with you. I keep telling myself that in the older days , gaming peoples were struggling with cartridge sizes,RAM or stuffs like that . But I found that it is those things that make the classics great. Limitations drives people forward. Thats what I think. :)


Thanks for your replies. If the game is finished, I'll let you know.
B
7
S
1
Posts: 16
Reputation: 409

Post » Sun Dec 11, 2016 11:39 am

You are right, better listen to a friend, especially when they suggest a 'Wait'.
Never listen to a stranger who is strongly against the use of 'Wait'.

I apologise for taking this comment literally :
I think It doesnt seem right to place the timer in the Player. As each instances / objects of Sphere has their own timer, which if any Sphere getting kicked, the corresponding Sphere will start the timer and respawn after 50 secs/ counts.

I should have known that there is no 50 seconds patience.

Thank you sincerely for your time.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Previous

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Construct Monkey, shawnzien, tatogame and 11 guests