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

Members Online

»
0 Active | 89 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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Mod Ideas that include mainly bullettraces.
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Jun. 20, 2011 05:19 am
What could you do with a bullettrace?. Like i understand. But what would you want to make?.
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Jun. 20, 2011 12:15 pm
-find the point you are looking at
-find out if something is between point A and point B
-find out the surface-type the trace hits
-find the point on ground
-get an entity the trace is hitting
Quote:

bulletTrace( fromPoint, toPoint, stopOnEnts, excludedEnt );

fromPoint - the starting ( x, y, z ) point for the trace
toPoint - the ( x, y, z ) position targeted by the trace
stopOnEnts - a boolean value to make the trace to stop on entitys excludedEnt - the trace will continue if it intersects this entity

The function returns an array with the following:
>>>[ "position" ] - the ( x, y, z ) position where the trace ended

>>>[ "fraction" ] - a float value from 0 to 1 that represents the fraction of the distance from fromPoint to toPoint that was traveled to reach [ "position" ]

>>>[ "entity" ] - the entity object that the trace hit at [ "position" ]

>>>["surfacetype" ] - a string that is the type of surface that the trace hit at [ "position" ]

>>>["normal" ] - a vector that is the normal of the surface that the trace hit a[ "position" ]

>>>array["fraction"] is the fraction of the distance the bullettrace travelled. if it didn't hit anything between the two specified vectors then it will return 1.0. if it hit something 75% of the way through its path it will return .75


i also have a question
what a bullettrace do i need when i want to know if nothing is between point A and point B? (not the usual bullettrace()-func)
i tried sighttracepassed, but it seems to be that i missed something.

source: iwnation forum
Share |
novemberdobby
General Member
Since: Sep 17, 2006
Posts: 1965
Last: Oct 13, 2013
[view latest posts]
Level 8
Category: CoD2 Scripting
Posted: Monday, Jun. 20, 2011 01:29 pm
serthy writes...
Quote:

i also have a question
what a bullettrace do i need when i want to know if nothing is between point A and point B? (not the usual bullettrace()-func)
i tried sighttracepassed, but it seems to be that i missed something.


You can do it 2 ways:
if(trace["fraction"] == 1) //there's nothing
if(trace["position"] == toPoint) //there's nothing

edited on Jun. 20, 2011 09:30 am by novemberdobby
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 Scripting
Posted: Monday, Jun. 20, 2011 01:41 pm
Thanx Dobby :)

i used before if( trace["entity"] == player ) to check if there is a wall between my mine and the player
so i do not know what is better for a server to use the full bullettrace or only bulletrtacepassed, sighttracepassed etc

Share |
Samuel033
General Member
Since: Dec 10, 2009
Posts: 484
Last: Dec 25, 2015
[view latest posts]
Level 5
Category: CoD2 Scripting
Posted: Monday, Jun. 20, 2011 06:20 pm
Sight trace takes distance into account I think. Also things like rain. At least, they always seem to.
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»