Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-14-2008, 12:46 PM
MunkyPuff MunkyPuff is offline
Registered User
Join Date: Sep 2008
Posts: 8
MunkyPuff is on a distinguished road
Unhappy slippery ice script help

Hello,

I'm trying to create a script to make ice, but im having trouble getting started.. I'm trying to learn it on my own but I'm wondering if someone could maybe just get me started on the right path. thanks everyone!

~Munkypuff
Reply With Quote
  #2  
Old 10-14-2008, 01:56 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by MunkyPuff View Post
Hello,

I'm trying to create a script to make ice, but im having trouble getting started.. I'm trying to learn it on my own but I'm wondering if someone could maybe just get me started on the right path. thanks everyone!

~Munkypuff
Code Gallery is ment to post scripts that others can use, not ask for help.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #3  
Old 10-14-2008, 11:43 PM
DarkReaper0 DarkReaper0 is offline
No.
DarkReaper0's Avatar
Join Date: May 2005
Location: Texas,USA
Posts: 344
DarkReaper0 will become famous soon enough
Send a message via MSN to DarkReaper0
Here's a starting point:
PHP Code:
//#CLIENTSIDE
function onCreated() onTimeout();

function 
onTimeout() {
  if (
keydown(0)) {
    
//Up
  
} else if (keydown(1)) {
    
//left
  
} else if (keydown(2)) {
    
//down
  
} else if (keydown(3)) {
    
//right
  
}
  
setTimer(.05);

Reply With Quote
  #4  
Old 10-15-2008, 12:23 AM
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
An ice-skating script works best in this way: you have two velocities, X and Y. From there, you add to the X and Y velocities depending on the movement of the player. If they're moving left, subtract X velocity, if they're moving right, add to the X velocity. Do the same for up/down and the Y velocity. It's important to allow these velocities to go into the negatives as well. If the player is not moving, move both X and Y velocities toward 0(until they reach 0).

That's about the gist of it. There is also wall-detection and such.
Reply With Quote
  #5  
Old 10-15-2008, 12:56 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by DarkReaper0 View Post
Here's a starting point:
[Script stuff]

Should do:

PHP Code:
function onTimeOut()
{
 for (
04i++)
  {
   if (
keydown(i))
    {
      
//Do Stuff
    
}
  }
  
setTimer(0.05);

Reply With Quote
  #6  
Old 10-15-2008, 02:16 AM
DarkReaper0 DarkReaper0 is offline
No.
DarkReaper0's Avatar
Join Date: May 2005
Location: Texas,USA
Posts: 344
DarkReaper0 will become famous soon enough
Send a message via MSN to DarkReaper0
Gambet's code is more efficient, but if you're new to scripting you should stick to the simpler one I provided.
Reply With Quote
  #7  
Old 10-15-2008, 02:24 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
Quote:
Originally Posted by DarkReaper0 View Post
Gambet's code is more efficient, but if you're new to scripting you should stick to the simpler one I provided.
No. Might as well teach people the most efficient ways from the start, and we might see an increase of talented scripters.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #8  
Old 10-15-2008, 02:26 AM
DarkReaper0 DarkReaper0 is offline
No.
DarkReaper0's Avatar
Join Date: May 2005
Location: Texas,USA
Posts: 344
DarkReaper0 will become famous soon enough
Send a message via MSN to DarkReaper0
Quote:
Originally Posted by xXziroXx View Post
No. Might as well teach people the most efficient ways from the start, and we might see an increase of talented scripters.
Assuming he knows what a for loop even is.
Reply With Quote
  #9  
Old 10-15-2008, 03:53 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
Quote:
Originally Posted by DarkReaper0 View Post
Assuming he knows what a for loop even is.
If not, now is as good of a time as any to learn.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #10  
Old 10-15-2008, 04:29 AM
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
Orrrrr... he can look at both scripts and see how one translates to the other, in an easier way of understanding and learning.
Reply With Quote
  #11  
Old 10-15-2008, 04:57 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
The examples posted above do not do exactly the same thing, but if conciseness translated well to efficiency, then
PHP Code:
temp.= {keydown(3)-keydown(1),keydown(2)-keydown(0)} 
gives the proper velocity vector, or
PHP Code:
temp.vectornormalize({keydown(3)-keydown(1),keydown(2)-keydown(0),0}).subarray(0,2
for consistent velocity in all directions.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #12  
Old 10-15-2008, 05:33 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by xXziroXx View Post
No. Might as well teach people the most efficient ways from the start, and we might see an increase of talented scripters.
Actually, it's probably important that he sees both ways. That way, he has the opportunity to make the connection between the two.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #13  
Old 10-16-2008, 04:42 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Graal ice scripts never made sense to me. You don't gain speed walking across ice in real life
__________________
Reply With Quote
  #14  
Old 10-16-2008, 02:19 PM
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
Quote:
Originally Posted by Kristi View Post
Graal ice scripts never made sense to me. You don't gain speed walking across ice in real life
Zelda: A Link to the Past started fishy ice scripts, blame them.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #15  
Old 10-16-2008, 02:50 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by xXziroXx View Post
Zelda: A Link to the Past started fishy ice scripts, blame them.
Graal doesnt reflect LTTP scripts, the lttp scripts actually make sense.
__________________
Reply With Quote
  #16  
Old 10-16-2008, 02:55 PM
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
Quote:
Originally Posted by Kristi View Post
Graal doesnt reflect LTTP scripts, the lttp scripts actually make sense.
Come to think about it, I haven't seen a Graal ice script for years - I can't even remember what's so special about them.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #17  
Old 10-16-2008, 02:59 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by xXziroXx View Post
Come to think about it, I haven't seen a Graal ice script for years - I can't even remember what's so special about them.
They progressively add to the speed by a constant velocity as you hold the arrow down (usually), or some variation of that.

I once programmed ice that made sense (to me), where walking normally has absolute friction. If you start on the ice, it is hard to get your speed up because you're walking on ice. It is also hard to stop on ice (it uses friction equations). If you start on land and step on ice, you start with the walking velocity and slow down as you slide across the ice (more friction).

Friction rules. Exercise in mind...
__________________
Reply With Quote
  #18  
Old 10-18-2008, 04:02 PM
DarkReaper0 DarkReaper0 is offline
No.
DarkReaper0's Avatar
Join Date: May 2005
Location: Texas,USA
Posts: 344
DarkReaper0 will become famous soon enough
Send a message via MSN to DarkReaper0
Or you could make everyone extremely irritable and just make it so you trip,fall, and slide uncontrollably on your back every few seconds.

At least thats how my ice adventures are
Reply With Quote
  #19  
Old 10-18-2008, 11:10 PM
MunkyPuff MunkyPuff is offline
Registered User
Join Date: Sep 2008
Posts: 8
MunkyPuff is on a distinguished road
Sorry it took me so long to reply. Thank you all for your help. I did want something like Kristi is describing. I agree that it makes no sense that you would increase speed on ice. (unless you had ice skates) well maybe I'll do both. one with iceskates and one without I will let you know when I've completed my script so you guys can tell me if I'm an idiot or not :P BTW I'm a She

thanks again!
Reply With Quote
  #20  
Old 10-18-2008, 11:31 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
I hate ice scripts its annoying.
__________________
Look beyond the monitor.
Reply With Quote
  #21  
Old 10-21-2008, 06:25 AM
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
I was going to post about how LttP did have Link increase speed, but I realize now you're talking about those Graal ice scripts that make the player start flying across the screen(or at least I think that's what you're talking about). I haven't seen one of those in a long time, though.

0:48 in and you'll see how link gains speed gradually(but still fairly fast) when he starts his walk. Ice on LttP was actually dreadful, and one of the experiences I hated. Especially trying to work your way into doorways and the stairs.
Reply With Quote
  #22  
Old 10-21-2008, 07:08 PM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
Quote:
Originally Posted by DustyPorViva View Post
I was going to post about how LttP did have Link increase speed, but I realize now you're talking about those Graal ice scripts that make the player start flying across the screen(or at least I think that's what you're talking about). I haven't seen one of those in a long time, though.

0:48 in and you'll see how link gains speed gradually(but still fairly fast) when he starts his walk. Ice on LttP was actually dreadful, and one of the experiences I hated. Especially trying to work your way into doorways and the stairs.
That's a misleading way to explain what is happening though. It is his normal rate of acceleration minus the effects of friction added to his current velocity (which doesn't stop unlike a normal walk)

Granted that isn't truly accurate but it does illustrate something more accurate then graal ice
__________________
Reply With Quote
  #23  
Old 10-21-2008, 11:41 PM
DarkReaper0 DarkReaper0 is offline
No.
DarkReaper0's Avatar
Join Date: May 2005
Location: Texas,USA
Posts: 344
DarkReaper0 will become famous soon enough
Send a message via MSN to DarkReaper0
I still say a script that makes you fall over if you run to fast would be the most accurate.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:43 PM.


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