February 04, 2012, 03:19:27 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Please report any bugs or issues that you might be encountering with the Beta in the Support System so that we can better keep track of any oustanding issues that may come up.

GameCore Support System
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Brake lights and Car AI  (Read 406 times)
QuadGames
Newbie
*
Posts: 2


View Profile
« on: July 30, 2010, 11:53:45 AM »

Brake lights.

Code:
OPRP

LoadObject Truck.obj
ObjectName CarBody
...
...
EditSurface rlights
SurfaceBlendMode Normal
SurfaceBlendOperation Add
SurfaceDiffuseMap turn3.jpg
SurfaceNormalMap
SurfaceSpecularMap
SurfaceDetailMap
SurfaceShaderSpec
SurfaceShaderEnabled 1
SurfaceFlags
SurfaceTextureFlags
SurfaceSpecular 0
SurfaceShinyness 128
SurfaceDetailAmount 0
SurfaceDetailMapScale 1
SurfaceTextureAnimLayers 1
SurfaceTextureScale 0 1.000000 1.000000
SurfaceTextureOffset 0 0.000000 0.000000
SurfaceTextureAnim 0 0.000000 0.000000
SurfaceTextureStep 0 0.000000 0.000000
SurfaceWaveParams 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
SurfaceNormalMapScale 1
SurfaceDisplacement 0
SurfaceNormalOffset 0
SurfaceNormalMapIntensity 1
SurfaceLuminosity 0
SurfaceDiffuse 1
SurfaceTransparency 0
SurfaceTranslucency 0
SurfaceColor 255 255 255
SurfaceDrawOrder 0
SurfaceNoDebugOverride 0
SurfaceAlphaTestThreshold 127

As I have understood turn3.jpg it "turning headlights".

Code:
if (handbrakePressed > 0.1f && gear != -1)
{
GetGameManager().GetWorld().GetObject("VehicleBody").GetMesh("CarBody").GetSurface("rlights").SetColor(1.25, 0.0, 0.0);
if (!aicontrolled && lightson)
{
GetGameManager().GetWorld().GetObject("VehicleBody").GetLight("LeftTailLightGround").SetIntensity( 0.03);
GetGameManager().GetWorld().GetObject("VehicleBody").GetLight("RightTailLightGround").SetIntensity( 0.03);
}
}
else
{
GetGameManager().GetWorld().GetObject("VehicleBody").GetMesh("CarBody").GetSurface("rlights").SetColor(0.7, 0.0, 0.0);
if (!aicontrolled && lightson)
{
GetGameManager().GetWorld().GetObject("VehicleBody").GetLight("LeftTailLightGround").SetIntensity( 0.015);
GetGameManager().GetWorld().GetObject("VehicleBody").GetLight("RightTailLightGround").SetIntensity( 0.015);
}
}

VehicleBody - whether it is necessary to change it for the value and if yes, that it for value?
LeftTailLightGround - whether also it it is necessary to change and on what, if yes?

____________________________________

Now Car AI.

I do racing game, races pass on highway and opponents are accordingly necessary.
Here I also think, how them to make?

Thanks.
Logged
LutinMalefique
Full Member
***
Posts: 146



View Profile WWW
« Reply #1 on: July 31, 2010, 06:30:48 AM »

Quote
VehicleBody - whether it is necessary to change it for the value and if yes, that it for value?
LeftTailLightGround - whether also it it is necessary to change and on what, if yes?

"VehicleBody" is your car object, change the name if call your car my car or something else
"GetLight("RightTailLightGround")" handle to a light called "RightTailLightGround" attach to the car

about the IA, QuickstartRacing template has cars ia but it doesn't seem to be available anymore. but they use the same script has the player.

i hope it will helps you a little
Logged

http://lutinmalefique.wordpress.com/
"Just remember: a damn game can be played, and if you have not created something that can be played, it's not a damn game!" Derek Yu
gekido
Guest
« Reply #2 on: August 08, 2010, 08:17:47 PM »

Here is a tutorial that covers using the traffic manager in GameCore:

http://gamecore3d.com/docs/user-guide/creating-your-worlds/procedural-geometry/traffic-manager
Logged
Pages: [1]
  Print  
 
Jump to:  

 
Powered by MySQL Powered by PHP bluBlur Skin © 2006, hbSkins
Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Valid XHTML 1.0! Valid CSS!