Player Location

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Player Location

Postby frostywinters » Mon Mar 13, 2006 2:38 pm

Hey im a bit new to the whole game engine world but in true little jimmy learns to swim style im going to jumpm in at the deep end!!

Can anybody please tell me where the code for player location during game play is located in the game source code?? I basically want to change this so the location is set to x y z coordinates i set during the game!!

I know this sounds strange but all will be revealed if it works!!!

Also once i have modified this code, im going to need to compile my version of the source?? How do i do this, so i get the Nexuiz game just as you would download it without modifications, but with my modifications in the n ew compiled code?? Answers on a postcard please!!

PS on an aside note, Nexuiz i very impressive!!
frostywinters
Newbie
 
Posts: 5
Joined: Mon Mar 13, 2006 2:30 pm

Postby Ed » Mon Mar 13, 2006 3:36 pm

You wouldn't do that in the engine code. QC would be where to do that.
Ed
Forum addon
 
Posts: 1172
Joined: Wed Mar 01, 2006 12:32 am
Location: UK

Re: Player Location

Postby KadaverJack » Mon Mar 13, 2006 8:01 pm

frostywinters wrote:Can anybody please tell me where the code for player location during game play is located in the game source code?? I basically want to change this so the location is set to x y z coordinates i set during the game!!

Like Ed said, this is done in quakec code not the engine itself. Unzip gamesource15.zip and go to Nexuiz/qcsrc-15/server/gamec. You probably want to add this in clientcommands.c, so you can something like "cmd foo x y z" ingame on the console. (btw: the function you'll need it setorigin)

Also once i have modified this code, im going to need to compile my version of the source??

Yes you do... You'll need fteqcc. Just download the compiler, place it inside Nexuiz/qcsrc-15/server and run it. If everything went well that will give you 2 files: Nexuiz/progs.dat & Nexuiz/progs.lno. Move them into Nexuiz/data, run Nexuiz and see how it works.

Answers on a postcard please!!

Sorry, i couldn't find any stamps around here, this post must do :D
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby leileilol » Mon Mar 13, 2006 8:25 pm

setorigin should do the trick.
field hockey
leileilol
Alien trapper
 
Posts: 299
Joined: Tue Feb 28, 2006 10:00 pm
Location: pole vaulting

Postby frostywinters » Tue Mar 14, 2006 5:26 pm

Thanks for your help guys, just one more thing, does quakeC support input streams?? I was talkin to a guy in the Inside3D forum and he said that it didnt??

See what im tryin to do is read in xyz coordinates from a server (the server is connected to a location system called ubisense which can tell where i am in a building) then put those coordinates in the nexuiz game (which will have a map of a real world building) so as i move around a building the player in the nexuiz game will also move around its virtual building!!

So thats why i need input streams and if quakeC doesnt support them methinks im screwed!!!
frostywinters
Newbie
 
Posts: 5
Joined: Mon Mar 13, 2006 2:30 pm

Postby KadaverJack » Tue Mar 14, 2006 7:48 pm

frostywinters wrote:Thanks for your help guys, just one more thing, does quakeC support input streams?? I was talkin to a guy in the Inside3D forum and he said that it didnt??

No, qc does indeed not support input streams. You either have read the coordinates from a file using fopen/fgets or you have hack the engine to read the data from a stream and put it into cvars so you can access it from inside the qc vm...
With the upcomming 1.5.1 version, you could also write and external app, that reads the stream and sets cvars on the server using rcon.
And a forth possibility would be using divVerent's "rubyplaces" frontend and write a plugin for that to read the input: http://www.forums.alientrap.local/viewtopic.php?t=39

See what im tryin to do is read in xyz coordinates from a server (the server is connected to a location system called ubisense which can tell where i am in a building) then put those coordinates in the nexuiz game (which will have a map of a real world building) so as i move around a building the player in the nexuiz game will also move around its virtual building!!

Sounds funny :)

Edit: actually another way to accomplish your goal: write a "fake" client that updates your position ingame... that way your movement will be anymated and not so choppy like when you are using setorigin.
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby esteel » Tue Mar 14, 2006 8:07 pm

What kind of streams? In a c++ sense? You can access files with DarkPlaces.. if that enough..
Last edited by esteel on Thu Aug 31, 2006 2:54 pm, edited 1 time in total.
esteel
Site admin and forum addon
 
Posts: 3924
Joined: Wed Mar 01, 2006 8:27 am

Postby frostywinters » Wed Mar 15, 2006 2:49 pm

esteel wrote:What kind of streams? In a c++ sense? You can access files with DarkPlaces.. if that enough..


Hey there esteel, ok im gona go very low level because performance isn't that big of a deal.
So im using simple java sockets to read in a String containing the xyz coordinates from the server and store them in a .txt file, this file will be updated every few seconds as the xyz coordinates change. So all i need to do is create an input stream to read in these coordinates from the txt file to the game. So i guess a simple input stream will do, can darkplaces make this posible??
frostywinters
Newbie
 
Posts: 5
Joined: Mon Mar 13, 2006 2:30 pm

Postby frostywinters » Wed Mar 15, 2006 2:55 pm

Also Kadavar Jack thanks for the tips!! Your keepin me motivated here!!
frostywinters
Newbie
 
Posts: 5
Joined: Mon Mar 13, 2006 2:30 pm


Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron