View Single Post
PT32 PT32's Avatar

JCF Member

Joined: Jul 2008

Posts: 274

PT32 is an asset to this forum

Jul 23, 2018, 10:19 AM
PT32 is offline
Reply With Quote
So I'm reading the walkthrough and trying to wrap my head around how to write AngelScript code, and it's a bit overwhelming. Could I get some laymen's tips on basic syntax and code structure so I can figure it out, get a good grasp on it? For instance, I'd like to generate an AngelScript using this zero gravity snippet Violet provided...

Quote:
Originally Posted by Violet CLM View Post
Code:
array<float> ZeroGravityVerticalPosition(jjLocalPlayerCount, -1);
void onFunction0(jjPLAYER@ play, bool enableZeroGravity) {
  ZeroGravityVerticalPosition[play.localPlayerID] = enableZeroGravity ? play.yPos : -1;
}
void onPlayer(jjPLAYER@ play) {
  if (ZeroGravityVerticalPosition[play.localPlayerID] != -1) {
    play.yPos = ZeroGravityVerticalPosition[play.localPlayerID];
    play.ySpeed = 0;
  }
}
...but because I don't understand the syntax, I don't know how to properly put it into an AngelScript. I'm no good with coding and such so this isn't coming very easily to me.

Thanks!
__________________
Don't say "cannot," say "why not?"

IN DEVELOPMENT:
Renascence: The Last Jackrabbit