Hi, I was wondering if someone could show me how make a moving and rotating platform(s).
I tried using this --> http://pastebin.com/QRLw5Cmr tutorial I got from a friend, I followed it exactly but I get this error when trying to link my map. This is a MP map.
Error:
Spoiler: click to open...
Code Snippet
Plaintext
C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops III\\gdtdb\gdtdb.exe /update
gdtDB: updating
processed (0 GDTs) (0 assets) in 2.564 sec
gdtDB: successfully updated database.
C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops III\\bin\linker_modtools.exe -language english -modsource mp_test
function handleLoopingRotation( targetname ) { pieces = getEntArray( self.targetname, "targetname" ); // The script_brushmodels rotation_origin = getEnt( pieces[1].target, "targetname" ); // The rotation origin, grabbed from the target of the first script_brushmodel
// Exit function if the pieces don't exist if( !isDefined( pieces ) ) return;
// Don't set this to 360, otherwise the rotation will instantly end since 360 is the same as 0. rotation_vector = origin.script_vector; rotation_origin EnableLinkTo();
// Link the script_brushmodels to the origin, meaning they will inherit it's angles and origin // This is how you get around having individual script_brushmodels rotating on their own axis for( i = 0; i < pieces.size; i++ ) { pieces[i] EnableLinkTo(); pieces[i] LinkTo( rotation_origin ); }
while(1) { // Make the origin rotate to a new angle over 5 seconds rotation_origin rotateTo( rotation_origin.angles + rotation_vector), 5 ); // Wait for the rotation to finish before starting again rotation_origin waittill( "rotatedone" ); } } function precache() { // DO ALL PRECACHING HERE }
Hi, I was wondering if someone could show me how make a moving and rotating platform(s).
I tried using this --> http://pastebin.com/QRLw5Cmr tutorial I got from a friend, I followed it exactly but I get this error when trying to link my map. This is a MP map.
Error:
Spoiler: click to open...
Code Snippet
Plaintext
C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops III\\gdtdb\gdtdb.exe /update
gdtDB: updating
processed (0 GDTs) (0 assets) in 2.564 sec
gdtDB: successfully updated database.
C:\Program Files (x86)\Steam\steamapps\common\Call of Duty Black Ops III\\bin\linker_modtools.exe -language english -modsource mp_test
function handleLoopingRotation( targetname ) { pieces = getEntArray( self.targetname, "targetname" ); // The script_brushmodels rotation_origin = getEnt( pieces[1].target, "targetname" ); // The rotation origin, grabbed from the target of the first script_brushmodel
// Exit function if the pieces don't exist if( !isDefined( pieces ) ) return;
// Don't set this to 360, otherwise the rotation will instantly end since 360 is the same as 0. rotation_vector = origin.script_vector; rotation_origin EnableLinkTo();
// Link the script_brushmodels to the origin, meaning they will inherit it's angles and origin // This is how you get around having individual script_brushmodels rotating on their own axis for( i = 0; i < pieces.size; i++ ) { pieces[i] EnableLinkTo(); pieces[i] LinkTo( rotation_origin ); }
while(1) { // Make the origin rotate to a new angle over 5 seconds rotation_origin rotateTo( rotation_origin.angles + rotation_vector), 5 ); // Wait for the rotation to finish before starting again rotation_origin waittill( "rotatedone" ); } } function precache() { // DO ALL PRECACHING HERE }
The reason you are getting that error is because you missed a bracket.
Ok, so I've fixed that error, and now it gives me another.
I know its saying something about Line 22, but sorry I'm a complete noob when it comes to scripting. Any clue what I need to change?
Spoiler: click to open...
Code Snippet
Plaintext
******************************************************************************** UNRECOVERABLE ERROR: ^1SCRIPT ERROR: No generated data for 'scripts/mp/mp_test.gsc'
Linker will now terminate. ********************************************************************************
function handleLoopingRotation( targetname ) { pieces = getEntArray( self.targetname, "targetname" ); // The script_brushmodels rotation_origin = getEnt( pieces[1].target, "targetname" ); // The rotation origin, grabbed from the target of the first script_brushmodel
// Exit function if the pieces don't exist if( !isDefined( pieces ) ) return;
// Don't set this to 360, otherwise the rotation will instantly end since 360 is the same as 0. rotation_vector = origin.script_vector; rotation_origin EnableLinkTo();
// Link the script_brushmodels to the origin, meaning they will inherit it's angles and origin // This is how you get around having individual script_brushmodels rotating on their own axis for( i = 0; i < pieces.size; i++ ) { pieces[i] EnableLinkTo(); pieces[i] LinkTo( rotation_origin ); }
while(1) { // Make the origin rotate to a new angle over 5 seconds rotation_origin rotateTo( (rotation_origin.angles + rotation_vector), 5 ); // Wait for the rotation to finish before starting again rotation_origin waittill( "rotatedone" ); } } function precache() { // DO ALL PRECACHING HERE }
Ok, so I've fixed that error, and now it gives me another.
I know its saying something about Line 22, but sorry I'm a complete noob when it comes to scripting. Any clue what I need to change?
Spoiler: click to open...
Code Snippet
Plaintext
******************************************************************************** UNRECOVERABLE ERROR: ^1SCRIPT ERROR: No generated data for 'scripts/mp/mp_test.gsc'
Linker will now terminate. ********************************************************************************
function handleLoopingRotation( targetname ) { pieces = getEntArray( self.targetname, "targetname" ); // The script_brushmodels rotation_origin = getEnt( pieces[1].target, "targetname" ); // The rotation origin, grabbed from the target of the first script_brushmodel
// Exit function if the pieces don't exist if( !isDefined( pieces ) ) return;
// Don't set this to 360, otherwise the rotation will instantly end since 360 is the same as 0. rotation_vector = origin.script_vector; rotation_origin EnableLinkTo();
// Link the script_brushmodels to the origin, meaning they will inherit it's angles and origin // This is how you get around having individual script_brushmodels rotating on their own axis for( i = 0; i < pieces.size; i++ ) { pieces[i] EnableLinkTo(); pieces[i] LinkTo( rotation_origin ); }
while(1) { // Make the origin rotate to a new angle over 5 seconds rotation_origin rotateTo( (rotation_origin.angles + rotation_vector), 5 ); // Wait for the rotation to finish before starting again rotation_origin waittill( "rotatedone" ); } } function precache() { // DO ALL PRECACHING HERE }
The reason you are getting an error is because there are just a few brackets placed here without any function or anything. You would need to move this, it should probably be like this:
Code Snippet
Plaintext
function main() { precache();
mp_test_fx::main(); mp_test_sound::main();
load::main();
SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
The reason you are getting an error is because there are just a few brackets placed here without any function or anything. You would need to move this, it should probably be like this:
Code Snippet
Plaintext
function main() { precache();
mp_test_fx::main(); mp_test_sound::main();
load::main();
SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
Ok, well I'm starting to feel like a complete asshole for asking for help after each error, but I'm still getting another error . I was wondering if you might be able to set up a test map of your own, and use this code, then code share me your gsc, instead of just waiting for me to test it out, its completely up to you, but it might save alot more questions.
Here is the error i got:
Spoiler: click to open...
Code Snippet
Plaintext
******************************************************************************** UNRECOVERABLE ERROR: ^1SCRIPT ERROR: No generated data for 'scripts/mp/mp_test.gsc' ERR(6E) scripts/mp/mp_test.gsc (36,1) : Compiler Internal Error : Uninitialized local variable 'origin'
Linker will now terminate. ********************************************************************************
function handleLoopingRotation( targetname ) { pieces = getEntArray( self.targetname, "targetname" ); // The script_brushmodels rotation_origin = getEnt( pieces[1].target, "targetname" ); // The rotation origin, grabbed from the target of the first script_brushmodel
// Exit function if the pieces don't exist if( !isDefined( pieces ) ) return;
// Don't set this to 360, otherwise the rotation will instantly end since 360 is the same as 0. rotation_vector = origin.script_vector; rotation_origin EnableLinkTo();
// Link the script_brushmodels to the origin, meaning they will inherit it's angles and origin // This is how you get around having individual script_brushmodels rotating on their own axis for( i = 0; i < pieces.size; i++ ) { pieces[i] EnableLinkTo(); pieces[i] LinkTo( rotation_origin ); }
while(1) { // Make the origin rotate to a new angle over 5 seconds rotation_origin rotateTo( (rotation_origin.angles + rotation_vector), 5 ); // Wait for the rotation to finish before starting again rotation_origin waittill( "rotatedone" ); } }
function precache() { // DO ALL PRECACHING HERE }
Perhaps instead of making a test map, just show me exactly how you would insert this code into your gsc.
I have some basic knowledge when it comes to scripting, but I'm not really all that great. The error though, seems to be that you're calling a variable that isn't initialised. So you're calling 'origin' but you haven't set origin in the script anywhere.
Uninitialized local variable 'origin'
It's here:
rotation_vector = origin.script_vector;
Maybe it should be rotation_origin.script_vector; so that you're calling the entity that you wanna grab the origin from. So basically it's saying "Hey bro, this is my origin.Now change to script vector" or something like that; I haven't watched the tutorial and I do find it pretty hard to go through the code, so apologies if this is wrong. Worth a try maybe but I'm pretty sure that's where your problem lies.