Page 3 of 3

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

Posted: June 22nd, 2010, 1:35 pm
by Drofder2004
I have never and never plan to touch models.

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

Posted: June 22nd, 2010, 3:31 pm
by Drofder2004
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.

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

Posted: June 23rd, 2010, 5:39 am
by Uzumakibro93
Going to test it out later today. Will inform you all of my progress when I get it finished.

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

Posted: June 23rd, 2010, 9:25 pm
by Uzumakibro93
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.

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

Posted: June 23rd, 2010, 10:37 pm
by Drofder2004

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.

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

Posted: June 23rd, 2010, 11:03 pm
by Uzumakibro93
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.

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

Posted: June 24th, 2010, 10:25 am
by BatterY
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

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

Posted: June 25th, 2010, 2:40 am
by Uzumakibro93
I'll go check it out right now to see if that will work.

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

Posted: June 25th, 2010, 2:44 am
by Uzumakibro93
Unknown (built-in) function (SetCollMap). Sorry, I'll go ask BraX when he gets back on.

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

Posted: June 25th, 2010, 12:10 pm
by Uzumakibro93
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.

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

Posted: June 25th, 2010, 12:23 pm
by Uzumakibro93
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.

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

Posted: June 26th, 2010, 12:09 am
by Drofder2004
Image

:(