Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-14-2005, 04:22 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Scripting: Line Counter

Maybe a level editor and RC add-on which shows the line that you are currently in as you are scripting. Maybe in like a box on one of the sides or so.

Example:

NPC Code:

//#CLIENTSIDE <--While typing this it would read: Line 1
if (created) <--While typing this it would read: Line 2
{ <--While typing this it would read: Line 3
actions; <--While typing this it would read: Line 4
} <--While typing this it would read: Line 5




Also: Possibly an add-on where everything added (scripted) to/on NC is given a line count number on the side of it.


Would be useful for reading errors given by the GS2 script compiler and would really just make things easier for servers that need to fix certain parts of scripts and they would be able to describe which part is needed fixing by giving the line count (example: Lines 20 through 26) to the NAT(s) of the server.
Reply With Quote
  #2  
Old 06-14-2005, 04:52 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
that would only be useful if you script in that style. some people still do the whole

NPC Code:

if (playertouchsme) {message hai;} if (strequals(#a,Gerami)) {if (playerenters) {show;}}

__________________
Reply With Quote
  #3  
Old 06-14-2005, 04:58 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 don't think that '//#CLIENTSIDE' should count, but the idea is good.
__________________
"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
  #4  
Old 06-14-2005, 05:03 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Gerami
that would only be useful if you script in that style. some people still do the whole

NPC Code:

if (playertouchsme) {message hai;} if (strequals(#a,Gerami)) {if (playerenters) {show;}}


That is HORRIBLE styling. The longest script I've ever scripted is 204 lines long. If I scripted in that style for 204 lines, I'd go crazy.
Reply With Quote
  #5  
Old 06-14-2005, 09:31 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Would be better..
__________________
Reply With Quote
  #6  
Old 06-14-2005, 10:40 PM
Ajira Ajira is offline
Poont.
Join Date: Oct 2004
Location: NY, USA
Posts: 477
Ajira is on a distinguished road
The client TextEditor has a line # display on it.
__________________
Liek omigosh.

Reply With Quote
  #7  
Old 06-14-2005, 10:50 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Ajira
The client TextEditor has a line # display on it.
Yes, if people are happy using the client-rc. At least the Linux RC has it.
__________________
Skyld
Reply With Quote
  #8  
Old 06-15-2005, 02:50 PM
URBANLEGEND URBANLEGEND is offline
No sleep till brooklyn!
Join Date: Sep 2002
Location: USA
Posts: 775
URBANLEGEND is on a distinguished road
Send a message via ICQ to URBANLEGEND Send a message via AIM to URBANLEGEND Send a message via MSN to URBANLEGEND Send a message via Yahoo to URBANLEGEND
i like this idea, but they should do it like Microsoft Dev C++ with each line having a number on the side.
__________________
~Urban
Reply With Quote
  #9  
Old 06-15-2005, 10:26 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
http://rafb.net/paste/results/h7f4Ay64.html
Look to the left, thats what he means.

Or here, my 1000 dollar program does it :P
Reply With Quote
  #10  
Old 06-15-2005, 11:03 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Gman4pwnu
http://rafb.net/paste/results/h7f4Ay64.html
Look to the left, thats what he means.

Or here, my 1000 dollar program does it :P


That sure as hell beat my 204 line script ;[
Reply With Quote
  #11  
Old 06-15-2005, 11:34 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
Quote:
Originally Posted by Gambet
That sure as hell beat my 204 line script ;[
Picture or the random paste I pulled off of the pastebin?
Reply With Quote
  #12  
Old 06-15-2005, 11:59 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Quote:
Originally Posted by Skyld
Yes, if people are happy using the client-rc. At least the Linux RC has it.
It is planned that the Linux-RC will be back-ported to Windows, probably in a few weeks (needs drag&drop stuff like in the Windows RC)
Reply With Quote
  #13  
Old 06-16-2005, 12:14 AM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
That picture looks like the SDL example.

Quote:
Originally Posted by Stefan
It is planned that the Linux-RC will be back-ported to Windows, probably in a few weeks (needs drag&drop stuff like in the Windows RC)
Some krazy order, but sounds good, that linux RC's great.
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote
  #14  
Old 06-16-2005, 03:33 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
Quote:
Originally Posted by Fry
That picture looks like the SDL example.


Some krazy order, but sounds good, that linux RC's great.
Yea, its out of an SDL tutorial.

You guessed that because of the letter SDL everywhere?

Last edited by Gman4pwnu; 06-16-2005 at 07:51 AM..
Reply With Quote
  #15  
Old 06-16-2005, 04:02 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Gman4pwnu
Picture or the random paste I pulled off of the pastebin?

The picture.
Reply With Quote
  #16  
Old 06-16-2005, 07:51 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
Why? its half the size gambet, only 102 lines total...
NPC Code:

#include <stdlib.h>
#include <iostream>
#if defined(_MSC_VER)
#include "SDL.h"
#else
#include "SDL/SDL.h"
#endif

SDL_Surface *screen;
#define PUTPIXEL(x,y,c) \
((unsigned int*)screen->pixels)[(x) + (y) * (screen->pitch / 4)] = (c);

int SWIDTH=1280, SHEIGHT=1024;

void render()
{
// Lock surface if needed
if (SDL_MUSTLOCK(screen))
if (SDL_LockSurface(screen) < 0)
return;

// Ask SDL for the time in milliseconds
int tick = SDL_GetTicks();

// Declare a couple of variables
int i, j, yofs, ofs;

// Draw to screen
yofs = 0;
for (i = 0; i < SHEIGHT; i++)
{
for (j = 0, ofs = yofs; j < SWIDTH; j++, ofs++)
{
((unsigned int*)screen->pixels)[ofs] = i * i + j * j + tick;
}
yofs += screen->pitch / 4;
}
PUTPIXEL(10, 10, 0xff0000);
PUTPIXEL(11, 10, 0xff0000);
PUTPIXEL(10, 11, 0xff0000);
PUTPIXEL(11, 11, 0xff0000);
// Unlock if needed
if (SDL_MUSTLOCK(screen))
SDL_UnlockSurface(screen);

// Tell SDL to update the whole screen
SDL_UpdateRect(screen, 0, 0, SWIDTH, SHEIGHT);
}


// Entry point
int main(int argc, char *argv[])
{
std::cout << "Lance Leone you gonna get raped.";
// Initialize SDL's subsystems - in this case, only video.
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
exit(1);
}

// Register SDL_Quit to be called at exit; makes sure things are
// cleaned up when we quit.
atexit(SDL_Quit);

// Attempt to create a 640x480 window with 32bit pixels.
// screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);
screen = SDL_SetVideoMode(SWIDTH, SHEIGHT, 32, SDL_SWSURFACE);

// If we fail, return error.
if ( screen == NULL )
{
fprintf(stderr, "Unable to set 640x480 video: %s\n", SDL_GetError());
exit(1);
}

// Main loop: loop forever.
while (1)
{
// Render stuff
render();

// Poll for events, and handle the ones we care about.
SDL_Event event;
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_KEYDOWN:
break;
case SDL_KEYUP:
// If escape is pressed, return (and thus, quit)
if (event.key.keysym.sym == SDLK_ESCAPE)
return 0;
break;
case SDL_QUIT:
return(0);
}
}
}
return 0;
}

Reply With Quote
  #17  
Old 06-16-2005, 08:43 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Gman, that's not a npc code.
Reply With Quote
  #18  
Old 06-16-2005, 10:02 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
Quote:
Originally Posted by KuJi
Gman, that's not a npc code.
Obviously not... its C++.........................
Reply With Quote
  #19  
Old 06-16-2005, 05:55 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Ah, I guess I mistook the picture with the URL.

I meant the URL since it has about 300 something lines.
Reply With Quote
  #20  
Old 06-16-2005, 07:58 PM
Curt1zzle Curt1zzle is offline
Starting not to love you
Curt1zzle's Avatar
Join Date: Sep 2003
Posts: 3,669
Curt1zzle has a spectacular aura about
Send a message via AIM to Curt1zzle
Quote:
Originally Posted by Gman4pwnu
Obviously not... its C++.........................
Where'd you copy+paste that from?
__________________

This message has been deleted by Sam. Reason: you should better stop it now
Reply With Quote
  #21  
Old 06-16-2005, 11:31 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
Quote:
Originally Posted by Curt1zzle
Where'd you copy+paste that from?
My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?
Reply With Quote
  #22  
Old 06-16-2005, 11:33 PM
Curt1zzle Curt1zzle is offline
Starting not to love you
Curt1zzle's Avatar
Join Date: Sep 2003
Posts: 3,669
Curt1zzle has a spectacular aura about
Send a message via AIM to Curt1zzle
Quote:
Originally Posted by Gman4pwnu
My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?
Why'd you have to use ill language on me?

Oh well.
__________________

This message has been deleted by Sam. Reason: you should better stop it now
Reply With Quote
  #23  
Old 06-17-2005, 12:08 PM
Fry Fry is offline
Registered User
Fry's Avatar
Join Date: Sep 2001
Location: Germany
Posts: 384
Fry has a spectacular aura about
Quote:
Originally Posted by Gman4pwnu
My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?
You've got serious mental problems.
__________________
Graal Statistics

Top 3 servers at the moment (players):


Reply With Quote
  #24  
Old 06-17-2005, 12:42 PM
vahn32 vahn32 is offline
oner uf grawl +1 LOL
vahn32's Avatar
Join Date: Jan 2003
Location: See Bible.
Posts: 177
vahn32 is on a distinguished road
Send a message via AIM to vahn32
Quote:
Originally Posted by Gman4pwnu
My compiler jackass, why do you people have to attempt to look smart by insulting people with **** you don't even know about when they know more than you?
sup dawg. u wnt 2 rol wif mi? dawg im down wif dah c++'s and the visual bazicz al 'round dis hewd.

Why do people who complain about people who insult them because the person makes themself out to look like an idiot and then get angry because they are an idiot?
Maybe if you weren't an idiot, people would stop insulting you.
__________________
Reply With Quote
  #25  
Old 06-20-2005, 12:24 PM
EmpireOwnsYou EmpireOwnsYou is offline
Banned
Join Date: Mar 2005
Posts: 12
EmpireOwnsYou is on a distinguished road
Quote:
Originally Posted by vahn32
sup dawg. u wnt 2 rol wif mi? dawg im down wif dah c++'s and the visual bazicz al 'round dis hewd.

Why do people who complain about people who insult them because the person makes themself out to look like an idiot and then get angry because they are an idiot?
Maybe if you weren't an idiot, people would stop insulting you.
LoL! So True! Hey don't you program in some like crappy programming language? What was it again? And yes i'd love to see this feature!
Reply With Quote
  #26  
Old 06-21-2005, 12:55 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
No language is crappy, you're just to lazy to learn the benefits.
__________________
Reply With Quote
  #27  
Old 06-21-2005, 04:17 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by xAndrewx
No language is crappy
How would you support this statement?
__________________
Reply With Quote
  #28  
Old 06-21-2005, 04:49 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Because you learn something new in each language.
__________________
Reply With Quote
  #29  
Old 06-21-2005, 05:11 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by xAndrewx
Because you learn something new in each language.
So...?
__________________
Reply With Quote
  #30  
Old 06-21-2005, 05:39 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Well, if he doesn't understand the language, wouldn't you 'learn' the language to understand what you're doing?
__________________
Reply With Quote
  #31  
Old 06-21-2005, 05:45 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by xAndrewx
Well, if he doesn't understand the language, wouldn't you 'learn' the language to understand what you're doing?
Yes. So?
__________________
Reply With Quote
  #32  
Old 06-21-2005, 05:47 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
I'm pretty sure I saw GMan post something about not bothering to learn any languages without a reason o_o.
__________________
Reply With Quote
  #33  
Old 06-21-2005, 05:48 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by xAndrewx
I'm pretty sure I saw GMan post something about not bothering to learn any languages without a reason o_o.
How is this relevant to the claim that "no language is crappy"?
__________________
Reply With Quote
  #34  
Old 06-21-2005, 05:52 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Kaimetsu
How is this relevant to the claim that "no language is crappy"?
You asked how it was relevant to the subject. I made a mistake by thinking he posted it in this thread. I was wrong.
And why do you learn another language?
A language wouldn't have been invented if it didn't have a purpose.
__________________
Reply With Quote
  #35  
Old 06-21-2005, 06:02 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by xAndrewx
A language wouldn't have been invented if it didn't have a purpose.
Having a purpose automatically means that it is not "crappy"?
__________________
Reply With Quote
  #36  
Old 06-21-2005, 09:18 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Would you say a certain language is pointless to learn?
__________________
Reply With Quote
  #37  
Old 06-21-2005, 09:20 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by xAndrewx
Would you say a certain language is pointless to learn?
How is this relevant to the claim that "no language is crappy"?
__________________
Reply With Quote
  #38  
Old 06-21-2005, 09:24 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Kaimetsu
How is this relevant to the claim that "no language is crappy"?
Because you seem to have an opinion that a certain language you do not wish to state is crappy, else you wouldn't let this thread carry on.
__________________
Reply With Quote
  #39  
Old 06-21-2005, 09:32 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by xAndrewx
Because you seem to have an opinion that a certain language you do not wish to state is crappy
How are my opinions relevant to your claim?

So many posts, and still you haven't given an argument for its validity.
__________________
Reply With Quote
  #40  
Old 06-21-2005, 09:53 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by Kaimetsu
How are my opinions relevant to your claim?

So many posts, and still you haven't given an argument for its validity.
All I am saying is
"What is the point in learning a language if you don't gain anything from it?"
__________________
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:43 AM.


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