mirror of
https://github.com/Ragora/T2-DXAI.git
synced 2026-03-05 05:20:22 +00:00
AIEnhancedScoutLocation implementation; getRandomPosition; AIEnhancedDefendLocation
This commit is contained in:
parent
a7f2fd1219
commit
b9d248abfb
3 changed files with 219 additions and 61 deletions
|
|
@ -155,6 +155,14 @@ function GameConnection::getObjectsInViewcone(%this, %typeMask, %distance, %perf
|
|||
return %result;
|
||||
}
|
||||
|
||||
function getRandomPosition(%position, %distance)
|
||||
{
|
||||
// First, we determine a random direction vector
|
||||
%direction = vectorNormalize(getRandom(0, 10000) SPC getRandom(0, 10000) SPC getRandom(0, 10000));
|
||||
// Return the scaled result
|
||||
return vectorAdd(%position, vectorScale(%direction, getRandom(0, %distance)));
|
||||
}
|
||||
|
||||
function vectorMultiply(%vec1, %vec2)
|
||||
{
|
||||
return (getWord(%vec1, 0) * getWord(%vec2, 0)) SPC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue