would this be possible

crackhead

Newbie
Joined
Nov 25, 2004
Messages
2,148
Reaction score
0
im new to coding an i was wondering. my mod is a 3rd person perspective fantasy role playing game with swords. would it be possible to make it so that while you hold down a certain key it makes the player do a blocking animation and will block the enemys attack and not take any damage?
 
It's certainly possible, but a little difficult, I guess. I've never really looked into holding down buttons, though, but look at where the crouch stuff works.

-Angry Lawyer
 
It depends how you would want it.

If you wanted to simply make the player invincible when blocking then its possible. Similar to how the crouch key works, holding down the desired key would just have a key animation (just like crouching has an animation), and then a command would make the player invincible. Of course, that could lead to many problems I can already thinkg of, like blocking underwater would make you invincible and therefor unable to drown.
 
well theres not going to be any underwater bits probally. the thing is say an enemy comes up behind the player and attacks him while you holding down the block key then its gonna look stupid. also it needs to only work when you have a weapon out. would it be possible to make like an invisible sheild that triggers when you have a weapon out and you hold down the block key and when you let go of the block key it dissapears?
 
crackhead said:
well theres not going to be any underwater bits probally. the thing is say an enemy comes up behind the player and attacks him while you holding down the block key then its gonna look stupid. also it needs to only work when you have a weapon out. would it be possible to make like an invisible sheild that triggers when you have a weapon out and you hold down the block key and when you let go of the block key it dissapears?
Why would you want that shield if it's invisible?? You might as well just make it so the player just doesn't take the damage.
 
while your at it, make the player fly around, and give him a big yellow S on his shirt, ooo, and a cape.

... also, put underwear on the outside of his pants, so enemies know not to mess with him
 
lol shutup. in reply to childeroland, the thing is if ur facing north and blocking and then someone comes up behind u and stabs your or wateva then its gona be unrealistic if you dont take any damage isnt it.
 
Then you'll have to set up a dynamic coordinates system where the coordinates move on their axes depending on player facing angle, check the landing coordinate of the enemy attack and cross-reference it with the coordinates you set up. If (landCoord == shieldCoord) attack() = 0;
 
Of course you could also just use a hit box. That is alot simpler, although not as accurate (not that that's important with swords).

Besides, FPS games are made with guns in mind. Melee is difficult to do, especially in a multiplayer environment.
 
its not multiplayer what does hitbox meen and how and where would i implement the code if that makes sence
 
i started learning c++ but itr was like nothing to do with computer games and i sort of lost interest i guess. do you know of any good books that i should read now that im past the begginer hello world and stuff ?
 
Heh, cout isn't even used in the SDK.

http://www.cplusplus.com/doc/tutorial/

Learn 99% of the stuff on this website and you can begin programming.

cout << "Hello World!\n"; doesn't cut it.

Edit -
i started learning c++ but itr was like nothing to do with computer games

C++ has everything to do with computer games. There's no magic program you can download that makes things happen.
 
Pesmerga said:
C++ has everything to do with computer games. There's no magic program you can download that makes things happen.

word.
______________________________________________________________
 
haha i wrote a simple game in C++ using OpenGL once, the code was 100kb >.< Basically you were a tank and went around shooting a bus. Problem was, the animation was frame-based rather than time-based, it was written on a very slow computer, so i was shocked at how fast it ran on my new computer.
 
yeh i know just like the books i bought for c++ didnt seem to have anything to do with games
 
Back
Top