Author |
Topic: collision map for mp |
viraj_mantri |
General Member Since: Nov 15, 2006 Posts: 66 Last: May 16, 2007 [view latest posts] |
|
|
|
OLD_MAN_WITH_GUN |
General Member Since: May 13, 2006 Posts: 754 Last: Jan 23, 2010 [view latest posts] |
|
|
|
viraj_mantri |
General Member Since: Nov 15, 2006 Posts: 66 Last: May 16, 2007 [view latest posts] |
|
|
|
OLD_MAN_WITH_GUN |
General Member Since: May 13, 2006 Posts: 754 Last: Jan 23, 2010 [view latest posts] |
|
|
|
viraj_mantri |
General Member Since: Nov 15, 2006 Posts: 66 Last: May 16, 2007 [view latest posts] |
|
|
|
BloodySoldier |
|
General Member Since: Aug 17, 2006 Posts: 318 Last: Apr 6, 2009 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Tuesday, Jan. 2, 2007 08:04 am |
|
ok in order to get ut clips moving along with ur vehicle u select all the clips for the vehicle and make them a script_brushmodel give them a targetname of tankclip or w/e. then in ur .gsc u must tell the game to move the clips along with ur vehicle.
PS this script i have not tested and u must rename parts of it so it would fit ur vehicle or w/e ur using. and this script uses a trigger.
example script:
Code: //created by |ZERO|BloodySoldier in 5 minutes
main()
{
maps\mp\_load::main();
thread tankmove();
}
tankmove()
{
tank = getent("tankmove","targetname");
tankclip = getent("tankclip","targetname");
trig = getent("tanktrig","targetname");
{
trig waittil("trigger");
tank movex(200,10);
tankclip movex(200,10);
tank waittil("movedone");
tankclip waittil("movedone");
}
}
tell me if it works and if u get an error post it and we can try to find out whats wrong. most likely i forgot a letter or sumthing |
|
|
|
viraj_mantri |
General Member Since: Nov 15, 2006 Posts: 66 Last: May 16, 2007 [view latest posts] |
|
|
|
viraj_mantri |
General Member Since: Nov 15, 2006 Posts: 66 Last: May 16, 2007 [view latest posts] |
|
|
|
The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|
WHC_Grassy |
General Member Since: Apr 20, 2005 Posts: 1426 Last: Aug 25, 2007 [view latest posts] |
|
|
Category: CoD2 Scripting Posted: Tuesday, Jan. 16, 2007 08:49 am |
|
Here is a simplified version of a plane flyby script, I modified it to be a simple basis for vehicle use.
To make your clips move with the vehicle it would be easier to link them using linkto(); command.
For eg;
clips enablelinkto();
clips linkto(tank);
Do this before you start moving the vehicle.
Code: main() {
thread Start();
}
Start() {
//The entity you want moving along a vehicle path
ent = getent("truck", "targetname");
//The first startnode of the vehicle path
firstNode = getent("startnode", "targetname");
//Set the entity on the startnode
ent.origin = firstNode.origin;
//Match the entities angles with the startnode
ent.angles = firstNode.angles;
//wait a random amount of time or change to wait on a triggered event
wait (randomint(3) *10);
//Start the moving stuff
moveIt(ent, firstNode);
}
moveIt(object, startNode) {
//If the first node is not targeting another vehicle node then quit
if (!isdefined (startNode.target))
return;
//Build the path
pathNodes = buildPath(startNode);
if (!isdefined(pathNodes))
return;
//Set the speed of travel
speed = 10;
for (z = 0; z < pathNodes.size; z++ ) {
object rotateto (pathNodes[z].angles, speed);
object moveto (pathNodes[z].origin, speed);
object waittill("movedone");
}
}
buildPath (fromNode) {
pathNodes = [];
nextNode = getent(fromNode.target, "targetname");
while (isdefined(nextNode)) {
pathNodes[pathNodes.size] = nextNode;
if (!isdefined(nextNode.target))
nextNode = undefined;
else
nextNode = getent(nextNode.target, "targetname");
}
return pathNodes;
}
|
|
|
|