View Single Post
  #1  
Old 08-08-2010, 11:04 AM
khortez khortez is offline
PrototypeX
khortez's Avatar
Join Date: Dec 2008
Posts: 91
khortez will become famous soon enough
Scripting questions

I've looked around, and I don't see anyone else asking these questions so I'll ask them here. Please try to answer my questions in the simplest form that you can. There will be multiple questions. And a attempt to make things easier, I'll post 1/2 of the script & function here, and ask questions below it.



In trying to make my questions clear and less missunderstood, I bolded the questions... So I hope there won't be no missunderstandings.



PHP Code:
function onTimeout(){ 

temp.= (player.vecx(player.dir) * 1.5) + this.origins(player.dir[0]);
temp.= (player.vecy(player.dir) * 4) + this.origins(player.dir[1]);

temp.angle = (pi 2) * (player.dir );

for(
temp.0this.bullets i ++)
shoot(xyzangle random((- this.spray), this.spray));


As some of you probably have obviously noticed already, theres quite a bit missing in the script. Note I have only left the portion of the script that I'm unsure of. And some pieces that possibly might help you answer my questions better.



Questions:

First off can someone explain "for"? I thought I had a good grip on what it means but I'm not sure anymore.



Note: this.bullets is how many shots fired/taken away from the gun.







Just to save trouble for posting later.. I'll ask about these too.

Whats the diffrence between player.x and vecx?




And most likely a dumb question but,

is random a event?

Not sure of its purpose but believe it to regulate the spread.



Last two questions...

And in temp.x , does(player.dir[1]) mean the first direction?



In (temp.angle = (pi / 2) * (player.dir + 1);

Also does player.dir + 1 mean the first direction?


If not what do they mean?


thanks to whoever reads this and tries to help me for your time.
Reply With Quote