0 registered members (),
1,397
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
online team shooter "Survive!" full sourcecode release
#298094
11/11/09 22:10
11/11/09 22:10
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
OP
User
|
OP
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
As I've frozen this project, I'm releasing the full source code of the last release, Version 0.57. Original thread.The game is programmed in C-Script, but a nearly done lite-C conversion is also included. Maybe you can find the remaining bugs. Please read the "GUIDE TO CODE.txt" file before asking questions here.Most models are missing because I don't have the right to distribute them. Check the guide on options how to get around this. Download Survive! V0.57 sourcecode via rapidshare.com alternative download mirrorRead GUIDE TO CODE (also included in the above ZIP file) If you have questions, please ask them in this thread so others can find the answers, too. - Schokokeks
|
|
|
Re: online team shooter "Survive!" full sourcecode release
[Re: Cowabanga]
#298139
11/12/09 12:59
11/12/09 12:59
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
OP
User
|
OP
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
Nice, maybe I can try to translate it to Lite-C. You'd only have to debug the Lite-C conversion that it included in the package. The biggest bug i can remember right now is that the weapons that the player hold in their hands don't show up or don't move with them, although the code looks perfectly right. maybe there is a problem with the you pointer.
|
|
|
Re: online team shooter "Survive!" full sourcecode release
[Re: SchokoKeks]
#308410
02/03/10 09:14
02/03/10 09:14
|
Joined: Oct 2005
Posts: 196
ambe
Member
|
Member
Joined: Oct 2005
Posts: 196
|
I didnt quite undrestand how you attached the guns to the players with out creating lagg. could you fill me inn ? ;P
- code monkey
|
|
|
Re: online team shooter "Survive!" full sourcecode release
[Re: ambe]
#308491
02/03/10 13:40
02/03/10 13:40
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
OP
User
|
OP
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
sure: it is important that the weapons are not "networked" entitys, that would be a total waste of bandwith. on every client, create them with ent_createlocal(..) for every player. I've used proc_local to start functions for every player entity, that is a very helpful function, look it up in the manual if you don't know it yet. give them the following function: (through ent_createlocal of course)
function attached_wp_act()
{
set (me, PASSABLE);
set (me, UNTOUCHABLE);
proc_mode = PROC_LATE; // important part: keeps the gun from lagging one frame behind!!
while (you)
{
if (you == NULL) {break;}
vec_for_vertex(my.x, you, 5); // position at vertex 5 of player, change to fit your model!!
vec_set (my.pan, you.pan); // make it point into the same direction as the player
wait(1);
}
ent_remove(me);
}
this is from the lite-c code, it might not work correctly, but it should
|
|
|
Re: online team shooter "Survive!" full sourcecode release
[Re: SchokoKeks]
#308494
02/03/10 13:47
02/03/10 13:47
|
Joined: Oct 2005
Posts: 196
ambe
Member
|
Member
Joined: Oct 2005
Posts: 196
|
But how would the other players see this gun if its created locally?
I'm having my first crack at mp programing and as it is now it all seems like magic to me..
- code monkey
|
|
|
Re: online team shooter "Survive!" full sourcecode release
[Re: ambe]
#308507
02/03/10 14:19
02/03/10 14:19
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
OP
User
|
OP
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
thats what proc_local() does. use proc_local once in the main player function that runs on the server. proc_local starts a function for the entity it is called for on ALL clients. In that function, every client creates it own instance of the weapon. they (hopefully) all look and behave the same, and the player won't notice they are not synchronized over the network. have you done and understood the multiplayer workshop (25) ?
|
|
|
Re: online team shooter "Survive!" full sourcecode release
[Re: SchokoKeks]
#308513
02/03/10 14:43
02/03/10 14:43
|
Joined: Oct 2005
Posts: 196
ambe
Member
|
Member
Joined: Oct 2005
Posts: 196
|
Edit- disregard that, all i really need to know is how did you make the different clients able to show different weapons?
Last edited by ambe; 02/04/10 17:56.
- code monkey
|
|
|
Re: online team shooter "Survive!" full sourcecode release
[Re: ambe]
#308728
02/04/10 17:57
02/04/10 17:57
|
Joined: Oct 2005
Posts: 196
ambe
Member
|
Member
Joined: Oct 2005
Posts: 196
|
Edit-- sorry double post
Last edited by ambe; 02/04/10 17:57.
- code monkey
|
|
|
|