.SCR Editing

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
newt

.SCR Editing

Post by newt »

local.tank = spawn models/vehicles/tigertank.tik targetname tank1 origin " 343 904 485 " angles " 3 5 90 "
$tank1 solid


I can change models and stuff like that.....

I wanna know how to add like in the first mohaa mission..... where ur in a truck riding with some guys.... how would I add that to a map thru .scr?

thanks
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

Do you want the truck to DRIVE, AND CARRY people? Well, m1l1 is a bit different. What they did was they had a special truck made, and special entities that "carry" the occupants along, and I think it was a preset path...

Well, what you CAN try is this:

Code: Select all

//spawn your truck, blah blah

//this is if local.truck is the truck

local.truck attachpassengerslot 3 $player[1]
local.truck attachpassengerslot 5 $someaiguy

$player[1] physics_off //so there's no "resistance" while riding on the truck
$someaiguy physics_off

//do ur drive thing here
local.truck drive $mypath local.speed local.accel local.reach local.look
local.truck waittill drive
local.truck stop

local.truck detachpassengerslot 3
local.truck detachpassengerslot 5

$player[1] physics_on
$someaiguy physics_on
newt

Post by newt »

lol can u explain that.... lol sorry but spawning objects was my only scripting thing i have..... lostin all thisscripting crap....

$mypath how do I even do that server sided?

ai guy which do I spawn and where?


sorry but can u explain more?
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

it's pretty complicated to explain it all from scratch here, but ill give it a shot.






ai guy was an example of attaching a person to the vehicle. it was a computer opponent targetnamed "aiguy"

local.truck attachpassengerslot "anythingfrom 1 to 6" "name of guy"


every human player's targetname is "player". since there are more than one "player" in mp, (this is mp right?) then $player[1] refers to the 1st player spawned. $player[3] would be the 3rd, and so on.

local.truck drive blah blah blah. this tells "local.truck" to drive on a certain path, with certain speed, acceleration, reach distance, and look ahead. I dont want to get into too much detail, so just use this:

local.truck drive mypath myspeed myaccel 256 256

replace mypath with the first waypoint in the path. spawn waypoints like this:

local.w1 = spawn info_waypoint "targetname" "w1" "target" "w2
local.w1.origin = (324 384 381)

you'll have to spawn multiple waypoints in the path, and link them all together with "targetname" "blah blah blah" "target" "nextoneinpath"

an example of a path would be this:

local.w1 = spawn info_waypoint "targetname" "w1" "target" "w2"
local.w1.origin = (0 0 64)

local.w2 = spawn info_waypoint "targetname" "w2" "target" "w3"
local.w2.origin = (64 0 64)

and so on and so forth...

back to local.truck driving:
replace myspeed with your desired units per second (think of inches) and replace myaccel with desired accerleration (also in units per second) something like a speed of 128 and an accel of 32 is nice.

replace local.truck with whatever the thing you want to drive is. for example, in your script, you had local.tank. so type in:

local.tank drive 128 32 256 256



if you want the tank to do something else, but wait for it to finish driving, do this:

local.tank waittill drive
local.tank stop //this will make the tank stop at the end of the path



to detach things, use this

local.tank detachpassengerslot "number of slot you want to detach from 1-6"

so you put that under local.tank stop, and it will do that after the tank is done driving and stops.... i hope that helped..
newt

Post by newt »

yea wow i think I might get this...

so player slots.... will the player just be standing stright up and down or....?

also after i get this working and shit my top goal is to have a short thjing wheretruck starts slow and picks up speed then shelling begins after about 3-4 close ones we get hit to close and flip fades black then fades back to normal with players standing by truck. maybe in it.

I'm gonna try just getting the truck to run first..... I'll let u know

thanks
newt

Post by newt »

u have aim/aol?

my sn: abaddayinbosnia

Code: Select all

local.truck = spawn models/vehicles/opeltruckgreen_canopy.tik targetname truck1 origin " 1983.81 1850.87 8.13 " angles " 0 0 0 " 
$truck1 solid


local.truck drive w1 128 32 256 256


local.w1 = spawn info_waypoint "targetname" "w1" "target" "w2" 
local.w1.origin = (1499.52 1516.89 8.12) 

local.w2 = spawn info_waypoint "targetname" "w2" "target" "w3" 
local.w2.origin = (785.49 66.41 8.12) 

local.w3 = spawn info_waypoint "targetname" "w3" "target" "w4" 
local.w3.origin = (223.25 127.81 8.12) 

local.w4 = spawn info_waypoint "targetname" "w4" "target" "w5" 
local.w4.origin = (-242.25 -444.48 8.12) 

local.w5 = spawn info_waypoint "targetname" "w5" "target" "w6" 
local.w5.origin = (-573.29 -790.34 8.12) 

local.w6 = spawn info_waypoint "targetname" "w6" "target" "w6" 
local.w6.origin = (-1253.49 -1366.28 8.12) 


ehhh..... i dunno... that didn't work. ummm...... lol I'm lost.
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

put local.truck drive after you spawn the waypoints.
newt

Post by newt »

hmmmm is target name sipposed to be just targetname?

do I need exec vehichlethinker.scr?

this didn't work...

Code: Select all

local.truck = spawn models/vehicles/opeltruckgreen_canopy.tik targetname truck1 origin " 1983.81 1850.87 8.13 " angles " 0 0 0 " 
$truck1 solid




local.w1 = spawn info_waypoint "targetname" "w1" "target" "w2" 
local.w1.origin = (1499.52 1516.89 8.12) 

local.w2 = spawn info_waypoint "targetname" "w2" "target" "w3" 
local.w2.origin = (785.49 66.41 8.12) 

local.w3 = spawn info_waypoint "targetname" "w3" "target" "w4" 
local.w3.origin = (223.25 127.81 8.12) 

local.w4 = spawn info_waypoint "targetname" "w4" "target" "w5" 
local.w4.origin = (-242.25 -444.48 8.12) 

local.w5 = spawn info_waypoint "targetname" "w5" "target" "w6" 
local.w5.origin = (-573.29 -790.34 8.12) 

local.w6 = spawn info_waypoint "targetname" "w6" "target" "w6" 
local.w6.origin = (-1253.49 -1366.28 8.12) 


local.truck drive w1 128 32 256 256

any ideas?
User avatar
Alcoholic
General
Posts: 1470
Joined: Sat May 17, 2003 5:57 am
Location: California
Contact:

Post by Alcoholic »

tell me EXACTLY what happened from the moment this part of the script was executed.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

quotes

Post by tltrude »

Try putting quotes around the targetame:

targetname "truck1"
Tom Trude,

Image
Post Reply