Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   showimg > timeout >< help ! (https://forums.graalonline.com/forums/showthread.php?t=52753)

WanDaMan 05-18-2004 02:17 PM

showimg > timeout >< help !
 
Well i've been scripting a GUI and i've put a script into a timeout as follows
NPC Code:

//#CLIENTSIDE
if(created || timeout){
this.w = screenwidth/screenwidth;
this.h = screenheight/screenheight;
showstats 1024;

if (mousescreenx in |50,70| && mousescreeny in |0,30|) {
if(leftmousebutton){
hideimg 302;
showimg 309,#3,this.x+this.x+52,this.h+this.y+40;
changeimgvis 309,4;
}

}
showimg 302,#W,this.x+this.x+52,this.h+this.y+40;
changeimgvis 302,4;

timeout=0.05;
}


That isn't the whole script, but as you can see..
When you click in the x and y it is suppose to hide the image index of 302, but it dosn't :O

Any idea how I can do it?
any help would help :)

EsCanavi 05-18-2004 02:24 PM

it cause you hide the img but you don't tell the script that you hided the img o.0'

NPC Code:


if (mousescreenx in |50,70| && mousescreeny in |0,30|) {
if(leftmousebutton){
set hided;





NPC Code:


if ( !hided ){
showasdf
}else show fdsa




i guess with that you could go trought

WanDaMan 05-18-2004 04:30 PM

Ah I see, I get it. Thanks !!
I'll check it in 30 mins when i'm on my other comp !
I'll post if I have any problems :)

Loriel 05-18-2004 05:16 PM

Quote:

Originally Posted by EsCanavi
NPC Code:
set hided;


Should it not be set this.hidden;?

Crono 05-18-2004 05:16 PM

I thought you had to post scripts in the global format thingy where instead of && you added another ( )'s...or something like that...>_>;

WanDaMan 05-18-2004 05:36 PM

Yes crono, but I havn't done that :p
And r0bins helping me over AIM :)
I'll see if he can figure it out, it's completely broken now :p

EsCanavi 05-18-2004 06:39 PM

@loriel actualy it do the same but yeah could be 0.o

osrs 05-18-2004 07:38 PM

Quote:

Originally Posted by WanDaMan
NPC Code:

this.w = screenwidth/screenwidth;
this.h = screenheight/screenheight;


Both variables will return 1, maybe change it and fix the positions properly?

WanDaMan 05-18-2004 08:06 PM

That isn't the problem Osrs, go on MSN AIM i'll send you the script :P
edit
could some one help me on this, i asked loriel over aim but he didn't seem to botherd
NPC Code:

//CLIENTSIDE
if(created || timeout){
if(leftmousebutton){
//NEXT WEAPON BIT HERE
}
}


When you click down on the NPC your weapons change to the next one in your inventory, i.e
i have the weapon 'bow' in use, if I click it the next weapon along 'bomb' would now be in use :o
(I don't want the whole script, but i'd like help on how to do it :p)

DIABLO2099 05-18-2004 09:57 PM

selectedweapon : the index of the selected weapon of the player

Just mess around with that and you should be fine.

WanDaMan 05-19-2004 09:14 AM

Quote:

Originally Posted by DIABLO2099
selectedweapon : the index of the selected weapon of the player

Just mess around with that and you should be fine.

Could I do
selectedweapon+1;?

Loriel 05-19-2004 09:33 AM

Quote:

Originally Posted by WanDaMan
could some one help me on this, i asked loriel over aim but he didn't seem to botherd

Sorry, but I have been sick, laying in bed since sunday, and by the time I saw your IM, you were already offline. Not that your question made much sense to me.

Do you just mean selectedweapon++?

Loriel 05-19-2004 09:34 AM

Not exactly, your bit sets a `globally' editable flag and other NPCs will eventually mess around with it.

WanDaMan 05-19-2004 01:57 PM

Howso loriel?

I'll try the selected weapon

osrs 05-19-2004 04:25 PM

Quote:

Originally Posted by WanDaMan
That isn't the problem Osrs, go on MSN AIM i'll send you the script :P

I know that is not the problem, i just told you to fix that other thing :p
I go over AIM later to give you an assistance, if you want. :)

WanDaMan 05-19-2004 08:15 PM

Yay!, thanks :D!

Dach 05-19-2004 08:27 PM

Quote:

Originally Posted by WanDaMan
When you click down on the NPC your weapons change to the next one in your inventory, i.e
i have the weapon 'bow' in use, if I click it the next weapon along 'bomb' would now be in use :o
(I don't want the whole script, but i'd like help on how to do it :p)

scrolling through weapons? thats no fun, find the weaponindex of the clicked weapon and set selectedweapon to that

oh and don't constantly do static showimgs in a timeout, only when something needs to update (hiding/showing, do that in a function to call it when neccesary)

Quote:

Originally Posted by Gerami
I thought you had to post scripts in the global format thingy where instead of && you added another ( )'s...or something like that...>_>;

What? his script follows that aspect of KSI-GS alright... where's the raised eyebrow smilie?? oh, http://members.aol.com/michaelangelo...sedeyebrow.gif

Polo 05-20-2004 06:43 PM

Quote:

Originally Posted by osrs
Both variables will return 1, maybe change it and fix the positions properly?

That was the first thing I noticed also.

zokemon 05-20-2004 07:40 PM

Quote:

Originally Posted by Polo
That was the first thing I noticed also.

Heh same here ^^


All times are GMT +2. The time now is 09:45 AM.

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