Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-11-2004, 10:37 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
showpoly question

How come this npc does not show the poly
that I want it to draw?
It looks right to me, and the item placement for
the x and y check work.
Ideally I want just a line to draw from the player then to go up
till it hits an onwall or the top of the level.

NPC Code:

// NPC made by Prozac
if (created || playertouchsme) {show; toweapons Line npc;}

if (weaponfired)
{
//draw a line going up this level or until till onwall
this.y=playery-.5;
this.x=playerx+1;
while (this.y>0 || !(onwall(this.x,this.y)))
{
showpoly 10,(playerx,playery,this.x,this.y);
changeimgvis 10,2;
changeimgcolors 10,1,1,1,1;

//the bombs show up .. why not the line?
// putbomb 1,this.x,this.y;

this.y--;
sleep .05;
}
}



Any help would be appreciated!
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #2  
Old 07-11-2004, 10:54 PM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
In the showpoly it needs {} type brackets instead of () ones.

NPC Code:

showpoly 10,{playerx,playery,this.x,this.y};

__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #3  
Old 07-11-2004, 11:06 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
Thanks! man I need a bigger screen ... those itty bitty changes in () and {} are getin hard to see
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #4  
Old 07-12-2004, 04:58 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
use && instead of ||, and I'd suggest doing the showpoly after finding the stopping point (you're only using one line anyway, so no need to draw it over and over)
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #5  
Old 07-12-2004, 05:01 AM
Okilian Okilian is offline
married to Okilian
Join Date: Apr 2002
Location: Ohio
Posts: 183
Okilian will become famous soon enough
Send a message via AIM to Okilian
newbie scripter question.
|| means or, correct
while && means and?

(my scripting abilities go...that far)
__________________
Reply With Quote
  #6  
Old 07-12-2004, 06:08 AM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
Correct.

ten words ten words dfsgasdad
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

Reply With Quote
  #7  
Old 07-12-2004, 06:57 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
to each their own but MY GOD THAT FORMATTING IS UGLY
Reply With Quote
  #8  
Old 07-12-2004, 05:24 PM
xManiamaNx xManiamaNx is offline
Supreme Dictator
xManiamaNx's Avatar
Join Date: Nov 2002
Location: 127.0.0.1
Posts: 385
xManiamaNx is on a distinguished road
Send a message via MSN to xManiamaNx Send a message via Yahoo to xManiamaNx
Yeah I agree Jagen. Everyone has their own style though.
__________________
Maniaman

Play Maloria Now: [2.3] [3]
Maloria Website

Reply With Quote
  #9  
Old 07-12-2004, 05:59 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 Python523
to each their own but MY GOD THAT FORMATTING IS UGLY
Reminds me of PS' weird style, hehe.
__________________
"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
  #10  
Old 07-14-2004, 04:15 AM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
You mean the formatting that I posted the code in?
I just used the style button that comes with Graal.

Plus after programming for more than 20 years,
I know what the code means however it looks on screen.
In time you will probably develop that tendency also.
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #11  
Old 07-14-2004, 05:12 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally Posted by prozac424242
Plus after programming for more than 20 years,
I know what the code means however it looks on screen.
In time you will probably develop that tendency also.
I never said I don't know what it means on screen, so don't assume that. When I code I try to make things EASY on my eyes.
Reply With Quote
  #12  
Old 07-14-2004, 05:01 PM
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
he's just refering to your
NPC Code:

if (created)
{
dostuffhere;
}


as opposed to the more popular
NPC Code:

if (created) {
dostuffhere;
}


among some other small things, I've gotten used to both over time, so it doesn't bother me (the added spaces from the forums do, however issed: )
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #13  
Old 07-16-2004, 11:51 PM
prozac424242 prozac424242 is offline
Registered User
prozac424242's Avatar
Join Date: May 2001
Location: Gone crazy: back soon
Posts: 356
prozac424242 is on a distinguished road
Send a message via ICQ to prozac424242 Send a message via AIM to prozac424242
Back in the mid to late 1990's when I was in college, the profs taught me that in programming, neat code included each bracket on its own line. This way you can draw boxes around printed sets of code and see if you are missing a bracket easier. To each his own, of course.
__________________

Useful links:
Graal Stats
Client Script Functions-GS1 to GS2
Serverside Script Functions-Gscript page
Particle Engine-Player Attributes
Server Options-Admin rights-Gmaps
Quote:
Originally Posted by Admins
Thanks for developing and improving playerworlds and such
Reply With Quote
  #14  
Old 07-16-2004, 11:55 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Do not use toweapons for weapon NPCs. Add weapons manually through NC, and use the serverside command 'addweapon weaponname' in some NPC to add the weapon to the player.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 11:28 AM.


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