Adding certain things to script spawned items...

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Adding certain things to script spawned items...

Post by Master-Of-Fungus-Foo-D »

how would i add an $mdl value to a splinepath by script? my current goal is to get a plane to spawn in a map(a simple small outside map). how would i add a $targetname? help :idea:
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

You can spawn a splinepath by doing this

Code: Select all

spawn script_object "targetname" "myplane" "classname" "info_splinepath"
or

Code: Select all


spawn info_splinepath "targetname" "myplane"

For the mdl value you can just do this:

Code: Select all

$myplane.mdl = "vehicles/stuka_fly.tik"
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

If the info_splinepath node is already in the map and has no targetname you are out of luck but you can spawn an info_splinepath node and give it a targetname and a mdl value.You have to use mdl you can't use $mdl if you are spawning . The mdl value is used by certain scripts to let the script know what model you have choosen to spawn and then that script would spawn that model as a script_model and then make it follow the info_splinepath . In other words the mdl value is only there to tell the script what model to spawn . The script may also have a default model it will spawn if you don't use the mdl value at all . For example this is from the global/bomber.scr


if (level.bomberpath[local.i].mdl != NIL)
local.model = level.bomberpath[local.i].mdl
else
local.model = "vehicles/p47fly.tik"
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

cool. im going to try to spawn the stuff... thx...
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Post Reply