How can you spawn a solid model players can't walk through
Moderator: 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
I have never and never plan to touch models.
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
-
- 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
Potentially, maybe. But I have yet to see it done and those who I have asked have not suceeded personally.KillerSam wrote:Drofder2004 wrote:I have never and never plan to touch models.
Could this potentially work for the project I PM'd you about? If replica models were made and used.
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
-
- 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
Going to test it out later today. Will inform you all of my progress when I get it finished.
-
- 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
I need someone to fix the following code for me, so it will actually spawn the model at the said location:
Thank you, Kyle Mulliger/Uzumakibro93/Deadly.
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.
-
- 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
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");
}
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
-
- 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
Changed the code up a bit, got it to work (here's my finished code, thank you Drofder)
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.
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();
}
Re: How can you spawn a solid model players can't walk throu
cant get it off my head. still thinking of set collmap/similiar command :SUzumakibro93 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(); }
-
- 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
I'll go check it out right now to see if that will work.
-
- 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
Unknown (built-in) function (SetCollMap). Sorry, I'll go ask BraX when he gets back on.
-
- 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
Here's my conversation with BraX:
So there is no need for custom models...Will try this out in a few hours or so... Thank you, Kyle Mulliger.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
-
- 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
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.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
-
- 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
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
Who is online
Users browsing this forum: No registered users and 0 guests