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

Members Online

»
0 Active | 12 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

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: Crosshair in thirdperson & xmodel collision
n3BuL
General Member
Since: Nov 10, 2008
Posts: 44
Last: Jul 2, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Jan. 1, 2010 05:30 pm
I'm making a mod for CoD2 where all players are boxes, and maps are full of boxes so you can hide yourself.
The mod is originally made for Half-Life and is called Boxwar (I'm trying to find the creator's email to ask for permission, so if anyone knows it, please let me know).
The mod is played in thirdperson, so you can position yourself among the other boxes easier - but there are a few problems with this..

1. While being in thirdperson, the crosshair is gone - How do I prevent the crosshair from disappearing?

2. While being a box, the weapon is still shown, how can I remove it ?
I tried searching a bit and found something which might would help (http://modsonline.com/Forums-top-100698.html) - altering the weapon files - would it work or not ?

3. The players are boxes, but you can only kill them with a nade - you will shoot right through them if you try with a normal weapon.
Is this caused by the xmodel files not having collision files / hitbox ? If it is, wouldn't it be possible to make such files ?


Sorry for the dark picture, forgot to put more lights in the map :P

I don't want you to make the mod for me, since I'm still trying to learn - it would be better to give me tips on how to do it and then let me test myself :d.
Share |
sherlokpwnz
General Member
Since: May 1, 2009
Posts: 95
Last: Jan 13, 2010
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Friday, Jan. 1, 2010 07:45 pm
Are you using the same images and content as the original author? If you are then you would have to ask permission before getting help however since this is a different game they can't stop you from creating it from scratch so if you have come up with the images and textures yourself then don't worry about asking for permission. Just don't name it the same.
Share |
n3BuL
General Member
Since: Nov 10, 2008
Posts: 44
Last: Jul 2, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Friday, Jan. 1, 2010 08:06 pm
Well.. the models are from standard CoD2, and I know I could just rename it to something like.. Cratemod ? .. But I don't want to do that since the person made the mod already for another game, so he should be credited anyways. I'm sending emails to a couple guys, and I might have found the correct one now. If I fail to find him, I will rename it, since the name is pretty much the only thing it has in common (and then of course the concept of players being boxes).

Update: I found the creator of the mod, and got full permission to create this - as long as it remains free and is not for profit of any kind.
Share |
n3BuL
General Member
Since: Nov 10, 2008
Posts: 44
Last: Jul 2, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Tuesday, Jan. 5, 2010 12:22 pm
Could still use some help ;p especially at number 3.

Also, another thing I would like to do. When dying, it should replace the dead box (which you can walk through), with a static box (solid).
Can this be done with something like..
Code:
self delete();
addmodel("xmodel\xxxxxx") self.origin

if not, is it even possible to do that? :D
Share |
tHMatt
General Member
Since: Sep 11, 2007
Posts: 473
Last: Mar 20, 2013
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Tuesday, Jan. 5, 2010 12:37 pm
n3BuL writes...
Quote:
Could still use some help ;p especially at number 3.

Also, another thing I would like to do. When dying, it should replace the dead box (which you can walk through), with a static box (solid).
Can this be done with something like..
Code:
self delete();
addmodel("xmodel\xxxxxx") self.origin

if not, is it even possible to do that? :D


You cannot spawn collision in cod2.
Share |
n3BuL
General Member
Since: Nov 10, 2008
Posts: 44
Last: Jul 2, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Tuesday, Jan. 5, 2010 12:41 pm
Then how about making a map with a couple of scriptmodels dedicated for this problem, and make one of the scriptmodels, go to "self.origin", when a player dies?
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Tuesday, Jan. 5, 2010 04:06 pm
possible, but you'll need as many collision script_brushmodels as players / dead bodies are on the map
Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Thursday, Jan. 7, 2010 01:23 am
You could just start reusing them after a certain number of "dead" boxes are on the map.

And if you're going to do that, you may as well attach trigger_damages onto that to compensate for the lack of hitboxes and script some kind of fancy health system, less so if you disallow health regen.

And for the crosshair, you can try a makeshift one with a new hud element I suppose.
Share |
n3BuL
General Member
Since: Nov 10, 2008
Posts: 44
Last: Jul 2, 2010
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Thursday, Jan. 7, 2010 10:24 am
clanhelio writes...
Quote:
And if you're going to do that, you may as well attach trigger_damages onto that to compensate for the lack of hitboxes and script some kind of fancy health system, less so if you disallow health regen.

Great idea with attaching trigger_damage !
Can it be done by making 64 (max clients available) of them - each of them with targetname "player_hitbox".
Then in a script (fx in a place with "onplayerconnect"), write:

Code:
hitbox = getentarray("targetname", "player_hitbox");
hitbox enablelinkto();
hitbox linkto self(); // Is it possible to use "self" here? or would you have use "player" or anything else?

I'm not that good at using getentarray yet - so is it correct in this situation?[ohwell]
I did already make a health system with a health bar - so you aren't able to regenerate health just by hiding/waiting.

About the static dead "body":
Code:
init();
model = getentarray("targetname","static_model");
player = getentarray("player","classname");
while(1)
{
for (i = 0; i < player.size; i++)
{
player[i] getEntityNumber()
player[i] thread deadbox();
wait 0.1;
}
}

deadbox()
{
model[i] getEntityNumber()
model[i] moveto(player[i].origin, 0.1);
wait (60);
model[i] moveZ(-300,0,0,1);
model[i] waittill ("movedone");
}


Or would I need something which classifies the [ i ] in "model[ i ] ? This was written in 5 minutes, so there might be some errors in it :)
Share |
clanhelio
General Member
Since: Aug 30, 2008
Posts: 223
Last: Mar 24, 2011
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Jan. 8, 2010 06:02 am
Holding off on the dead boxes for a moment (as you should ensure you get everything else done right first)

Right here everything will be set up, it assumes:
-You made a number of the boxes all somewhere out of sight while they wait
-You made each box set (the box xmodel, the player clip, and trigger_damage) each one at a time, i.e. the 1st player clip belongs to the same box set ad the 1st trigger_damage and the 1st box xmodel.
Code:
boxsetup()
{
	hitbox = getentarray("targetname", "player_hitbox"); //trigger_damage
	colbox = getentarray("targetname","player_colbox");  //player clip
	model = getentarray("targetname","player_model");    //actual box script_model
	
	for (i = 0; i < hitbox.size; i++)
	{
		hitbox[i] enablelinkto();
		hitbox[i] linkto(colbox[i]);
		model[i] linkto(colbox[i]);
		colbox[i].isinuse = 0;        //set all boxes as not belonging to any players
	}
}

That sets everything up

This will establish the boxes players will be assigned to them when they connect
Code:
waitforconnect()
{
	colbox = getentarray("targetname","player_colbox");
	while(1)
	{
	level waittill("connected",player);        //wait until someone connects

	for (i = 0; i < colbox.size; i++)
	{
		if(colbox[i].isinuse == 0)            //check each box until one is free
		{
			player.colboxnum = i;             //establishes box set # "belonging" to the player
			colbox[i].isinuse = 1;            //box belongs to someone now
			break;
		}
	}
	player thread checkstillexists(i);      //carry over the box set #
	
	}
}



Here you check if/when the player disconnects, when that happens, you dis-assign the box and set it up so it's free to be used by the next player who connects
Code:
checkstillexists(i)     
{
	colbox = getentarray("targetname","player_colbox");
	while(1)
	{
		if( !isdefined(self) )
		{
			colbox[i].isinuse = 0;
			colbox[i] moveto (Some_place_I_Have_No_Idea_where,.0001);
			return;
		}
		wait(0.5);
	}
}




Sound good? Maybe I'm a bit ahead of myself/wrong, etc, I did this ina bout 15 min.
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

»