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 02-08-2004, 07:48 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
And of course more GUI problems :)

Well right now im working on a pop up window that displays the players stats, code down there is what i got right now. Basically what happens is when i tap the keys it seems to enable the writing and then disable it, its wierd, you have to test it online to see what im talking about. Anyway, I was going to try it with strings to determine if it was enabled or disabled but then I decided I want to have it enabled only while the key is pressed. But it seems to stick disabled while i have the key pressed =\ Help? Am I doing this the right way? Nothing happened when I used if keydown

NPC Code:

//#CLIENTSIDE
timeout =.05;
if (timeout){
while (keydown2(87,true)){
showimg 400,@Rank: (Error),190,150;
changeimgzoom 400,.80;
changeimgvis 400,5;
setplayerprop #c, Stat Screen;
}

if (keydown2(87,false)){
setplayerprop #c, Stat Screen Off;
hideimg 400;
}
}

Reply With Quote
  #2  
Old 02-08-2004, 08:09 AM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
um lets break down your script and see what you are doing
NPC Code:

timeout =.05;
if (timeout){


ok, you've told the npc to have a timeout ever .05 secs, and now we're looking at the code to be run every timeout...
NPC Code:

while (keydown2(87,true)){


Hmm, you're checking to see if the key is pressed (and making sure it is the right case, this is what the true is for), but why you are looping it with "while" I'll never know
NPC Code:

showimg 400,@Rank: (Error),190,150;
changeimgzoom 400,.80;
changeimgvis 400,5;
setplayerprop #c, Stat Screen;
}


showing text and setting player's chattext and then closing the while loop
NPC Code:

if (keydown2(87,false)){


checking to see if the key with keycode 87 is pressed but without checking if it is the right case,
NPC Code:

setplayerprop #c, Stat Screen Off;
hideimg 400;
}
}


setting player's chat and hiding your images, then closing all the open brackets

You need to learn to analyze your algorithms if you intend to not have problems like this anymore
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #3  
Old 02-08-2004, 11:21 AM
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
Yeah, what Dach said.. !
__________________
V$:CONFL16T
Reply With Quote
  #4  
Old 02-08-2004, 02:06 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
ew. kaimetsu is doing somersaults in his grave.
Reply With Quote
  #5  
Old 02-08-2004, 05:20 PM
Duwul Duwul is offline
Registered User
Join Date: Nov 2003
Posts: 105
Duwul is on a distinguished road
First, this should have been posted in your other thread.

The true/false in the keydown2 is only checking if it is lowercase/uppercase, i believe, as Dach stated.

To check if it is NOT being pressed, use the
"!" operator.

Also, never use while loops inside timeout loops, heh. Use 'if'.
__________________
-Ajira
Liek, omigosh.
<3 DoomsDay.
Reply With Quote
  #6  
Old 02-08-2004, 06:39 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
I posted a link in your previous thread to the coding standards.

NPC Code:

timeout = .05;
if/while/for/whateverthehellyouuse() {
stuff;
}



You should not do that, it is not only inefficient but really really ugly. Also, if you can't problem-solve for yourself, this is the only advice I can think of giving.
DONT. SCRIPT.
Yes, the forums are here to help, but we aren't here to teach you every single thing. Walk on your own two feet, don't use us as a crutch.
Reply With Quote
  #7  
Old 02-08-2004, 06:51 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Damn you ask way too many questions. We're not just gonna hand you the information. If you can't script it don't even try or start. Try scripting easier things first. If you really want it done for a server, hire a NAT. -.-
__________________
Reply With Quote
  #8  
Old 02-08-2004, 08:48 PM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
don't reply if you think i shouldn't know, im learnin from my posts along w/ scripts, the forums are almost always dead anyway so why do you care?
Reply With Quote
  #9  
Old 02-08-2004, 09:11 PM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
Because a **** is invading them, spamming the thread list with improper scripts in which we already explained that person NOT to do... Gman, we've been very patient with you. We've told you to post all in ONE thread. We've told you to look at other threads BEFORE posting. Gman, we aren't here to be a live tutorial, we are here to help the little problems a scritper might encounter, not every single command on the list.

I'd suggest you to read through all the threads posted on this forum board, and then come back. Those questions were asked by a lot less constant thread posters, and were answered by many.

