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 12-02-2005, 01:38 PM
steve2 steve2 is offline
Steve (Scripter)
Join Date: Jul 2005
Location: Canada
Posts: 32
steve2 is on a distinguished road
Send a message via AIM to steve2 Send a message via MSN to steve2
Talking A simple script for you !! (WARNING: has errors)

Hello Guys!

Hmm this isnt that hard script its very simple but i still like this light effect....
I will give u this for free use and to learn of it, i think it can be helpfull if u new to gscript....just copy this script into a npc in ur leveleditor and touch it and u will have this weapon and can try it (use addweapon for online use and if u got NC in RC u could add it there )
Feel free to edit it

Keep trying and scripting and if u got any Questions about any scripts or such just feel free to post them here

Greetings

Steve -NAT-

PHP Code:
//#CLIENTSIDE
//NPC made by steve
// Light effect

if(created){
  
setimg block.png;
  
color = {0,0,0,0};
  
timeout 0.05;
}
if (
playertouchsme){
  
toweapons Light Mouse;
}
if(
timeout){
  for(
010++){
    
this.= (this.10) ? (this.0.5) : this.0;
    
showimg this.i,light2s.png,mousex,mousey;
    
changeimgcolors this.i,color[0],color[1],color[2],color[3];
    
changeimgzoom this.i,random(0.1,0.9);
    
changeimgvis this.i,1;
  }
  
timeout 0.05;
}
if(
playerchats){
  if(
strequals(#c,/red)) color = {0.5,0,0,0.5};
  
elseif(strequals(#c,/green)) color = {0,0.5,0,0.5};
  
elseif(strequals(#c,/yellow)) color = {0.5,0.5,0,0.5};
  
elseif(strequals(#c,/blue)) color = {0,0,0.5,0.5};
  
elseif(strequals(#c,/white)) color = {0.5,0.5,0.5,0.5};
  
elseif(strequals(#c,/end)) color = {0,0,0,0};
}
if (
weaponfired) {
  
say2
  Light Mouse made by Steve2
#b //Dont change this Line please :P
  
/"colour" to change the colour.#b
  
Colours are redbluewhite,#b
  
yellow,green!#b
  
type "/end" to turn it off,#b
  
to turn it on just set a Colour.#b


Last edited by steve2; 12-02-2005 at 05:50 PM..
Reply With Quote
  #2  
Old 12-02-2005, 05:42 PM
Jackel9 Jackel9 is offline
Dimension Zero Founder
Jackel9's Avatar
Join Date: Nov 2005
Location: NC SONZ
Posts: 193
Jackel9 is on a distinguished road
Talking

Wow I remember that one Steve
I was really impressed by that script.=D
__________________

Reply With Quote
  #3  
Old 12-02-2005, 10:01 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
Quote:
Originally Posted by steve2
Keep trying and scripting and if u got any Questions about any scripts or such just feel free to post them here ]
I have a question. What happens when someone tries to use showimg with a noninteger index? Because that's what you're attempting to do, though your line

Quote:
NPC Code:
    this.a = (this.a < 10) ? (this.a + 0.5) : this.a = 0;

isn't quite doing what you think it will.
Reply With Quote
  #4  
Old 12-02-2005, 10:11 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
It should most certainly not be running that timeout when the effect is not to be seen.

Other than that and what Lance said, it's a decent script (construction wise)
*cough*GS2isthewaveofthefuture*cough*
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #5  
Old 12-03-2005, 08:10 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
Quote:
Originally Posted by Dach
It should most certainly not be running that timeout when the effect is not to be seen.
Agreed, although, i don't see how it's such an impressive script as Jackel9 said. All it does is show a color changing light where the player's mouse location.

Also toweapons should not be used, even if this script is to be used offline. This certainly would have worked offline without the toweapons.
__________________
Reply With Quote
  #6  
Old 12-03-2005, 09:13 PM
steve2 steve2 is offline
Steve (Scripter)
Join Date: Jul 2005
Location: Canada
Posts: 32
steve2 is on a distinguished road
Send a message via AIM to steve2 Send a message via MSN to steve2
yes you should read my text i said toweapons just for offline test
and that isnt very good i said too but i like effect :P + thats not one of my best....i work as NAT on Shaded Legend right now so if u have questions meet me there!! (and i can scirpt gscript2 because shaded use the engine gscript2, but i did this in gscript1 because people want to test it in editor)
Reply With Quote
  #7  
Old 12-03-2005, 10:29 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
Quote:
Originally Posted by steve2
yes you should read my text
I did.
Quote:
Originally Posted by steve2
i said toweapons just for offline test and that isnt very good
No you did not.

Plus, the script would have worked without toweapons just as a level npc.
__________________
Reply With Quote
  #8  
Old 12-04-2005, 01:36 AM
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
Quote:
Originally Posted by steve2
yes you should read my text i said toweapons just for offline test
and that isnt very good i said too but i like effect :P + thats not one of my best....i work as NAT on Shaded Legend right now so if u have questions meet me there!! (and i can scirpt gscript2 because shaded use the engine gscript2, but i did this in gscript1 because people want to test it in editor)
So, you do not plan to correct the egregious errors of this script?
Reply With Quote
  #9  
Old 12-04-2005, 04:11 AM
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
Quote:
Originally Posted by Lance
isn't quite doing what you think it will.
Either your post is unclear (to me), or you see an alternate interpretation of this statement. To me I only see one interpretation, and a quick check in the editor confirms this behaviour (ie: counting in half steps up to 10, then reseting). The multiplication with 'i' to give it its indexes leads to some nice patternal behaviour (1,3,6,10,15 etc..) on the first loop, and an alternate series of integers on the second loop through.

On the 3rd and 4th loops however, half the values have a .5 offset (and shouldn't be valid image indexes), is this what you are referring to Lance?

Asside:
Note that the above '.5' issue can be fixed by changing the case to <=, as this then ensures that the lengths of both 'counted loops' are both even, and the value will (in this case), always be even. Or change it to < 9.5, and then not only are they both even, but they are also both mulitples of eachother, which has other interesting properties.
__________________
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

Last edited by Polo; 12-04-2005 at 04:31 AM..
Reply With Quote
  #10  
Old 12-04-2005, 04:23 AM
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
Quote:
Originally Posted by Polo
Either your post is unclear (to me), or you see an alternate interpretation of this statement. To me I only see one interpretation, and a quick check in the editor confirms this behaviour (ie: counting in half steps up to 10, then reseting). The multiplication with 'i' to give it its indexes leads to some nice patternal behaviour (1,3,6,10,15 etc..) on the first loop, and an alternate series of integers on the second loop through.

On the 3rd and 4th loops however, half the values have a .5 offset (and shouldn't be valid image indexes), is this what you are referring to Lance?

Asside:
Note that the above '.5' issue can be fixed by changing the case to <=, as this then ensures that the lengths of both 'counted loops' are multiples of eachother, and the value will (in this case), always be even.
Other than the noninteger image index problem,

NPC Code:
this.a = (this.a < 10) ? (this.a + 0.5) : this.a = 0;


Should be:
NPC Code:
this.a = (this.a < 10) ? (this.a + 0.5) : 0;

Reply With Quote
  #11  
Old 12-04-2005, 03:03 PM
steve2 steve2 is offline
Steve (Scripter)
Join Date: Jul 2005
Location: Canada
Posts: 32
steve2 is on a distinguished road
Send a message via AIM to steve2 Send a message via MSN to steve2
no no time to clear errors people who cant scirpt could just learn some stuff about light and lightpositions of it :P i got a lot of work on SL right now probably later
Reply With Quote
  #12  
Old 12-04-2005, 05:48 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
Quote:
Originally Posted by steve2
no no time to clear errors people who cant scirpt could just learn some stuff about light and lightpositions of it :P i got a lot of work on SL right now probably later
Thus you shouldn't post erroneous scripts on the forum for others to learn from.
__________________
Reply With Quote
  #13  
Old 12-05-2005, 12:37 AM
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
Quote:
Originally Posted by steve2
no no time to clear errors people who cant scirpt could just learn some stuff about light and lightpositions of it :P i got a lot of work on SL right now probably later
Okay.
Reply With Quote
  #14  
Old 12-05-2005, 08:47 PM
steve2 steve2 is offline
Steve (Scripter)
Join Date: Jul 2005
Location: Canada
Posts: 32
steve2 is on a distinguished road
Send a message via AIM to steve2 Send a message via MSN to steve2
okay u could remove this thread if u want xD i just like the effect because if u online and use this weapon other players can see ur mouses in form of this light :P so if many people online there many lights in level flying around lol could be used to show something or such lol but yea u right gscript2 is the future
Reply With Quote
  #15  
Old 12-10-2005, 01:08 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Uhm, doesnt //#CLIENTSIDE mean that only the single player who is running that script sees it, not everyone else?
__________________

I hope for nothing. I fear nothing. I am free.
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 09:06 PM.


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