UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: MakeCents on April 02, 2014, 06:40:21 pm

Title: Moving misc_turret?
Post by: MakeCents on April 02, 2014, 06:40:21 pm
Can someone point me in a direction in which I could learn, if this is possible, how to make a misc_turret move? I have a script_brushmodel that moves around and an auto turret system. I would like to add/link an auto turret to the brushmodel. Everything I tried so far either renders the turret useless, doesn't move the turret and sometimes the brushmodel, or the turret just disappears.

Thanks!
Title: Re: Moving misc_turret?
Post by: Gabe on April 14, 2014, 09:08:00 am
select the turret and press 'N' then click where it says classname misc_turret or what ever and change it to this:
Key: classname
vaule: script_turret

then give it a targetname  and get the entity in the gsc..
and now you can do moveY with this model.. etc.
Title: Re: Moving misc_turret?
Post by: YaPh1l on April 14, 2014, 11:47:47 am
Have you tested that?

- Phil.
Title: Re: Moving misc_turret?
Post by: Gabe on April 14, 2014, 01:14:58 pm
Have you tested that?

- Phil.

That post was so pointless  :lol: :lol:
Title: Re: Moving misc_turret?
Post by: YaPh1l on April 14, 2014, 01:45:07 pm
Let me rephrase it:
A misc_turret already is an entity accessible by script, so I would not see why one would have to change the classname to 'script_turret'. Furthermore, I have not seen a classname of 'script_turret' being available in Radiant. Therefore, I want to express my doubt regarding the functionality of your provided solution and hereby ask for test results to show that it does work.

Thank you very much,
- Phil.
Title: Re: Moving misc_turret?
Post by: Gabe on April 14, 2014, 01:55:11 pm
im sorry i was refering to misc_model --> script_model

im new to the turret stuff.. :p
Title: Re: Moving misc_turret?
Post by: MakeCents on April 15, 2014, 03:41:13 am
Have you tested that?

- Phil.
Thanks for looking out.

im sorry i was refering to misc_model --> script_model

im new to the turret stuff.. :p
Thanks for trying anyway. I appreciate the effort.


SOLVED

I found this link (http://www.zombiemodding.com/index.php?topic=10995.msg119975#msg119975) using linkto in a script, tried it, and there you go.

Code Snippet
Plaintext
        thingtolinkto = getent("thingtolinkto", "targetname"); //get the thing you want to link to while it moves
turret = spawnTurret( "misc_turret", thingtolinkto.origin + (0,0,20), "mg42_bipod_stand" ); //adjust position
turret setModel("mounted_ger_mg42_bipod_mg"); //set model
//other settings...
turret linkto(thingtolinkto); //This is the magic line to make it work
turret.targetname = "auto_mg"; //added this and now my auto turret system uses it