Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial Turrets
#11
but when i do player.origin. i get a error
player undefined or something
or ist hat cuz im playing with bots lol?
Reply

#12
You should really learn some basic gsc before you start with the 'harder' stuff, like making turrets. There are plenty of tutorials in the tutorial section, I suggest you read them.
[Image: MaEIQ.png]
Reply

#13
(02-01-2012, 17:54)GscGunner Wrote: but when i do player.origin. i get a error
player undefined or something
or ist hat cuz im playing with bots lol?

*sigh*

http://wiki.modsrepository.com/index.php...troduction
Reply

#14
I KNOW THE BASICS. damn

i just want to know what i need to replace the self.origin with what...

damn, cant somebody just give it me -.-
wow, rendflex thnx for that link
somethings i didn't know y et or didnt totally understand are in there, didnt found .origin yet or that kind of stuff
Reply

#15
(02-01-2012, 18:44)GscGunner Wrote: I KNOW THE BASICS. damn

i just want to know what i need to replace the self.origin with what...

damn, cant somebody just give it me -.-
wow, rendflex thnx for that link
somethings i didn't know y et or didnt totally understand are in there, didnt found .origin yet or that kind of stuff

Well, you should certainly learn more of the "basics" Tongue

The .origin is a location, just as coordinates.
(-5135, 1351, 1238) is a origin, you could make the turret fire at that position if you put that instead of zombi.origin.

But there's a function in-game which checks the current position of something, by adding ".origin" to it.
Reply

#16
yes, im still noob at gsc. but thats why i am here and ask questions, cuz i want to do this stuff later, next year i will be on that 'study thing'....

first: thnx for help, reply

i will first give the code i have now


Code:
turrets()
{
self notifyOnPlayerCommand("3", "+actionslot 3");
self waittill("3");
Turret = spawnTurret( "misc_turret", self.origin, "pavelow_minigun_mp" );
Turret setModel( "sentry_minigun" );

Turret LaserOn();
//Turret SetTurretMinimapVisible( true )
//Turret makeTurretInoperable();
//Turret ShootTurret();
Turret SetMode( "auto_nonai" );

Turret SetRightArc(360);
Turret SetLeftArc(360);
Turret SetTopArc(360);

while(1)
{
wait 0.05;
MagicBullet("famas_mp", turret.origin, self.origin, self);
//MagicBullet("stinger_mp",turret.origin,player.origin+anglestoforward(turret.angles)*350-(0,0,10)-(0,0,randomInt(200)),self);

}
}

- the player.origin gives error,
- self.origin, obviously shoots me
- dont know anymore things to call on .origin
- - - i dont want to let it shoot a coordinate

some more explanations about "player" cuz sometimes error (like now) sometimes not
maybe add each other, so it will be faster solved Big Grin
Reply

#17
(02-01-2012, 19:02)GscGunner Wrote: - the player.origin gives error,
- self.origin, obviously shoots me
- dont know anymore things to call on .origin
- - - i dont want to let it shoot a coordinate

some more explanations about "player" cuz sometimes error (like now) sometimes not
maybe add each other, so it will be faster solved Big Grin

.origin of something gets the coordinate where the thing/player is standing...
"player" obviously doesn't work since "player" isn't defined.
Just self, and the turret is defined right now.

There's a function in MW2, called "foreach", it takes everything from something, and does it.

So eh

Code:
foreach(player in level.players)
{
player iprintlnbold("Test");
}

will get all players, level.players is a array (a list) of all the players on the server.

Take a look at the turret in mine and Yamato's mod "chaotic invasion 2" :p
Reply

#18
thank you very much about the info of "player"

i will look in tot that mod, i looking in it right now
Reply

#19
(02-02-2012, 15:32)GscGunner Wrote: thank you very much about the info of "player"

i will look in tot that mod, i looking in it right now

Great Tongue

That was both mine and Yamato's first "serious" mod Tongue
So I'm sure you'll learn much from there, we had to go through most original game files to find stuffs, @Yamato hadn't made his tutorials yet lol
Reply

#20
(02-02-2012, 16:03)Rendflex Wrote:
(02-02-2012, 15:32)GscGunner Wrote: thank you very much about the info of "player"

i will look in tot that mod, i looking in it right now

Great Tongue

That was both mine and Yamato's first "serious" mod Tongue
So I'm sure you'll learn much from there, we had to go through most original game files to find stuffs, @Yamato hadn't made his tutorials yet lol

My tutorials of what? Huh
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Preview Spinning Turrets Yamato 3 3,192 12-15-2012, 13:18
Last Post: Yamato
  [Request] help automatic turrets tresgroymasters 9 4,917 10-15-2011, 00:37
Last Post: clxyeah

Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.