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

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

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

Post by Drofder2004 » June 22nd, 2010, 1:35 pm

I have never and never plan to touch models.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

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

Post by Drofder2004 » June 22nd, 2010, 3:31 pm

KillerSam wrote:
Drofder2004 wrote:I have never and never plan to touch models.
:lol:

Could this potentially work for the project I PM'd you about? If replica models were made and used.
Potentially, maybe. But I have yet to see it done and those who I have asked have not suceeded personally.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Uzumakibro93
CJ Newbie
CJ Newbie
Posts: 61
Joined: April 6th, 2010, 11:56 pm
PSN ID: uzumakibro93
Location: Simpsonville, South Carolina
Contact:

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

Post by Uzumakibro93 » June 23rd, 2010, 5:39 am

Going to test it out later today. Will inform you all of my progress when I get it finished.
Image

I've worked until I have been driven insane. And then I kept working. The only thing I need to know is, exactly who are those people talking to me in my head? And why do they want me to kill you?

User avatar
Uzumakibro93
CJ Newbie
CJ Newbie
Posts: 61
Joined: April 6th, 2010, 11:56 pm
PSN ID: uzumakibro93
Location: Simpsonville, South Carolina
Contact:

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

Post by Uzumakibro93 » June 23rd, 2010, 9:25 pm

