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 07-28-2001, 04:37 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
this.radius, etc.

Ok I know this is a n00b question, but here goes:
How do you just have something move in a circle repeatedly? I hardly ever need it, but when I do, I get mad that I haven't learned it. I know it uses stuff like this.radius, but I forgot how...
__________________

-=Shard IceFire=-
Reply With Quote
  #2  
Old 07-28-2001, 05:09 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
this.radius is just a made up var..
you dont really need it . I personally use it just to say how far from the player. here is a little code for money that goes in a circle with adding radius(called spiraladd if u notice)..
NPC Code:

//npc made by LiquidIce
if (playertouchsme) {
toweapons Spiral Gold;
}

if (weaponfired) {
this.angle=0;
this.radius = 3;
this.spiraladd = 0;
while (this.angle<10) {
this.x=sin(this.angle);
this.y=cos(this.angle);
this.x*=(this.radius+this.spiraladd);
this.y*=(this.radius+this.spiraladd);
this.x+=(playerx);
this.y+=(playery);
lay2 goldrupee,this.x,this.y;
this.angle+=.2;
this.spiraladd+=.2;
sleep .01;
}
}

__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #3  
Old 07-28-2001, 05:12 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:
NPC Code:


if (playerenters||timeout) {
timeout = .05;
this.radius = 10;
this.angle+=.314;
this.x = x+sin(this.angle)*this.radius;
this.y = y+cos(this.angle)*this.radius;
showimg 0,@Arial@@hi friend,this.x,this.y;
}

Reply With Quote
  #4  
Old 07-28-2001, 05:17 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Brady2
Jadis:
NPC Code:


if (playerenters||timeout) {
timeout = .05;
this.radius = 10;
this.angle+=.314;
this.x = x+sin(this.angle)*this.radius;
this.y = y+cos(this.angle)*this.radius;
showimg 0,@Arial@@hi friend,this.x,this.y;
}

I suggest you reset the angle every circle it does , else in minutes it will be a HUGEEEEEEEEEEEEEE variable.

and forgot here is the code
NPC Code:

if (playerenters||timeout) {
timeout = .05;
this.radius = 10;
this.angle+=.314;
if (this.angle>6.28) { this.angle=.314; }
this.x = x+sin(this.angle)*this.radius;
this.y = y+cos(this.angle)*this.radius;
showimg 0,@Arial@@hi friend,this.x,this.y;
}

__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #5  
Old 07-28-2001, 05:17 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
Thanks!
__________________

-=Shard IceFire=-
Reply With Quote
  #6  
Old 07-28-2001, 05:24 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:

It does not matter
Reply With Quote
  #7  
Old 07-28-2001, 05:53 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by Brady2
Jadis:

It does not matter
well if i idle in your level for a bit the variable gets hugeeeeee
it matters =(
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #8  
Old 07-28-2001, 05:59 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
this.angle=this.angle%6.28
__________________

Reply With Quote
  #9  
Old 07-29-2001, 03:27 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
Quote:
Originally posted by grim_squeaker_x
this.angle=this.angle%6.28
liek lol . i aint a math magician . im used to if .. but yeah u can just use MOD..
but it would be
this.angle=(this.angle+.324)%6.28;
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)

Last edited by LiquidIce00; 07-29-2001 at 03:29 AM..
Reply With Quote
  #10  
Old 07-29-2001, 06:33 AM
Brady2 Brady2 is offline
Registered User
Brady2's Avatar
Join Date: Mar 2001
Location: Phoenix, AZ and Wichita Falls, TX
Posts: 924
Brady2 is on a distinguished road
Jadis:

you said .324!!!!!!!!!!!!!!!!!
Reply With Quote
  #11  
Old 07-29-2001, 09:06 AM
LiquidIce00 LiquidIce00 is offline
RadioActive Monkeeh
LiquidIce00's Avatar
Join Date: Apr 2001
Location: dirty south
Posts: 2,112
LiquidIce00 is on a distinguished road
Send a message via ICQ to LiquidIce00 Send a message via AIM to LiquidIce00 Send a message via Yahoo to LiquidIce00
.314 or .324 .. who cares =)
__________________
LiquidIce *Owner* (UnholyNation)
-UN Website
http://www.unholynation.com
-UN Forum
http://forums.unholynation.com
-
-the thinker
-

-
onwall2 for nonp2p (i suck at onwall)
Reply With Quote
  #12  
Old 07-29-2001, 03:32 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by LiquidIce00


liek lol . i aint a math magician . im used to if .. but yeah u can just use MOD..
but it would be
this.angle=(this.angle+.324)%6.28;
Actually in Graal you can just use mod.
__________________

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 11:06 AM.


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