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-15-2004, 02:04 AM
Kramer Kramer is offline
Graal2001 Graphics
Kramer's Avatar
Join Date: Jan 2003
Location: California
Posts: 646
Kramer is on a distinguished road
Send a message via AIM to Kramer
Showimg Dissapearing

I have a script that uses showimg, and everytime I heal or lose life, just the default ones that is, there is no special HP script that I'm using, the showimg images dissapear. Thease images are attached to the client's screen, not the level, index of 4+ or whatever, and their indexes are all 200+. Is there a known solution to this problem or do I need to post the script? Anyhow, help would be much apreciated.
__________________

~Kramer
(11:52:32 PM) Skylar: but seriously noah, you can't even call me a nerd if you took acid and installed azureus
(11:52:48 PM) Skylar: that bans you from ever calling someone a nerd
Reply With Quote
  #2  
Old 07-15-2004, 02:13 AM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Would be better if you could post the part that is apparently causing the problem, such as any hideimg part or even showstats i guess.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #3  
Old 07-15-2004, 02:44 AM
Kramer Kramer is offline
Graal2001 Graphics
Kramer's Avatar
Join Date: Jan 2003
Location: California
Posts: 646
Kramer is on a distinguished road
Send a message via AIM to Kramer
NPC Code:

if (created){
this.pos = 15;
this.speed = 1;
}
if (weaponfired && this.bootson == 1){
hideimg nums;
this.bootson = 0;
for(this.speedsel=0;this.speedsel<=5;this.speedsel ++){
hideimg 200+(this.speedsel);
}
hideimg 230;
hideimg 231;
this.pos =15;
}
else if (weaponfired){
this.bootson = 1;
for(this.speedsel=1;this.speedsel<=5;this.speedsel ++){
this.pos=this.pos+20;
showtext 200+(this.speedsel),this.pos,115,,,#v(this.speedse l);
changeimgvis 200+(this.speedsel),5;
}
showimg 231,admingui.gif,10,115;
changeimgvis 231,4;
timeout = .05;
}
if (timeout && this.bootson == 1) {
for (i=0;i<4;i++) {
if (keydown(i)) {
playerx += (vecx(i)/2)*this.speed;
playery += (vecy(i)/2)*this.speed;
}
}
showtext 230,30,135,,,X: #v(mousescreenx) Y: #v(mousescreeny);
changeimgvis 230,5;
if (mousescreenx in |35,45| && mousescreeny in |120,135|){
if(leftmousebutton){
this.speed = 1;
sleep .5;
}
}
if (mousescreenx in |55,65| && mousescreeny in |120,135|){
if(leftmousebutton){
this.speed = 2;
sleep .5;
}
}
if (mousescreenx in |75,85| && mousescreeny in |120,135|){
if(leftmousebutton){
this.speed = 3;
sleep .5;
}
}
if (mousescreenx in |95,105| && mousescreeny in |120,135|){
if(leftmousebutton){
this.speed = 4;
sleep .5;
}
}
if (mousescreenx in |115,125| && mousescreeny in |120,135|){
if(leftmousebutton){
this.speed = 5;
sleep .5;
}
}
timeout = .05;
}



there's the problematic code, all clientside
__________________

~Kramer
(11:52:32 PM) Skylar: but seriously noah, you can't even call me a nerd if you took acid and installed azureus
(11:52:48 PM) Skylar: that bans you from ever calling someone a nerd
Reply With Quote
  #4  
Old 07-15-2004, 06:19 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally Posted by Kramer
NPC Code:

if (weaponfired && this.bootson == 1){
hideimg nums;
this.bootson = 0;
for(this.speedsel=0;this.speedsel<=5;this.speedsel ++){
hideimg 200+(this.speedsel);
}
hideimg 230;
hideimg 231;
this.pos =15;
}



there's the problematic code, all clientside
That hideimg is weird, there is no such variable on script with that name.
Talk to me over AIM if you need help to fix it.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /

Last edited by osrs; 07-15-2004 at 07:22 PM..
Reply With Quote
  #5  
Old 07-15-2004, 07:16 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
Even though you are right osrs, that wouldn't be the problem. That hideimgs part is only called when the weapon has been fired twice.

Also, please, I beg you to re-write the script. Do something like this for the mouse detection.

NPC Code:

if (mousebuttons == 1 && mousescreeny in |120,135|) {
for (this.a = 0; this.a < 5; this.a ++) {
if (mousescreenx in |35 + (this.a * 20),45 + (this.a * 20)|){
this.speed = this.a + 1;
sleep .5;
}
}
}



You accomplish the same thing with 8 lines, instead of 30.
__________________
V$:CONFL16T
Reply With Quote
  #6  
Old 07-15-2004, 07:23 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
I did not say that was the wrong part, i just said that there wasn't such variable on script. Kramer sent me a message some minutes ago and told me that he fixed it anyway.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #7  
Old 07-15-2004, 07:28 PM
WanDaMan WanDaMan is offline
Master Tux
WanDaMan's Avatar
Join Date: Aug 2002
Location: England, United Kingdom
Posts: 5,571
WanDaMan is a jewel in the roughWanDaMan is a jewel in the rough
Send a message via MSN to WanDaMan
I see I see.

Please mention to him about the mouse detection. I don't even want to get started on the weaponfired part...
__________________
V$:CONFL16T
Reply With Quote
  #8  
Old 07-15-2004, 07:47 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Pft, trolls.

The problem is known. I first experienced it myself when I scripted what I claim to be Graal's first custom health bar (for Kharlia ) shortly after changeimgvis was introduced.
Since then I have been displaying all such NPCs in a 0.05sec timeout loop. It has worked fine, but now that we have custom health stuff almost everywhere, that practice is getting rather bothersome.
Reply With Quote
  #9  
Old 07-16-2004, 05:16 AM
Kramer Kramer is offline
Graal2001 Graphics
Kramer's Avatar
Join Date: Jan 2003
Location: California
Posts: 646
Kramer is on a distinguished road
Send a message via AIM to Kramer
thanks, I'm going to change that moust detection thing, my solution was as loriel said and eventially the weaponfired part will be done away with altogether.
__________________

~Kramer
(11:52:32 PM) Skylar: but seriously noah, you can't even call me a nerd if you took acid and installed azureus
(11:52:48 PM) Skylar: that bans you from ever calling someone a nerd
Reply With Quote
  #10  
Old 07-16-2004, 05:29 AM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
Loriel got to post the answer before me
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 03:35 PM.


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