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 03-21-2007, 09:16 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Cool Rotaion?

how do u rotat things?
i tryed this:
PHP Code:
//#CLIENTSIDE
if (created) {
this.rotate =59;

then i tryed to make it random:
PHP Code:
//#CLIENTSIDE
if (created) {
this.rotate random(0,360);

but non of them work
__________________
**FLIP OUT**
Reply With Quote
  #2  
Old 03-21-2007, 09:30 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Good question, Lol.

I don't think it works in Gs1, Only in Gs2 I think . . .
__________________
What signature? I see no signature?
Reply With Quote
  #3  
Old 03-21-2007, 09:35 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Ya, GS2 only... and I believe it's in radians, not degrees.
pi*2=360 degrees
Reply With Quote
  #4  
Old 03-21-2007, 09:38 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
You can easier get radians from degrees using the degtorad(int deg) command.
__________________
Skyld
Reply With Quote
  #5  
Old 03-21-2007, 09:55 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
That doesnt answer the question tho.

To rotate like an image do:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
with findImg200)) {
    
image "block.png";
    
thiso.x;
    
thiso.y;
    
rotation degtoraddegrees);
    
layer 4;
  }

(replace degrees with a number)
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #6  
Old 03-21-2007, 10:55 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by theHAWKER View Post
how do u rotat things?
i tryed this:
PHP Code:
//#CLIENTSIDE
if (created) {
this.rotate =59;

then i tryed to make it random:
PHP Code:
//#CLIENTSIDE
if (created) {
this.rotate random(0,360);

but non of them work
1st. Script

Well, this.rotate in GS1 or GS2 is only a variable holder an not any kind of parameter, or event.

(I forget the proper name.)

2nd. Script

How would random change anything? >_>
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #7  
Old 03-21-2007, 11:01 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by killerogue View Post
2nd. Script

How would random change anything? >_>
He wanted to get a random angle for the rotation.
Reply With Quote
  #8  
Old 03-21-2007, 11:21 PM
killerogue killerogue is offline
Registered Omega
killerogue's Avatar
Join Date: Apr 2006
Location: United States
Posts: 1,920
killerogue is on a distinguished road
Send a message via AIM to killerogue Send a message via MSN to killerogue
Quote:
Originally Posted by DustyPorViva View Post
He wanted to get a random angle for the rotation.
I meant as far as it working or not.
__________________


REMEMBER, IF YOU REP ME, LEAVE A NAME!

Quote:
Originally Posted by haunter View Post
Graal admins don't die. They go to hell and regroup.
Quote:
Originally Posted by Inverness View Post
Without scripters, your graphics and levels wouldn't do anything but sit there and look pretty.
Reply With Quote
  #9  
Old 03-22-2007, 02:44 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Smile

Quote:
Originally Posted by killerogue View Post
I meant as far as it working or not.
i was just trying somthing difrent

And thankyou contiga
__________________
**FLIP OUT**
Reply With Quote
  #10  
Old 03-22-2007, 02:47 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Yeah, 'this.rotate' is just a variable and won't affect the NPC much.
__________________
What signature? I see no signature?
Reply With Quote
  #11  
Old 03-22-2007, 03:08 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
w8 a sec that script dosn't work x.x
__________________
**FLIP OUT**
Reply With Quote
  #12  
Old 03-22-2007, 05:00 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Your grammar makes me nauseous.
__________________
Reply With Quote
  #13  
Old 03-22-2007, 10:59 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
with (findImg(200)) {
    
player.xplayer.y;
    
image "block.png";
    
rotation += .1;
  }

This will make a block spin to the left over, and over, and OVER AGAIN! I think you got the brains enough to make it spin to the right!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #14  
Old 03-24-2007, 04:02 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
rotation = random(0, 2*pi) should work
Reply With Quote
  #15  
Old 03-29-2007, 02:01 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
ok thanks guys
__________________
**FLIP OUT**
Reply With Quote
  #16  
Old 03-29-2007, 08:30 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Yeah, I know TServerPlayer's have the rotation variable...I think TServerNPC's do aswell.

So a "this.rotation = float;" should suffice.
__________________
Do it with a DON!
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 12:28 AM.


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