Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   General Graal Discussion (https://www.graalians.com/forums/forumdisplay.php?f=2)
-   -   Some script help needed! (https://www.graalians.com/forums/showthread.php?t=8871)

V. 07-27-2012 03:37 PM

Some script help needed!
 
Hello.

I'm a little stuck, so I'll explain my problem.
I'm trying to get an npc to move in two directions, back and forth in a loop.
I've managed to get it to move in the first place, but I can't loop it.

Here's what I've tried;
Sticking "While" before and after the move lines, I've used the flag name, but I don't know the operation (so I left that blank, then stuck the two lines of code that move next to it, seperated by a comma.)I aslo declared that the flag is set too.
I've also tried an "If" statement, that didn't work either.

here's the bit of code, maybe one of you cleverclogs can crack it.

set nopkzone
while nopkzone, move -17,0,2,; move 17,0,0.4,;}

The error is "expected format set: string"


the "If" is exactly the same, with the same error.

Why isn't there just a "loop" command? Makes my life easier.
Also, I'm using the offline editor. I have a few other minor problems aswell, I'll post them later.

Thanks.

fp4 07-27-2012 03:42 PM

You're doing something really weird, and there is loops in GS1:

PHP Code:

//#CLIENTSIDE
if (created || timeout) {
  
move 17,0,0.4,0;
  
sleep 0.4;
  
move -17,0,0.4,0;
  
timeout 0.4;



V. 07-27-2012 03:45 PM

Thank you! any chance you could tell me why (playertouchesme) isn't working?

+1

Emera 07-27-2012 03:47 PM

It's playertouchsme not playertouchesme

fp4 07-27-2012 03:48 PM

Quote:

Posted by V. (Post 168547)
Thank you! any chance you could tell me why (playertouchesme) isn't working?

+1

Because it's playertouchsme.

PHP Code:

//#CLIENTSIDE
if (playertouchsme) {
  
setplayerprop #c,Poke!;



fp4 07-27-2012 03:54 PM

No I can't read your mind or screen, you have to post your code, and you were already told why it doesn't work.

Emera 07-27-2012 04:05 PM

Quote:

Posted by V. (Post 168551)
Thanks! Is there any chance you can tell me why "(playertouchesme)" doesn't work? I must be doing something weird again.

+1

It doesn't work because the spellings for them both are different. It'll only accept playertouchsme and not playertouchesme ^_^ Use that instead.

Quote:

Posted by fp4 (Post 168552)
No I can't read your mind or screen, you have to post your code, and you were already told why it doesn't work.

He's not asking you to. He's simply confused about how to use the function.

V. 07-27-2012 04:22 PM

FAIL. Thanks guys, I feel pretty dumb, haha. Repped you both.

One last question.
Is it possible to slowdown player movement after "touchsme"?
And if so, how?

V. 07-28-2012 10:19 AM

Can anyone help me?

callimuc 07-28-2012 10:54 AM

You can only change the players speed in GS2

PHP Code:

//#CLIENTSIDE
function onPlayerTouchsMe() {
  
player.defaultwalkspeed 0.75;


By default the speed is 0.5

V. 07-28-2012 11:36 AM

Aww :(

callimuc 07-28-2012 11:38 AM

At least I don't know any way in GS1 except making your own movement system

V. 07-28-2012 01:13 PM

I see, thanks anyway. ^^

fp4 07-28-2012 03:17 PM

You can simulate slow downs by using an 'opposite' boots script:

PHP Code:

//#CLIENTSIDE
if (playertouchsme) {
  
slowing 10;
  
timeout 0.05;
}

if (
timeout) {
  if (
slowing 0) {
    for (
04i++) {
      if (
keydown(i)) {
        
playerx += vecx(i) * -0.5;
        
playery += vecy(i) * -0.5;
      }
    }
    
slowing -= 0.05;
    
timeout 0.05;
  }



V. 07-28-2012 03:41 PM

Quote:

Posted by fp4 (Post 168968)
You can simulate slow downs by using an 'opposite' boots script:

PHP Code:

//#CLIENTSIDE
if (playertouchsme) {
  
slowing 10;
  
timeout 0.05;
}

if (
timeout) {
  if (
slowing 0) {
    for (
04i++) {
      if (
keydown(i)) {
        
playerx += vecx(i) * -0.5;
        
playery += vecy(i) * -0.5;
      }
    }
    
slowing -= 0.05;
    
timeout 0.05;
  }



Thanks. If you want, look at the thread I made based on all the questions I asked.


All times are GMT. The time now is 09:42 AM.

Powered by vBulletin/Copyright ©2000 - 2024, vBulletin Solutions Inc.