question

New Member
Joined
Dec 11, 2001
Messages
23
Best answers
0
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 [email protected]
 
New Member
Joined
Nov 24, 2001
Messages
692
Best answers
0
Check out pm_shared.c, and figure it out yourself :)
Hint: look how swimming is done....
 
New Member
💻 Oldtimer
Joined
Nov 26, 2001
Messages
1,428
Best answers
0
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
 
New Member
Joined
Nov 24, 2001
Messages
692
Best answers
0
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 :)
 
New Member
Joined
Dec 11, 2001
Messages
23
Best answers
0
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..
 
New Member
Joined
Jan 13, 2002
Messages
9
Best answers
0
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
 
New Member
Joined
Nov 24, 2001
Messages
692
Best answers
0
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 :)
 
New Member
Joined
Jan 13, 2002
Messages
9
Best answers
0
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......
 
New Member
Joined
Nov 24, 2001
Messages
692
Best answers
0
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 :)
 

Users who are viewing this thread

Top Bottom