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

Members Online

»
0 Active | 32 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Spawnable Collision
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Tuesday, Nov. 30, 2010 08:32 pm
If you spawn a trigger_radius and set the contents, it will become solid. Only downside seems to be that the player's aim will wobble a bit when ontop of it. The code below is ALL that is being used to spawn the collision, no fancy models or the likes.

Code:
level.weaponboxCollision[i] = spawn( "trigger_radius", ( 0, 0, 0 ), 0, 70, 30 );
level.weaponboxCollision[i].origin = placement.origin;
level.weaponboxCollision[i] setContents( 1 );


Videos of it in action:
http://www.xfire.com/video/3bed3f/
http://www.xfire.com/video/3bedb2/
Share |
1wilco12
General Member
Since: Oct 23, 2009
Posts: 21
Last: May 28, 2011
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Wednesday, Dec. 1, 2010 06:01 pm
Really nice! Going to try this :D
Share |
K!k!
General Member
Since: Oct 29, 2009
Posts: 15
Last: Dec 10, 2010
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Dec. 10, 2010 09:32 am
hi,

i have tried to use your code on a vehicule but it doesnt seems to works with? have you ever tried to use your colision tips with vehicules?

Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Monday, Jan. 10, 2011 03:40 am
Is this possible in CoD2?
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Jan. 15, 2011 03:16 pm
I've already posted about that months ago..
http://modsonline.com/Forums-top-119748-0.html
Share |
liltc64
General Member
Since: Feb 12, 2007
Posts: 906
Last: Oct 22, 2012
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Saturday, Jan. 15, 2011 04:16 pm
id say that the only thing that isnt diffrent about your scripts are setContent(1); wich we all know is almost no collision, its a tiny little collision depending on what the model is. but what Xylozi is doing is showing that a trigger_radius will work perfectly and i like that good job.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Saturday, Jan. 15, 2011 05:12 pm
Setting content 1 on the script model only creates a small collision sphere on the models origin. It only works well creating a separated radius trigger and setting this content to 1. There you can adapt the size of this sphere.

P.D.: Oh liltc64, I didnt refresh the page so I didnt see your comment. So yes that's it.
Share |
SteveHolmes
General Member
Since: Jan 15, 2011
Posts: 5
Last: Jan 15, 2011
[view latest posts]
Level 0
Category: CoD4 Scripting
Posted: Saturday, Jan. 15, 2011 09:01 pm
For the purpose of SP vehicles, I posted a tip on how to get collmaps working properly:
http://modsonline.com/Forums-top-118267.html

generally speaking if you want to spawn/move collision around, I would recommend a script_brushmodel with a clip texture of your choice. Get it through script and make it nonsolid:
box = getent ("clipbox", "targetname");
box notsolid();

then when you're ready
box solid();

obviously be careful that no AI are in it when you do this, bad things could happen =)

Alternately you could move the box by just changing it's origin.
box = getent ("clipbox", "targetname");
box.origin = box.origin +(0,0,-300);

This moves it down 300 units (on the Z).

Then when you're ready, move it back up.
box.origin = box.origin +(0,0,300);

You could store the default origin in a variable if you like. So at the start, before you move it:
default_pos = box.origin;

Then when it's time to return the box to it's original place:
box.origin = default_pos;

default_pos simply stores the x,y,z of it's origin at that time. This would be the same origin in radiant.
Share |
Leal
General Member
Since: Feb 5, 2010
Posts: 196
Last: Aug 18, 2013
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Saturday, Jan. 15, 2011 10:18 pm
Im modding for MP, and there is this known problem with the collision...

As far as I know, there is no way to spawn a decent collision for spawned models on CoD2 MP. The functions setContents(1) and solid() dont work to spawn the respective collision of a xmodel. That's it, so Brax is not right in his several posts he did denying this.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»