Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 79 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Element on players in compass
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 05:44 pm
Hi everybody [wave]

I would like to show a star on players of a specific team in the compass. It's like when somebody gets the flag in the ctf gametype, you see on the compass who have it and where he moves, only that i want to show a star, and all the time, not when something specific happens.



I searched at the ctf.gsc but didnt find nothing helful to make my own compass elemnt.

Does anybody have an idea or knows how to do it?

Yours truly
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 05:48 pm
well if u want to go with the way every other zombie server has then take a look in a zom.gsc, but a wise friend of mine told me that it only sets on 15 players because thats all it only allows so only 15 players can be seen on the compass for you sir nothing more.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 05:51 pm
Maybe looking at the sript where the green spires are programmed, which show your teammates in the compass.

I searched for it but didn't find anything, does somebody know where it is?
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 06:45 pm
The green player triangles are hard-coded - they are not editable (except changing the image file which affects all of them).

The compass icons are called objective icons - look in ctf.gsc for how they are used there. Search for objective and check out the functions in the script docs beginning with objective_

You can set an icon to appear at a coordinate position in the map and get it to track a player by having a loop that updates it location.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Nov. 26, 2010 08:29 pm
Okay i will try, now i got that the objective appears when a allied spawns... xD. Need to make the origin update and that only axis see this objectives.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Nov. 27, 2010 09:21 am
I got it to update, and to delete if the player is not alive (with a simple if), but, if the player disconnects, the objective still is there. How to avoid this?
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Saturday, Nov. 27, 2010 09:41 am
Use a seperate thread to monitor when the player disconnects.

e.g.
Code:

OnDisconnect()
{
	self waittill( "disconnect" );
	objective_delete( self.objID );
	/*
		any other code 
	*/
}
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Nov. 27, 2010 09:58 am
And from where should i call this thread?
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Nov. 27, 2010 12:03 pm
There is an other problem now. This position update "for" makes that the player is not able to change weapon, team, and the next two options apart from exiting the game.

Code:
		for(;;)
		{
			objective_position(num, self.origin);
		
			if(!isAlive (self) )
			{
				objective_delete(1);
				return;
			}
		
			wait .3;
		}


Why?
Share |
Pedro699
General Member
Since: Jun 19, 2006
Posts: 781
Last: Dec 18, 2010
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, Nov. 27, 2010 12:54 pm
Where are you running the code?

It should have its own thread so it does not interfere with any other script.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»