Lost + found

Post your scripting questions / solutions here

Moderator: Moderators

jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Impossible, sorry :(
Image
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

humm..I wonder how those guys of CI did the trick...
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

You need to either use an external DLL or a 3rd party software to do it. Either way requires quite some programming knowledge.

You could also look at the unofficial 1.12 patch, they have injected the piece of code to retrieve player names in script IIRC.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

You could also look at the unofficial 1.12 patch, they have injected the piece of code to retrieve player names in script IIRC.
ooh ty very much!! I will have a look! actually I've made a little 3rd part application to read player list from status and fill some cvars with slots player names, ip and I've implemented it with some scripting to link slot numbers to $player elements..but this is not good cause I would like to make this only via scripting or only via programming..
well ty m8 :wink:
Snipie
Private
Posts: 2
Joined: Mon Dec 19, 2011 9:24 am

5th map crash

Post by Snipie »

Hi all.
I have a spearhead server and I run 9 maps each one with his own mod.
When I've added the last map (Omaha) I found the server started to crash when the 5th map is finished. I tought it could be caused by the 5th map mod (The Hunt) so I tried to move this map at the very beginning of the maplist but when testing I discovered the problem was not in The Hunt mod because it was running good and not crash the server but again when the 5th map (that now is Malta) finished the server continue crashing. I load the script for each map using this script that is executed in DMprecache.scr.

Code: Select all

main:	
	local.map = getcvar(mapname)
	switch(local.map)
	{
		case "dm/MP_Stadt_DM":
			println ("LOADING SCRIPT FOR MAP: dm/MP_Stadt_DM")
			thread Stadt
			break
		case "obj/MP_Ardennes_TOW":
			println ("LOADING SCRIPT FOR MAP: onj/MP_Ardennes_TOW")
			thread Ardennes
			break
		case "obj/MP_Berlin_TOW":
			println ("LOADING SCRIPT FOR MAP: obj/MP_Berlin_TOW")
			thread Berlin
			break
		case "dm/mohdm5":
			println ("LOADING SCRIPT FOR MAP: dm/mohdm5")
			thread mohdm5
			break
		case "dm/mohdm2":
			println ("LOADING SCRIPT FOR MAP: dm/mohdm2")
			thread mohdm2
			break
		case "obj/MP_Flughafen_TOW":
			println ("LOADING SCRIPT FOR MAP: obj/MP_Flughafen_TOW")
			thread Flughafen
			break
		case "dm/MP_Malta_DM":
			println ("LOADING SCRIPT FOR MAP: dm/MP_Malta_DM")
			thread Malta
			break
		case "obj/MP_Druckkammern_TOW":
			println ("LOADING SCRIPT FOR MAP: obj/MP_Druckkammern_TOW")
			thread Druckkammern
			break
		case "obj/obj_team1":
			println ("LOADING SCRIPT FOR MAP: obj/obj_team1")
			thread obj_team1
			break
		case "obj/obj_team4":
			println ("LOADING SCRIPT FOR MAP: obj/obj_team4")
			thread obj_team4
			break
		case "obj/obj_team3":
			println ("LOADING SCRIPT FOR MAP: obj/obj_team3")
			thread obj_team3
			break
		default:
			println ("ERROR WHILE LOADING SCRIPT FOR MAP: " + local.map)
			break
	}
	
	exec global/messaging.scr
	
end

Stadt:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_Stadt.scr

end

Ardennes:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_Ardennes.scr

end

Berlin:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_Berlin.scr

end

mohdm5:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_mohdm5.scr

end

mohdm2:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_mohdm2.scr
	
end

Flughafen:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_Flughafen.scr

end

Malta:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_Malta.scr

end

Druckkammern:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_Druckkammern.scr

end

obj_team1:
	
	//here we add all addons and objects to the map
	
	waitexec global/Addon_The_Hunt.scr
	
end

obj_team4:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_obj_team4.scr

end

obj_team3:

	//here we add all addons and objects to the map
	
	waitexec global/Addon_obj_team3.scr

end
The strange fact is that this issue started when added obj_team3 (Omaha) map. But it has apparently no sense that a map can cause the crash of the server when another map is finished...Also I'm not running variables that does affect the entire game (game.var) in Omaha scr. The only script that contains game.vars is messaging.scr but this works good since I started the server and never been edited and once is executed when the server starts then it's no longer executed (even if you read exec global/messaging.scr above) cause it's only executed when a game.var is == NIL and when executed once the script sets this value to 1...
I don't find a reason of this crash. What do you think about this?
Snipie
Private
Posts: 2
Joined: Mon Dec 19, 2011 9:24 am

Post by Snipie »

I've found that the map causing crash is malta..
Here is what console log says:

Code: Select all

Cvar_Set2: com_errorMessage Info_SetValueForKey: oversize infostring
********************
ERROR: Info_SetValueForKey: oversize infostring
********************
----- Server Shutdown -----
==== ShutdownGame ====
Cvar_Set2: session 2
Cvar_Set2: g_scoreboardpicover 
Cvar_Set2: bosshealth 0
Cvar_Set2: g_scoreboardpicover 
Cvar_Set2: sv_running 0
---------------------------
I don't post the full logfile cause it's a lot big! lol
What's this error??
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

What about .entnum? I thought that covered it.
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Well, yes, if you did monitor all incoming and leaving players and cached their entnums, you could go from slot number to the player entity.

To those unknowing, the convention in the Quake engines is that the first 64 entity slots are always players, i.e. entity number == player slot number.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

$oldier Of Ra wrote:What about .entnum? I thought that covered it.
Yes I've found it casually when trying to find a way to turn slot to player arr index..
I would like to know 1 more thing guys. Don't want to start another thread for this. I'm just curious!
I've read that STWH is done renaming maps..or something like this. is it right? Doesn't moh check the checksum of the map??!
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

It sends a checksum which is baked into the BSP file's header, so the only good it's for is to check if client and server are really running the same map. Security checks using that would be insanely naive.

One of the many ways to achieve STWH (I personally did it another way when I was researching the subject) is to edit the BSP file in a certain way, but for obvious reasons I will not disclose them. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

Yeah I see what you mean man. :)
I 'll try to find out a way on my own. wish me good luck! lol :wink:
Jere
Private
Posts: 7
Joined: Tue Dec 20, 2011 2:51 pm

Object facing angle

Post by Jere »

Hi I made a surveillance camera, but I do not know how to rotate it to look at an origin. I tried the function lookat but it didn't work (it is a script_object).
How do you set a script_object facing angle to rotate it? By the way how do I get an entity coords and rotation in separate variables? Thanks in advance
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think you can set the angles property. Working out the right angles is a bit tricky though.
Image
Jere
Private
Posts: 7
Joined: Tue Dec 20, 2011 2:51 pm

Post by Jere »

Hi JV and thanks. My question was wrong. I wanted to ask how could I get this angle, so i could rotate the camera (script_object) to make it look like it is pointing to the script_origin. I think it can be done by a mathematical formulae, but I don't know it. Anyone know how I could work this out? sorry for bad English
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes it's possible to derive a formula. It won't be really easy though, to give you an idea have a look at the wikipedia article on the subject.

http://en.wikipedia.org/wiki/Euler_angles

Fortunately you can probably get away with using the built-in function angles_pointat. See its documentation here http://gronnevik.se/rjukan/uploads/Main ... asses.html (search for "angles_pointat").
Image
Locked