Page 1 of 1

two last problems...

PostPosted: Mon Jun 02, 2008 11:40 am
by Kooldudese
im learning alot from you guys on this forum, and im almost finished my first game :roll: took me awhile but im still quite proud of myself =P, after all i am only cough*14* anyway, my point,
there are two last problems i need for someone to help me with, the first is:
when the actor is attacking the other actor, it creates an actor, that does the
dmg, according to the variable called dmg1p/2p (depending on which actor is getting hit)
the problem i have right now is that i cant decide on the collision event of the actor getting hit to put it on either collide event as enable repat, or disable repeat, what happens when i disable is that when the actor called dmg1p/2p collides with the actor getting hit, the first time everything is fine, the damage is delt and everything, but if both actors stay in the same place again, the damage wont be delt, until the actors move away from each other, and come back into place.

im not sure if that was clear, ill try to explain it again XD ok... hmm

for example,player one is called 1 (how original i know)
the other player(player two) is called 2 (XD)
the variable to do damage to the first player is dmg1p
and the actor that takes the variable number and does the damage when it collides with the player one (which is going to be the actor getting delt damage in this example)is called damage1p
ok, heres the example hopefully your with me,
player one is standing there being stupid =)
player two comes up, and attacks, (if you need a visual picture, he swings a sword)
when he swings this it will create an actor called damage1p in the position player two is at
and the damage delt to player one is equivalent to dmg1p (which is set by which key is pressed by player two/which attack)
the problem i have is that the second time he swings in the same position the player one doesnt get damaged.
any resolutions to this problem? or mabye its just because i've only tested this with an AI, and mabye i created the AI wrong and it created that glitch...ok, the second problem should be easier.

i'm trying to make a game like those 1on1 fighting games ( for example there are guiltygearX,marvelversuscapcom,etc.)
anyway, in the beggining of the fight, the actors fighting have the events disabled so they cant move, and i want to have a timer with an animation of something like (3...2...1...fight!) and the events are enabled at this time... if someone can post a demo i'd be greateful, and of course, ill giv you a point for anyone that can help me with my last two problems :D
I'M finnally close to done my first game...

Re: two last problems...

PostPosted: Mon Jun 02, 2008 4:52 pm
by DST
Ok, so player 2's sword is what hits player 1. Player 2 does not collide with player 1, only his sword does. (in this problem)
If collision is set NOT to repeat, then the sword must move away from player 1 and then collide with him again to do damage once again.

Now if you use DestroyActor on the sword after it has swung, it should disappear, and collision will stop.
Then if you create the sword a second time, it will then collide again, all of this on collision set NOT to repeat.

At least, that's what should be happening.

Second Problem: Use Event Disable EVENTKEYDOWN on player 1 and player 2 when match starts. When countdown timer reaches 0, send another timer to both players that Enables all Events. At the same time, when the countdown timer reaches 0, after sending the timers, it can then Disable itself.
And also, when one player's health is at 0, you can reenable the timer and once again Disable EVENTKEYDOWN for player 1 and player 2.

Tiny timers, like 20 ms are very good for sending events, because they affect clones and not just a single actor like an activation event would. Also, when several actions are being performed in one script, the 20ms delay means the timer happens after all the rest of the script, which is good, because you can now control the order of events, while at the same time 20ms is too small for the player to ever notice.

Re: two last problems...

PostPosted: Tue Jun 03, 2008 3:37 am
by Bee-Ant
Well, I think i need time to read your too long text. :lol: