Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Stuck (https://forums.graalonline.com/forums/showthread.php?t=22511)

Poogle 01-30-2002 07:05 AM

Stuck
 
I need help with this it wont go up.

showimg index,@Font@@Taged: #v(this.tag),x,y;
changeimgcolors index,1,1,1,1.99;
changeimgzoom index,1;

to touch to go up:

if (playerenters) {
timeout = 0.1;
}
if (playertouchsme) {
time.tag+=1;
}
while (timeout) {
x = random(24,41);
y = random(7,14);
sleep 0.1;
}

Python523 01-30-2002 07:57 AM

Re: Stuck
 
Quote:

Originally posted by Poogle
I need help with this it wont go up.

showimg index,@Font@@Taged: #v(this.tag),x,y;
changeimgcolors index,1,1,1,1.99;
changeimgzoom index,1;

to touch to go up:

if (playerenters) {
timeout = 0.1;
}
if (playertouchsme) {
time.tag+=1;
}
while (timeout) {
x = random(24,41);
y = random(7,14);
sleep 0.1;
}

A few things:
time.tag+=1;
should be this.tag since the showimg is read as this.tag)
secondly dont do while timeout
if (created) {timeout=.05;}
if (timeout) {timeout=.05;}
works fine
Third:
x = random(24,41);
that could make a number like 24.4322343545234072307
do
x= int(random(24,41));
that gets rid of the following decimals

Poogle 01-30-2002 08:11 AM

It will have to be while or it wont jump around and it still doesnt go up..

Python523 01-30-2002 08:20 AM

hmm, try removing the #v()

Faheria_GP2 01-30-2002 08:21 AM

Re: Re: Stuck
 
Quote:

Originally posted by Python523

A few things:
time.tag+=1;
should be this.tag since the showimg is read as this.tag)
secondly dont do while timeout
if (created) {timeout=.05;}
if (timeout) {timeout=.05;}
works fine
Third:
x = random(24,41);
that could make a number like 24.4322343545234072307
do
x= int(random(24,41));
that gets rid of the following decimals

what's wrong with an x,y coordinate being decimal?

Python523 01-30-2002 08:26 AM

Re: Re: Re: Stuck
 
Quote:

Originally posted by Faheria_GP2


what's wrong with an x,y coordinate being decimal?

I made a soccer ball like that once and it got really messed up, its just better to have it just 1 or 2 numbers instead of graal having to read 10 digits like 34.7579245

Poogle 01-30-2002 08:57 AM

Quote:

Originally posted by Python523
hmm, try removing the #v()
doesnt do anything

Python523 01-30-2002 09:06 AM

this works perfectly:
if (created||timeout)
{
show();}
function show();
{showimg 1,@Font@Taged:#v(this.tag),x,y;
timeout=.1;
}
if (playerenters) {
timeout = 0.1;
}
if (playertouchsme) {
this.tag+=1;
}
while (timeout) {
x = random(24,41);
y = random(7,14);
sleep 0.1;
}

Poogle 01-30-2002 10:10 AM

now this wont show the score at the end and change it to 0if (playerchats&&strequals(#c,start)) {
playerx=31;
playery=12;
set tagstart;
}
while (tagstart) {
sleep 60;
say2 Your score is:#b #v(this.tag);
playerx=31;
playery=15;
this.tag=0;
unset tagstart;
}

Python523 01-30-2002 10:14 AM

Quote:

Originally posted by Poogle
now this wont show the score at the end and change it to 0if (playerchats&&strequals(#c,start)) {
playerx=31;
playery=12;
set tagstart;
}
while (tagstart) {
sleep 60;
say2 Your score is:#b #v(this.tag);
playerx=31;
playery=15;
this.tag=0;
unset tagstart;
}

if (playerchats&&strequals(#c,start)) {
playerx=31;
playery=12;
set tagstart;
}
while (tagstart) {
sleep 2;
say2 Your score is:#b #v(this.tag);
playerx=31;
playery=15;
sleep.01;
this.tag=0;
unset tagstart;
}

TDK_RC6 01-30-2002 10:28 AM

evil laugh inserted here

Poogle 01-30-2002 07:47 PM

Quote:

Originally posted by Kaimetsu
Don't use a while loop with sleeps, use a normal timeout loop. Converting your code (which seems strange beyond belief), we get this:

if (playerenters) {
timeout = 0.1;
}
if (playertouchsme) {
time.tag+=1;
}
if(timeout) {
x = random(24,41);
y = random(7,14);
timeout=0.1;
}

yeAH but i need help on the lastest thing i posted

TDK_RC6 01-30-2002 08:19 PM

kai's right

you shouldn't use a while loop with timeout, its just nasty

Saga2001 01-31-2002 12:10 AM

Re: Stuck
 
showimg index,@Font@@Taged: #v(this.tag),x,y;
changeimgcolors index,1,1,1,1.99;
changeimgzoom index,1;
^-- WTF is that about?
i think that it looks good the way kaimetsu wrote it...maybe pastaustin is wrong? i don't see any reason it wouldn't work tho. ;). If your doing showimg, use this.x and this.y, that way the npc isn't moving all around...

Gohan43331 01-31-2002 08:10 AM

1 Attachment(s)
Lol...come back here.... (sorry...such a worthless post, but it amused me...)


All times are GMT +2. The time now is 10:38 AM.

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