need help with war game (Im using tables) please look :) *FIXED*
-Timo-
Member Posts: 2,313
hey guys
I am working on a war game, you have a 2 bases, the enemy has 2 bases and there is 1 neutral base.
every second every base gets 1 soldier more (just a number) when you slide from a base to another base the 'soldiers' walk to the base you slide to. when you slide to your own base the 'soldiers' in that base gets more and when you slide to an enemy or neutral base the 'soldiers' get less. (so when you have 10 'soldiers' in your base and slide to the enemy with also 10 'soldiers' then 5 'soldiers of yours walk to the enemy and the enemy base gets -5 'soldiers'.
but this is not working properly... when I slide from my base to the enemy and there is only 1 group of soldiers 'walking' then the enemy gets less, thats good. but when I send 2 groups of soldiers (fast after each other) its doesn't work good...
lets say the base his 'soldiers' is 100. when you slide to the enemy twice the first 'group of soldiers' is 50 and the second 25.
but the base gets 50. so after you send the second group it should be 25 but its 50...
and when the first group gets to the enemy base the enemy base gets +25 (because of the second group) but the first group is 50 so it should be +50. Im using a table.
PM me if you think you can help would be really appreciated...
thanks!
-Timo-
I am working on a war game, you have a 2 bases, the enemy has 2 bases and there is 1 neutral base.
every second every base gets 1 soldier more (just a number) when you slide from a base to another base the 'soldiers' walk to the base you slide to. when you slide to your own base the 'soldiers' in that base gets more and when you slide to an enemy or neutral base the 'soldiers' get less. (so when you have 10 'soldiers' in your base and slide to the enemy with also 10 'soldiers' then 5 'soldiers of yours walk to the enemy and the enemy base gets -5 'soldiers'.
but this is not working properly... when I slide from my base to the enemy and there is only 1 group of soldiers 'walking' then the enemy gets less, thats good. but when I send 2 groups of soldiers (fast after each other) its doesn't work good...
lets say the base his 'soldiers' is 100. when you slide to the enemy twice the first 'group of soldiers' is 50 and the second 25.
but the base gets 50. so after you send the second group it should be 25 but its 50...
and when the first group gets to the enemy base the enemy base gets +25 (because of the second group) but the first group is 50 so it should be +50. Im using a table.
PM me if you think you can help would be really appreciated...
thanks!
-Timo-
Answers
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
Problem 1:
if the soldiers in your base are 100 and you send 2 'groups of soldiers' then the first group will be 50 soldiers and the second group will be 25 soldiers. when the first group (50 soldiers) arrives at the enemy base there should be removed 50 soldiers. but there are 25 soldiers removed...<- not good. and when the second group (25 soldiers) arrives they also remove 25 soldiers(<- is good)
Problem 2:
this is hard to explain but I will try if you have 100 'soldiers' in your base and you send a group of soldiers then there will be spawned a square(the soldiers) on the base. when this collides with a base you get the soldiers in your base. so when you have 100 and you send 50 to a base of with 50 soldiers they have 100 soldiers. so when you spawn you also get them back to your own base... I fixed the first group of soldiers you send but when you send the second group of soldiers you get them also in you own base and also in another base...
Download link: https://www.dropbox.com/s/h0ahk05wslxxyhq/War game.zip
if you try what I explained you will see the problem
I really hope someone can help me!
Thanks
-Timo-
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮
✮ FREE templates at GSinvention ✮
✮ Available for hire! support@gsinvention.com ✮