UGX-Mods

Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: Doodles_Inc on June 26, 2017, 05:25:37 pm

Title: Shadows of Evil cable car
Post by: Doodles_Inc on June 26, 2017, 05:25:37 pm
Is it already possible to remake? How complex would be the script? (Like, how much knowledge in C scripting I would need to have) I don't really think that anyone would do a script of the SoE cableway and share ir with everyone, but, I would like to know if it's possible already to do it.
Title: Re: Shadows of Evil cable car
Post by: Archaicvirus on July 03, 2017, 03:51:48 pm
It is possible, definitely. First you would use wraith to export the models, then place the train in radiant as a script_model. After that put in some clip brushes so the train has collision, make sure the clips are all script_brushmodels. As far as moving the train, you could set up a network of "path" nodes, which are script_origins, line them up evenly spaced apart, and make sure to rotate them when going around curves. That way you can rotate the train to the angles of the script_origins so it always faces the right way. The scripting would go something like: (pseudo)

Code Snippet
Plaintext
//Remember to make the train model in radiant a script_model, and clip it with script_brushmodels
//Then give the train a targetname - train_test. Now make the train target each clip. Select train, then clip, hit W (repeat for all clips)

function train_init()
{
train = GetEnt("train_test", "targetname");
train_clips = GetEntArray(train.target, "targetname");

foreach(clip in train_clips)
{
clip SetMovingPlatformEnabled(true);
clip EnableLinkTo();
clip LinkTo(train);
}

//You would need to set up script_origins in radiant along the path the train will travel
//We'll call these 'nodes' for now
//From the starting node, link the first node to the 2nd, 2nd to the 3rd, until you reach the last node.
//Give the first node a script_noteworthy - start_node
//And the last node a script_noteworthy - end_node
//The train should already be at the start_node
train.start = GetEnt("start_node", "script_noteworthy");
train.trig = GetEnt("your_trig", "targetname");
train thread train_move();
}

function train_move()
{
self.trig waittill("trigger");
next_node = self.start;

while(1)
{
next_node = GetEnt(next_node.target, "targetname");
self MoveTo(next_node.origin, 1);
self RotateTo(next_node.angles);
self waittill("movedone");
if(next_node.script_noteworthy == "end_node")
{
break;
}
}

}

This is off the top of my head, but this general method does work. Me and another mapper had this system pretty polished until my ssd failed, so I don't have any of the scripts or else I'd give them to you. Keep in mind you have to set up logic for the doors opening/closing, and for different paths the train will take. Again this script isn't complete by any means. This should get you started though.
Title: Re: Shadows of Evil cable car
Post by: Archaicvirus on November 29, 2017, 08:36:00 pm
Awesome man, I hope you got this working, would love to see it in action!
Title: Re: Shadows of Evil cable car
Post by: Doodles_Inc on December 16, 2017, 05:55:39 pm
Awesome man, I hope you got this working, would love to see it in action!
It's almost ready, I stopped using the mod tools for a while, but, I think that I will release my full map this month (december)
Title: Re: Shadows of Evil cable car
Post by: Archaicvirus on December 17, 2017, 03:59:21 am
Sounds good, let me know when you do. Ill have to download it