UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

How to make moving/rotating platforms?

broken avatar :(
Created 9 years ago
by COD4LIFE
0 Members and 1 Guest are viewing this topic.
3,133 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 20 August 2013
Last active: 3 years ago
Posts
23
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
Signature
×
COD4LIFE's Groups
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

Linking "mp_test" (usermaps\mp_test stable 2535281 v593):
processing...

********************************************************************************
UNRECOVERABLE ERROR:
  ^1SCRIPT ERROR: No generated data for 'scripts/mp/mp_test.gsc'
ERR(0) scripts/mp/mp_test.gsc (52,76) in "handleloopingrotation()" : syntax error, unexpected TOKEN_COMMA :         rotation_origin rotateTo( rotation_origin.angles + rotation_vector),


Linker will now terminate.
********************************************************************************

==================================================
Linker summary:

There were no errors or warnings.

==================================================

^1        rotation_origin rotateTo( rotation_origin.angles + rotation_vector),
^1---------------------------------------------------------------------------^
^1ERR(0) scripts/mp/mp_test.gsc (52,76) in "handleloopingrotation()" : syntax error, unexpected TOKEN_COMMA :         rotation_origin rotateTo( rotation_origin.angles + rotation_vector),

Also this is what my mapname.gsc looks like
Spoiler: click to open...
Code Snippet
Plaintext
#using scripts\codescripts\struct;
#using scripts\shared\util_shared;
#using scripts\mp\_load;
#using scripts\mp\_util;
#using scripts\mp\mp_test_fx;
#using scripts\mp\mp_test_sound;

#insert scripts\shared\shared.gsh;

function main()
{
precache();

mp_test_fx::main();
mp_test_sound::main();

load::main();

SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
}
function main()
{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}
 
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
}

Marked as best answer by COD4LIFE 9 years ago
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 9 months ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies
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

Linking "mp_test" (usermaps\mp_test stable 2535281 v593):
processing...

********************************************************************************
UNRECOVERABLE ERROR:
  ^1SCRIPT ERROR: No generated data for 'scripts/mp/mp_test.gsc'
ERR(0) scripts/mp/mp_test.gsc (52,76) in "handleloopingrotation()" : syntax error, unexpected TOKEN_COMMA :         rotation_origin rotateTo( rotation_origin.angles + rotation_vector),


Linker will now terminate.
********************************************************************************

==================================================
Linker summary:

There were no errors or warnings.

==================================================

^1        rotation_origin rotateTo( rotation_origin.angles + rotation_vector),
^1---------------------------------------------------------------------------^
^1ERR(0) scripts/mp/mp_test.gsc (52,76) in "handleloopingrotation()" : syntax error, unexpected TOKEN_COMMA :         rotation_origin rotateTo( rotation_origin.angles + rotation_vector),

Also this is what my mapname.gsc looks like
Spoiler: click to open...
Code Snippet
Plaintext
#using scripts\codescripts\struct;
#using scripts\shared\util_shared;
#using scripts\mp\_load;
#using scripts\mp\_util;
#using scripts\mp\mp_test_fx;
#using scripts\mp\mp_test_sound;

#insert scripts\shared\shared.gsh;

function main()
{
precache();

mp_test_fx::main();
mp_test_sound::main();

load::main();

SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
}
function main()
{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}
 
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.

Change this:
Code Snippet
Plaintext
rotation_origin rotateTo( rotation_origin.angles + rotation_vector), 5 );

to this:
Code Snippet
Plaintext
rotation_origin rotateTo( (rotation_origin.angles + rotation_vector), 5 );
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 20 August 2013
Last active: 3 years ago
Posts
23
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
COD4LIFE's Groups
The reason you are getting that error is because you missed a bracket.

Change this:
Code Snippet
Plaintext
rotation_origin rotateTo( rotation_origin.angles + rotation_vector), 5 );

to this:
Code Snippet
Plaintext
rotation_origin rotateTo( (rotation_origin.angles + rotation_vector), 5 );


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.
********************************************************************************

==================================================
Linker summary:

There were no errors or warnings.

==================================================

^1{
^1^
^1ERR(0) scripts/mp/mp_test.gsc (22,1)  : syntax error, unexpected TOKEN_LEFT_CURLY, expecting $end : {

My GSC:
Spoiler: click to open...
Code Snippet
Plaintext
#using scripts\codescripts\struct;
#using scripts\shared\util_shared;
#using scripts\mp\_load;
#using scripts\mp\_util;
#using scripts\mp\mp_test_fx;
#using scripts\mp\mp_test_sound;

#insert scripts\shared\shared.gsh;

function main()
{
precache();

mp_test_fx::main();
mp_test_sound::main();

load::main();

SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
}

{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}
 
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
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 12 September 2016
Last active: 9 months ago
Posts
306
Respect
Forum Rank
Perk Hacker
Primary Group
Member
My Contact & Social Links
More
×
reckfullies's Groups
reckfullies's Contact & Social LinksReckfulliesReckfullies

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.
********************************************************************************

==================================================
Linker summary:

There were no errors or warnings.

==================================================

^1{
^1^
^1ERR(0) scripts/mp/mp_test.gsc (22,1)  : syntax error, unexpected TOKEN_LEFT_CURLY, expecting $end : {

My GSC:
Spoiler: click to open...
Code Snippet
Plaintext
#using scripts\codescripts\struct;
#using scripts\shared\util_shared;
#using scripts\mp\_load;
#using scripts\mp\_util;
#using scripts\mp\mp_test_fx;
#using scripts\mp\mp_test_sound;

#insert scripts\shared\shared.gsh;

function main()
{
precache();

mp_test_fx::main();
mp_test_sound::main();

load::main();

SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
}

{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}
 
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
}

Not sure why this is here:
Code Snippet
Plaintext
{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}

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

         // normal code here
   
        thread handleLoopingRotation( "platform targetname");
}

instead of 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
}

{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 20 August 2013
Last active: 3 years ago
Posts
23
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
COD4LIFE's Groups
Not sure why this is here:
Code Snippet
Plaintext
{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}

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

         // normal code here
   
        thread handleLoopingRotation( "platform targetname");
}

instead of 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
}

{
    // normal code here
   
    thread handleLoopingRotation( "platform targetname");
}


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.
********************************************************************************

==================================================
Linker summary:

There were no errors or warnings.

==================================================

^1}
^1^
^1ERR(6E) scripts/mp/mp_test.gsc (36,1)  : Compiler Internal Error :  Uninitialized local variable 'origin'

and again my gsc (fixed from last error)
Spoiler: click to open...
Code Snippet
Plaintext
#using scripts\codescripts\struct;
#using scripts\shared\util_shared;
#using scripts\mp\_load;
#using scripts\mp\_util;
#using scripts\mp\mp_test_fx;
#using scripts\mp\mp_test_sound;

#insert scripts\shared\shared.gsh;

function main()
{
precache();

mp_test_fx::main();
mp_test_sound::main();

load::main();

SetDvar( "compassmaxrange", "2100" ); // Set up the default range of the compass
 
// normal code here
   
   thread handleLoopingRotation( "platform targetname");
}
 
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.

In any case I really appreciate your help.
broken avatar :(
×
broken avatar :(
Location: au
Date Registered: 9 October 2016
Last active: 6 years ago
Posts
53
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
×
kaizokuroof's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
kaizokuroof's Contact & Social Links
Hi There,

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 :D but I'm pretty sure that's where your problem lies.

 
Loading ...