UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: mala15 on November 13, 2015, 02:01:22 pm

Title: Scripting function not in scripting references
Post by: mala15 on November 13, 2015, 02:01:22 pm
Hi,

I've found a function that is not in "scripting reference" or anywhere on the forum when i searched for it.
It has been of help to me when trying to solve a few problems so I'll post it here for anyone that don't know about it. I think this comes under "General Help - Scripting"

Anyone else know of "unknown" functions that might be of use? Please post :)

---------------------------------------------------------------------
Code Snippet
Plaintext
VectorFromLineToPoint( line_point1, line_point2, target_point);
This function "draws" an infinite line through the coordinates line_point1 and line_point2, and gives back the perpendicular vector from that line to the coordinate target_point.
---------------------------------------------------------------------

I've found this useful a few times, but treyarch have used it to determine if an entity is in front or behind a player or character. In sniper_stealth_logic.gsc on line 257 you can see an example of that, the function is called "entity_is_in_front_of_me( target_entity )".
Title: Re: Scripting function not in scripting references
Post by: MakeCents on November 13, 2015, 02:08:38 pm
Cool, that sounds like a useful function.

Here is a complete list of functions:
http://ugx-mods.com/forum/index.php/topic,7207.0.html (http://ugx-mods.com/forum/index.php/topic,7207.0.html)

Ray's sublime auto complete for gsc
http://ugx-mods.com/forum/index.php/topic,7211.0.html (http://ugx-mods.com/forum/index.php/topic,7211.0.html)

My (and others helping) sublime auto complete for gsc, csc, and menu, can be found here:
http://ugx-mods.com/forum/index.php/topic,5923.0.html (http://ugx-mods.com/forum/index.php/topic,5923.0.html)
and here is where we keep it updated:
https://github.com/MakeCentsGaming/Sublime-CodScript (https://github.com/MakeCentsGaming/Sublime-CodScript)
Title: Re: Scripting function not in scripting references
Post by: mala15 on November 13, 2015, 04:10:53 pm
Cool, that sounds like a useful function.

Here is a complete list of functions:
http://ugx-mods.com/forum/index.php/topic,7207.0.html (http://ugx-mods.com/forum/index.php/topic,7207.0.html)

Ray's sublime auto complete for gsc
http://ugx-mods.com/forum/index.php/topic,7211.0.html (http://ugx-mods.com/forum/index.php/topic,7211.0.html)

My (and others helping) sublime auto complete for gsc, csc, and menu, can be found here:
http://ugx-mods.com/forum/index.php/topic,5923.0.html (http://ugx-mods.com/forum/index.php/topic,5923.0.html)
and here is where we keep it updated:
https://github.com/MakeCentsGaming/Sublime-CodScript (https://github.com/MakeCentsGaming/Sublime-CodScript)


Woah, nice :D

Thank you very much:) Have to put some time into absorbing those resorcouces.
Title: Re: Scripting function not in scripting references
Post by: DidUknowiPwn on November 13, 2015, 05:21:05 pm
Well learning names is fine and dandy but need to figure out what the function parameters/return/types are :D
Title: Re: Scripting function not in scripting references
Post by: mala15 on November 13, 2015, 06:05:25 pm
Well learning names is fine and dandy but need to figure out what the function parameters/return/types are :D

what do you mean?:)
I didn't intend to memorize names, but look through stuff in those links and find what I'm capable of using^^
Title: Re: Scripting function not in scripting references
Post by: daedra descent on November 13, 2015, 08:19:46 pm
what do you mean?:)
I didn't intend to memorize names, but look through stuff in those links and find what I'm capable of using^^

Documentation on what the function does, like:

What its purpose
Arguments(and their data types)
What it returns(data type)
Example usage

Data types can be strings, integers, double, Boolean, etc.
Title: Re: Scripting function not in scripting references
Post by: MakeCents on November 13, 2015, 08:25:00 pm
Shenanigans.

You just do this until it works:
(https://www.ugx-mods.com/forum/proxy.php?request=http%3A%2F%2Fstream1.gifsoup.com%2Fview8%2F4632118%2Fidiocracy-iq-test-o.gif&hash=860e961de5c7be3a87ac3ce2cca39509c0883c96)

I think the OP thought those things were more obvious than they are to those that will benefit from the function maybe, but dukip and dd are saying you could add more like you would see in the script reference maybe?
Like this:
http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Mathl::VectorFromLineToPoint (http://wiki.modsrepository.com/index.php?title=Call_of_Duty_4:_Scripting_Reference_-_Mathl::VectorFromLineToPoint)