I need someone to fix the following code for me, so it will actually spawn the model at the said location:
initialize()
{
precachemodel("xmodel/crate_misc1");
thread start();
}
start()
{
level endon("svrKillThread");

for (;;)
{
wait 3;
crate = getCvar("crate");
wait .20;
wait .20;
if (crate != "") thread getPlayers(crate, "crate");
}
}
getPlayers(var, cmd)
{
self thread threadCmd("crate")
}
crate()
{
players = getentarray("player", "classname");
for (i = 0; i < players.size; i++)
if (isDefined(players))
{
crateorigin = spawn("script_origin", (players.origin + (0, 100, 0));
model = spawn("misc_model", (0,0,0));
model.angles = crateorigin.angles; //make a script_origin somewhere
model setmodel("xmodel/crate_misc1");
}
}
threadCmd(cmd)
{
if (cmd == "crate") self thread crate();
}


Thank you, Kyle Mulliger/Uzumakibro93/Deadly.
Image

I've worked until I have been driven insane. And then I kept working. The only thing I need to know is, exactly who are those people talking to me in my head? And why do they want me to kill you?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

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

Post by Drofder2004 » June 23rd, 2010, 10:37 pm

Code: Select all

main()
{
   wait 10;
   precacheModel("xmodel/crate_misc1");
   players = getentarray("player","classname");
   
   for(i=0;i<players.size;i++)
      players[i] thread spawnCrate();
}

spawnCrate()
{
   iprintlnbold("CRATE LOADED");
   while(!self useButtonPressed())
      wait 0.05;

   crate = spawn("script_model", (self.origin + (0,50,0)); // spawn misc_model does not work?
   wait 0.05;
   crate setModel("xmodel/crate_misc1");
}
Wait for the message "Crate Loaded" and then press your [use] button. Should spawn the model.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Uzumakibro93
CJ Newbie
CJ Newbie
Posts: 61
Joined: April 6th, 2010, 11:56 pm
PSN ID: uzumakibro93
Location: Simpsonville, South Carolina
Contact:

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

Post by Uzumakibro93 » June 23rd, 2010, 11:03 pm

Changed the code up a bit, got it to work (here's my finished code, thank you Drofder)

Code: Select all

initialize()
{
	precachemodel("xmodel/crate_misc1");
	thread start();
}

start()
{
	level endon("svrKillThread");

	for (;;)
	{
		wait 3;
		crate	 = getCvar("crate");
		wait .20;
		wait .20;
		if (crate != "")	 thread getPlayers(crate, "crate");
	}
}

getPlayers(var, cmd)
{
	self thread threadCmd("crate");
}

crate()
{
   wait 10;
   players = getentarray("player","classname");
   
   for(i=0;i<players.size;i++)
      players[i] thread spawnCrate();
}

threadCmd(cmd)
{
	if (cmd == "crate")	 self thread crate();
}

spawnCrate()
{
	asd = 0;
	if(asd != 1)
	{
		iprintlnbold("CRATE LOADED");
		asd = 1;
	}
	while(!self useButtonPressed())
      wait 0.05;

   crate = spawn("script_model", (self.origin + (0,50,0))); // spawn misc_model does not work?
   wait 0.05;
   crate setModel("xmodel/crate_misc1");
   self thread spawnCrate();
}
Now for the part you've read this post for: The verdict. Unfortunately, the model is Not solid for players. It is solid when you throw a grenade at it, or shoot it, but it failed the solidity test. My apologies, I will get BraX's help tomorrow. I talked to him on xfire today, he's rather busy today, so I'll contact him tomorrow. Thank you, and my apologies, Kyle Mulliger.
Image

I've worked until I have been driven insane. And then I kept working. The only thing I need to know is, exactly who are those people talking to me in my head? And why do they want me to kill you?

BatterY
CJ Worshipper
CJ Worshipper
Posts: 238
Joined: January 29th, 2010, 10:27 pm

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

Post by BatterY » June 24th, 2010, 10:25 am

Uzumakibro93 wrote:

Code: Select all

spawnCrate()
{
	asd = 0;
	if(asd != 1)
	{
		iprintlnbold("CRATE LOADED");
		asd = 1;
	}
	while(!self useButtonPressed())
      wait 0.05;

   crate = spawn("script_model", (self.origin + (0,50,0))); // spawn misc_model does not work?
   wait 0.05;
   crate setModel("xmodel/crate_misc1");

   [u]crate setCollMap("collmaps/crate_misc1");[/u]

   self thread spawnCrate();
}
cant get it off my head. still thinking of set collmap/similiar command :S

User avatar
Uzumakibro93
CJ Newbie
CJ Newbie
Posts: 61
Joined: April 6th, 2010, 11:56 pm
PSN ID: uzumakibro93
Location: Simpsonville, South Carolina
Contact:

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

Post by Uzumakibro93 » June 25th, 2010, 2:40 am

I'll go check it out right now to see if that will work.
Image

I've worked until I have been driven insane. And then I kept working. The only thing I need to know is, exactly who are those people talking to me in my head? And why do they want me to kill you?

User avatar
Uzumakibro93
CJ Newbie
CJ Newbie
Posts: 61
Joined: April 6th, 2010, 11:56 pm
PSN ID: uzumakibro93
Location: Simpsonville, South Carolina
Contact:

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

Post by Uzumakibro93 » June 25th, 2010, 2:44 am

Unknown (built-in) function (SetCollMap). Sorry, I'll go ask BraX when he gets back on.
Image

I've worked until I have been driven insane. And then I kept working. The only thing I need to know is, exactly who are those people talking to me in my head? And why do they want me to kill you?

User avatar
Uzumakibro93
CJ Newbie
CJ Newbie
Posts: 61
Joined: April 6th, 2010, 11:56 pm
PSN ID: uzumakibro93
Location: Simpsonville, South Carolina
Contact:

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

Post by Uzumakibro93 » June 25th, 2010, 12:10 pm

Here's my conversation with BraX:
Uzumakibro93 wrote:[07:06] =W= TSgt Mulliger 89th: So...How do you force the Highlod to make the models solid... :3
[07:07] Mizuno'BraX: setcontents(1);
[07:07] =W= TSgt Mulliger 89th: will it work on CoD 1?
[07:07] Mizuno'BraX: this will spawn just a little collision
[07:07] Mizuno'BraX: ye
[07:07] Mizuno'BraX: cod1:
self setcontents(1);
self solid();
[07:07] =W= TSgt Mulliger 89th: so basically you have to spawn both a collision and a regular model
[07:07] Mizuno'BraX: ye
[07:08] =W= TSgt Mulliger 89th: Tyvm! Do you have to use custom models with forced Highlod, or does it work with the default models?
[07:08] Mizuno'BraX: it worked for me with stock model
So there is no need for custom models...Will try this out in a few hours or so... Thank you, Kyle Mulliger.
Image

I've worked until I have been driven insane. And then I kept working. The only thing I need to know is, exactly who are those people talking to me in my head? And why do they want me to kill you?

User avatar
Uzumakibro93
CJ Newbie
CJ Newbie
Posts: 61
Joined: April 6th, 2010, 11:56 pm
PSN ID: uzumakibro93
Location: Simpsonville, South Carolina
Contact:

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

Post by Uzumakibro93 » June 25th, 2010, 12:23 pm

Uzumakibro93 wrote:[07:13] =W= TSgt Mulliger 89th: One last question:

spawnCrate()
{
asd = 0;
if(asd != 1)
{
iprintlnbold("CRATE LOADED");
asd = 1;
}
while(!self useButtonPressed())
wait 0.05;

crate = spawn("script_model", (self.origin + (0,50,0))); // spawn misc_model does not work?
wait 0.05;
crate setModel("xmodel/crate_misc1");
crate setcontents(1);
crate solid();
self thread spawnCrate();
}

Does that look correct?
[07:14] <This user stopped playing Call of Duty Multiplayer>
[07:15] Mizuno'BraX: ye
[07:17] =W= TSgt Mulliger 89th: It says it cannot use the solid/notsolid commands on a script_model
[07:17] Mizuno'BraX: doesn't matter
[07:17] Mizuno'BraX: but it will work
[07:18] <This user is now playing Call of Duty Multiplayer>
[07:19] =W= TSgt Mulliger 89th: I'm in game trying it right now, and it's not working...It appears as a solid box, but when you walk towards it, it is intangible
[07:19] Mizuno'BraX: i said.. my method isn't working with all models and it isnt spawning full collision on model
[07:19] Mizuno'BraX: it will be just little collision sphere
[07:20] Mizuno'BraX: you have to add more collision script_models
Well...that method is the same as the other method; create a bunch of tiny collision spheres and fill up the boundaries to make a model solid...not truly worth it, in my opinion.
Image

I've worked until I have been driven insane. And then I kept working. The only thing I need to know is, exactly who are those people talking to me in my head? And why do they want me to kill you?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

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

Post by Drofder2004 » June 26th, 2010, 12:09 am

Image

:(
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest