Page 1 of 3

How can you spawn a solid model players can't walk through

Posted: February 28th, 2010, 10:58 pm
by xeno
Question rephrased a little bit: How can you make a model you spawn solid players can't walk through it?
Need a scripting command. Making a mod and need to be able to spawn a model that players can jump on or can't walk though. Thanks.

Re: How can you spawn a solid model players can't walk through

Posted: March 1st, 2010, 1:24 am
by Drofder2004
If I recall correctly, this is something that is impossible in the early CoD Games.

Re: How can you spawn a solid model players can't walk through

Posted: March 1st, 2010, 2:10 am
by xeno
Weird, because I thought I remembered seeing a mod where they were able to jump and spawn a box below them and just keep doing it to reach really high heights.

Re: How can you spawn a solid model players can't walk throu

Posted: March 12th, 2010, 7:59 pm
by BatterY
ok, first of all its from zombie mod. 2nd, im now trying to search the correct code. 8)

Re: How can you spawn a solid model players can't walk throu

Posted: March 12th, 2010, 8:14 pm
by waywaaaard
if you have the zombie mod, please link to it or give the name and I can have a look in the scripts

Re: How can you spawn a solid model players can't walk throu

Posted: March 12th, 2010, 8:16 pm
by BatterY
...some time later ive found something:

Code: Select all

#include "ui_mp/menudef.h"

#define ORIGIN_QUICKMESSAGETAB		32 224
#define ORIGIN_QUICKMESSAGEWINDOW	32 256

// TITLE
		itemDef
		{
			name			"title"
			visible			1
			rect			0 0 224 32
			origin			ORIGIN_QUICKMESSAGETAB
			style			WINDOW_STYLE_FILLED
			forecolor		1 1 1 1
			backcolor		0 0 0 0.7975
			type			ITEM_TYPE_TEXT
			text			"^1QUICK ZOMBIE"
			textfont		UI_FONT_NORMAL
			textscale		.24
			textalignx		112
			textaligny		24
			textalign		ITEM_ALIGN_CENTER
			decoration
		}
		itemDef
		{
			name			"title_quickmessage_gray"
			visible			1
			rect			3 3 218 29
			origin			ORIGIN_QUICKMESSAGETAB
			style			WINDOW_STYLE_FILLED
			backcolor		1 1 1 .125
			decoration
		}

		itemDef
		{
			name			"window"
			group			ingamebox
			visible			1
			rect			16 20 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"^11. Drop Mine"
			decoration
		}
		execKey "1" { scriptMenuResponse "1"; close quickzombie }
	
		itemDef
		{
			name			"window"
			group			ingamebox
			visible			1
			rect			16 36 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"^12. Drop Med Kit"
			decoration
		}
		execKey "2" { scriptMenuResponse "2"; close quickzombie }
	
		itemDef
		{
			name			"window"
			group			ingamebox
			visible			1
			rect			16 52 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"^13. Drop Current Weapon"
			decoration
		}
		execKey "3" { scriptMenuResponse "3"; close quickzombie }
	
		itemDef
		{
			name			"window"
			group			ingamebox
			visible			1
			rect			16 68 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"^14. Suicide"
			decoration
		}
		execKey "4" { scriptMenuResponse "4"; close quickzombie }
	

		itemDef
		{
			name			"window"
			visible			1
			rect			16 84 0 0
			origin			ORIGIN_QUICKMESSAGEWINDOW
			forecolor		1 1 1 1
			textfont		UI_FONT_NORMAL
			textscale		.24
			textaligny		8
			text			"@QUICKMESSAGE_ESC_EXIT"
			decoration
		}
	}
}
but there is no "Place Crate" or "Place Zombie Step" or something smiliar to that :(

back to work...

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 3:15 pm
by Drofder2004
That does nothing.

I checked all the Zombie mods I could find and not even an idea of crate placing came up...

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 3:16 pm
by Rezil
I'm not sure what he wants, to spawn a model that is solid and players can't walk through it?

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 3:19 pm
by Drofder2004
Rez|l wrote:I'm not sure what he wants, to spawn a model that is solid and players can't walk through it?
Yes. The object is a solid model and therefore players cannot walk through it.

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 3:35 pm
by Rezil

Code: Select all

model = spawn("misc_model", (0,0,0));
model.angles = origin.angles; //make a script_origin somewhere
model setmodel("xmodel/bleh");
Something like that?

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 5:44 pm
by Drofder2004
Rez|l wrote:

Code: Select all

model = spawn("misc_model", (0,0,0));
model.angles = origin.angles; //make a script_origin somewhere
model setmodel("xmodel/bleh");
Something like that?
That spawns a non solid model. vCoD (like all the other series) uses a collmap model system, where the models are actually ALWAYS non-colliding. When you compile the compiler automatically assigns each model a collmap, which creates a clip around the object, making it appear solid.

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 5:54 pm
by Rezil
Any way to spawn solid brushes via script?

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 6:12 pm
by waywaaaard
Hm haven't seen a way though.
Make 60 brushes in your map and place them somewhere outside. Manage those all in an array and set a limit how many a player can place.

Now if a player wants to spawn one, search for a free brush, make it nonsolid() and move it to the player now make it solid(). Make a function that allows a player to free all brushes he used. Those brushes will now go back to the place outside of the map and can be used for something else.

Array: [60][2] so you have

[*][0]
ent

[*][1]
player who is using it or null

each player has wether a limit of brushes he is allowed to use or first come first serve

ofc you can store additional information and other stuff

Re: How can you spawn a solid model players can't walk throu

Posted: March 13th, 2010, 7:55 pm
by Drofder2004
If I remember correctly, they introduced a "setbounds" command in one game. Although removed at least in CoD4...

Re: How can you spawn a solid model players can't walk throu

Posted: April 11th, 2010, 11:47 am
by megazor
There is a long, tiresome way not to let players be in a certain place:

1. Create a function that returns true if a player is in some place (checking if the player's coordinates correspond to given coordinate ranges.

2. Make an infinite loop with this function inside.

This way isn't perfect though, but, as far as we see, it's the only way to do it.