And well. If you want to learn to script, learn to have a proper coding style. Having a timeout, or any other command, which isn't in an event, shouldn't be there. (I don't know if the only exception would be the join command, which copies the entire script from a file...)

Other then that... I'd reinforce Python's advice. If you aren't going to learn to look and observe, or trial and error, then you shouldn't be a programmer.
__________________
- Rance Vicious
Reply With Quote
  #10  
Old 02-08-2004, 10:05 PM
Genesis Genesis is offline
Level Maker
Genesis's Avatar
Join Date: Jan 2003
Location: Waterloo,IL
Posts: 1,214
Genesis is on a distinguished road
Man If I was a newb and I was trying to learn to script and I asked questions and everyone is flaming him no wonder there isnot many NAT's out there that are actually good cuz there too afraid to ask ?'s because there is people like you always trying to bring them down how in the H e double hockey sticks are u going to tell someone the best advice I can give you is dont script.
Reply With Quote
  #11  
Old 02-08-2004, 10:28 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Gman4pwnu
don't reply if you think i shouldn't know, im learnin from my posts along w/ scripts, the forums are almost always dead anyway so why do you care?
Don't question me. I'm mod here for a reason.

And Genesis, to be a scripter people have to have a good problem solving mind or they will just suck. I could care less if someone scripts or not, if they are going to script and not know how to problem solve and script efficiently then I am just trying to do my job and protect servers from getting horrible scripts on them.
Reply With Quote
  #12  
Old 02-08-2004, 10:37 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
NPC Code:

Jagen being blunt?
Shall we attack?
| |
Mental || Physical
/ \
/ \
Did it work? Are you close enough?
| / \
No Yes No
| | |
| | |
| \ /
| \ /
Shut Up Shut Up


There arent many options, folks.

Reply With Quote
  #13  
Old 02-08-2004, 10:48 PM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
Quote:
Originally posted by Genesis
Man If I was a newb and I was trying to learn to script and I asked questions and everyone is flaming him no wonder there isnot many NAT's out there that are actually good cuz there too afraid to ask ?'s because there is people like you always trying to bring them down how in the H e double hockey sticks are u going to tell someone the best advice I can give you is dont script.
Genesis... I didn't flame him the first thread he posted. I didn't flame him the second thread he posted. I didn't flame him the third thread he posted... ... ... I didn't flame him the tenth thread he posted. I told him to CONCENTRATE his problems so that the forums would be less filled... I didn't flame him the eleventh time, and told him to CONCENTRATE his problems... Now, after his stubburnness, I lost patience. I told him, people told him, and more people told him. Now, if he read the replies to his own threadSSSS, then I guess that this thread should have never excisted. If he spent a little less time posting new threads, then he would have a lot more time to think of the SOLUTION to his PROBLEMS.

Want to argue more? Go ahead. Gives me post counts everytime.
__________________
- Rance Vicious
Reply With Quote
  #14  
Old 02-08-2004, 11:06 PM
Genesis Genesis is offline
Level Maker
Genesis's Avatar
Join Date: Jan 2003
Location: Waterloo,IL
Posts: 1,214
Genesis is on a distinguished road
Quote:
Originally posted by Termina_Owner


Genesis... I didn't flame him the first thread he posted. I didn't flame him the second thread he posted. I didn't flame him the third thread he posted... ... ... I didn't flame him the tenth thread he posted. I told him to CONCENTRATE his problems so that the forums would be less filled... I didn't flame him the eleventh time, and told him to CONCENTRATE his problems... Now, after his stubburnness, I lost patience. I told him, people told him, and more people told him. Now, if he read the replies to his own threadSSSS, then I guess that this thread should have never excisted. If he spent a little less time posting new threads, then he would have a lot more time to think of the SOLUTION to his PROBLEMS.

Want to argue more? Go ahead. Gives me post counts everytime.
I am not here to argue but it seems like you are.
Reply With Quote
  #15  
Old 02-08-2004, 11:08 PM
R0bin R0bin is offline
Banned
R0bin's Avatar
Join Date: Oct 2002
Location: Wales, UK
Posts: 828
R0bin is on a distinguished road
Send a message via AIM to R0bin
And yet no one has commented on my graph of futility!
Reply With Quote
  #16  
Old 02-08-2004, 11:31 PM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
Quote:
Originally posted by Genesis
I am not here to argue but it seems like you are.
Erm. It meant that I wouldn't mind you argueing, seeing as I have enough reason to do what I do.

I didn't argue in the other posts. If you don't know what I'm talking about, look at the Gman's question thread (Erm... Someone merged all his threads there, untill he posted a new one. But there are still plenty unmerged... Erm.. Ones he created after the person merged them.)
__________________
- Rance Vicious
Reply With Quote
  #17  
Old 02-09-2004, 06:15 AM
Gman4pwnu Gman4pwnu is offline
Banned
Join Date: Jan 2004
Posts: 434
Gman4pwnu is on a distinguished road
Send a message via AIM to Gman4pwnu
Thx genesis.

Im sorry, some days there are never any new threads here. This isn't an archive, its a place to ask questions with scripts where you've tried everything you can do within what you know. I've tried everything I know to do, and none of that seems to work, I will continue scripting, I am learning well, and I have been searching in commands.rtf for commands if i need a new one. If I can't figure out how to use it ill search it, if theres no posts, ill post it.
Reply With Quote
  #18  
Old 02-09-2004, 06:38 AM
Termina_Owner Termina_Owner is offline
Registered User
Join Date: Oct 2003
Posts: 175
Termina_Owner is on a distinguished road
But if one person keeps posting those questions.

Look in the newfeatures list, make sure you script has appropiate standards, and think logically.

I usually find all my responses like that. If I don't, I wait a day, struggle from one tactic to another. If I still can't find it, I wait a couple of days, and I retry. Sometimes my problem is that I'm overlooking something. And find it with my serveral attempts.

A useful command: Savelog (CLIENTSIDE)

You can check the logs on Alt + 0, and it displays some nifty information.
__________________
- Rance Vicious
Reply With Quote
  #19  
Old 02-09-2004, 10:21 AM
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
Nice drawing, r0bin..
Instead of posting for help and cluttering it all why don't you forum PM the people who are being ^*****y^ towards you. If you don't get a reply in a day or 2 post on here. If they don't want it posted I'm sure they would tell you....
Just an Idea... to stop these threads...
__________________
V$:CONFL16T
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 06:03 AM.


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