Devil Master
12-02-2002, 01:41 AM
During the last days I was thinking about a way to implement vehicles in the Unreal engine, or better, to make it LOOK LIKE the player can drive vehicles.
I thought that a vehicle mesh and a "vehicle_key" inventory item would be needed for this and I thought about all the effects that using the "vehicle_key" item should have.
Since I don't know UnrealScript very much, I wrote them in a pseudolanguage. Would anyone who DOES know UnrealScript tell me if it can actually be done and translate the pseudolanguage into UnrealScript?
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">PLAYER_IS_DRIVING = FALSE
if PLAYER_USES_VEHICLE_KEY
{
if PLAYER_COLLIDES_WITH_VEHICLE
{
if NOT(PLAYER_IS_DRIVING)
{
remove VEHICLE_MESH
replace PLAYER_MESH with VEHICLE_MESH
disable STRAFE_LEFT // you can't drive sideways
disable STRAFE_RIGHT //
disable MOUSE_VERTICAL_AXIS // nor look up and down
PLAYER_IS_DRIVING = TRUE
if PLAYER_IS_MOVING_FORWARD
{
play FORWARD_SOUND
}
if PLAYER_IS_MOVING_BACKWARDS
{
play BACKWARDS_SOUND
}
}
}
else
{
replace VEHICLE_MESH with PLAYER_MESH
summon VEHICLE_MESH
PLAYER_IS_DRIVING = FALSE
enable STRAFE_LEFT
enable STRAFE_RIGHT
enable MOUSE_VERTICAL_AXIS
}
}[/code]</blockquote><font size="2" face="Verdana, Arial">
[ 12-02-2002, 01:49 AM: Message edited by: Devil Master ]
I thought that a vehicle mesh and a "vehicle_key" inventory item would be needed for this and I thought about all the effects that using the "vehicle_key" item should have.
Since I don't know UnrealScript very much, I wrote them in a pseudolanguage. Would anyone who DOES know UnrealScript tell me if it can actually be done and translate the pseudolanguage into UnrealScript?
</font><blockquote><font size="1" face="Verdana, Arial">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">PLAYER_IS_DRIVING = FALSE
if PLAYER_USES_VEHICLE_KEY
{
if PLAYER_COLLIDES_WITH_VEHICLE
{
if NOT(PLAYER_IS_DRIVING)
{
remove VEHICLE_MESH
replace PLAYER_MESH with VEHICLE_MESH
disable STRAFE_LEFT // you can't drive sideways
disable STRAFE_RIGHT //
disable MOUSE_VERTICAL_AXIS // nor look up and down
PLAYER_IS_DRIVING = TRUE
if PLAYER_IS_MOVING_FORWARD
{
play FORWARD_SOUND
}
if PLAYER_IS_MOVING_BACKWARDS
{
play BACKWARDS_SOUND
}
}
}
else
{
replace VEHICLE_MESH with PLAYER_MESH
summon VEHICLE_MESH
PLAYER_IS_DRIVING = FALSE
enable STRAFE_LEFT
enable STRAFE_RIGHT
enable MOUSE_VERTICAL_AXIS
}
}[/code]</blockquote><font size="2" face="Verdana, Arial">
[ 12-02-2002, 01:49 AM: Message edited by: Devil Master ]