View Full Version : question
imported_Mirai_Trunks
01-10-2002, 10:15 PM
hey does anyone know how to make your guys fly? cuz no one responed to my last one ^_^ sorry i just would like to know. If any coders can help me out i would be greatful.
Thanks alot!!!
you can reply to this thred or email me at cotf@saiyan.com
Deverz
01-11-2002, 03:23 AM
press F
imported_Mirai_Trunks
01-11-2002, 03:58 AM
I mean like the c++ code for it. not the key its self. hehe
harSens
01-11-2002, 05:00 PM
Check out pm_shared.c, and figure it out yourself :)
Hint: look how swimming is done....
BrunO
01-11-2002, 07:07 PM
Sure isnt that basically all swimming is, flying in a predefined area? Im not a coder but would seriously want to learn C++ got any good free compilers and tutorials for a wanna b harSens? ;)
BrunO
harSens
01-11-2002, 10:13 PM
Free compilers for DOS (handy to learn C++ in)
www.borland.com (check the museum)
www.delorie.com
Free compiler for Windows
http://www.mingw.org/
Haven't actually tried it, but i heard some good stories about it. After insane tweaking it should be able to compile the serverside halflife code.
For tutorials, i heard www.cplusplus.com is pretty decent. I sometimes use it as a reference. But i recommend you go to your library and get yourself a book :)
imported_Mirai_Trunks
01-13-2002, 12:54 AM
i've looked threw the pm_shared.c and i still can;t figure out what to put.. i've been thinking about it for a few days and still can't come up with something... i donno how to code for games very well or i'm just a retard..
dosap
01-13-2002, 07:44 PM
Okay to make a person fly is really easy and you can do it in 3 steps.....
1. CBasePlayer *Player;
2. Player->movetype = MOVETYPE_WALK; or in your case MOVETYPE_FLY
3 make a function using boolean to toggel one or off:
if(fly == true)
{
Player->movetype = MOVETYPE_WALK; // if player is flying and press it again, makes the person walk.....
}else{
Player->movetype = MOVETYPE_FLY; // if person is walking make person fly if press....
}
this is the best method i believe, since if you check if the player is flying or not, you can have a major bug with the water ent, because if you are in water your move type is fly and it sets the anim to swim......... i hope the that helps
harSens
01-13-2002, 09:20 PM
You're close, but that won't work, because half-life uses MOVETYPE_FLY for laddders. You need to define your own MOVETYPE for flying (say MOVETYPE_PLAYERFLY). Then open pm_shared.c, search for the function PM_PlayerMove(), add the line:
case PM_PLAYERFLY:
in the switch statement. You should be able to figure out what should be under it, by reading the other cases. Create your own PM_PlayerFlyMove (just copypaste the PM_WaterMove and modifie it a bit) function, and call it there. For the switching, see the post above :)
dosap
01-14-2002, 01:23 AM
Originally posted by harSens
You're close, but that won't work, because half-life uses MOVETYPE_FLY for laddders. You need to define your own MOVETYPE for flying (say MOVETYPE_PLAYERFLY). Then open pm_shared.c, search for the function PM_PlayerMove(), add the line:
case PM_PLAYERFLY:
in the switch statement. You should be able to figure out what should be under it, by reading the other cases. Create your own PM_PlayerFlyMove (just copypaste the PM_WaterMove and modifie it a bit) function, and call it there. For the switching, see the post above :)
i seen MOVETYPE_FLY used in many things besides ladders...:
it's used in the RPG rocket, Flying Half-life monsters
Half-Life Crossbow bolt's and other things that fly....
MOVETYPE_FLY is just something that is defined in a switch statement like you said and it calls up another member but etheir way.... MOVETYPE_FLY callls the physics to make you fly......
harSens
01-14-2002, 04:28 PM
Ok... let me rephrase that. For players, half-life uses MOVETYPE_FLY in ladders. It sets it back to MOVETYPE_WALK after you leave the ladder. But you might try setting it, maybe stuff has changed in SDK2.2 :)
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.