Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-27-2011, 08:44 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
@ crow, alright, I'll try that direction thing. But I've tried the 1.5 & 2 thing already. If the player is being flung back too fast, it'll just stick you in a wall (or through 1-block walls).

@ cbk, ah, no wonder that wasn't working

@ jerret, I took a look at that already, but I can't really understand some of it since I have no real way of searching for what the "%" and "?" 'math' symbols do. I asked in another thread ages ago and never got a response. Though, while I'm on the topic again, anyone care to enlighten me on what they actually mean and how they work?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 02-27-2011, 08:53 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Jiroxys7 View Post
@ jerret, I took a look at that already, but I can't really understand some of it since I have no real way of searching for what the "%" and "?" 'math' symbols do. I asked in another thread ages ago and never got a response. Though, while I'm on the topic again, anyone care to enlighten me on what they actually mean and how they work?
Modulus (%): Computes the remainder of a division operation. Which is useful for keeping a number within a certain range since it guarantees the number will never be bigger than the number you specify.

PHP Code:
function onCreated() {
  echo(
10 3);
  echo(
12 3);

Ternary (?): (statement ? trueresult : falseresult)

PHP Code:
function onCreated() {
  
temp.result true;
  echo((
temp.result "Yes" "No"));

It's more so for quick and dirty work, beats writing an if statement like this:

PHP Code:
function onCreated() {
  
temp.result true;
  if (
temp.result) {
    echo(
"Yes");
  } else {
    echo(
"No");
  }

__________________
Quote:
Reply With Quote
  #3  
Old 02-28-2011, 03:22 PM
TheRuckus TheRuckus is offline
Registered User
TheRuckus's Avatar
Join Date: Jan 2010
Posts: 147
TheRuckus can only hope to improve
Quote:
Originally Posted by fowlplay4 View Post
Modulus (%): Computes the remainder of a division operation. Which is useful for keeping a number within a certain range since it guarantees the number will never be bigger than the number you specify.

PHP Code:
function onCreated() {
  echo(
10 3);
  echo(
12 3);

Ternary (?): (statement ? trueresult : falseresult)

PHP Code:
function onCreated() {
  
temp.result true;
  echo((
temp.result "Yes" "No"));

It's more so for quick and dirty work, beats writing an if statement like this:

PHP Code:
function onCreated() {
  
temp.result true;
  if (
temp.result) {
    echo(
"Yes");
  } else {
    echo(
"No");
  }

When theres a day you don't know how to fix something a hero will rise and become the new manager of zodiac. (not like its gonna happend.)
__________________


Tince thinks hes god.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:19 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.