Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

View Poll Results: What is your choice about this thread
Are you happy that there is a gun in the code galery? 5 29.41%
Are you Sad that there is a gun in the code galery? 6 35.29%
Are you mad at me because i posted a working gun script in the code galery 6 35.29%
Voters: 17. You may not vote on this poll

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-04-2009, 12:05 AM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
Wink Gun script working !!

DONT NAG ME ABOUT PARAMQUALS IT STILL Works

i can script

PHP Code:
//SCRIPTED BY GULTHEX B****ES
//DONT NAG ME ABOUT PARAMQUALS
//BECAUSE IT WORKS 
//#CLIENTSIDE
//up
if (playerdir=0){
  
this.x=playerx-1;
  
this.y=playery-2;
}
//left
if (playerdir=1){
  
this.x=playerx-2;
  
this.y=playery;
}
//down
if (playerdir=2){
  
this.x=playerx+1;
  
this.y=playery+2;
}
//right
if (playerdir=3){
  
this.x=playerx+2;
  
this.y=playery;
}
}

if (
weaponfired){
  
setshootparams PARAMEQUALS;
  
//shoot x,y,z,angle,zangle,power,gani,ganiparams;
  
shoot this.x,this.y,playerz,(playerdir 1) * pi 2,,,bullet gani here,;
  
setani firing motion here,;
  
replaceani idle,standing still motion here;
  
replaceani walk,walking motion here;
  
freezeplayer 0.0383;
  
sleep 0.1;
}
if (
actionprojectile) {
  if(
strequals(#p(index),PARAMEQUALS)) {
    
hurt 3;
  }

TOLD YOU I COULD MAKE ME 1


NOW DONT TREAT ME LIKE S#1t
got that!

note post a reply if you need help with it

like where to put it lol

Last edited by GULTHEX; 03-04-2009 at 10:59 PM..
Reply With Quote
  #2  
Old 03-04-2009, 03:21 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
ok, but you shouldn't use toweapons anymore unless you're only practicing offline.

Online this could be accomplished like so:
PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
shoot(player.1.5 vecx(player.dir), player.vecy(player.dir), player.z, (playerdir 1) * pi 2NULLNULL"dg_bullet"NULL);
  
setani("dg_m16-fire"NULL);
  
freezeplayer(0.25);
}

function 
onActionProjectile() {
  
player.hearts -= 3;

Cheers.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 03-04-2009, 04:48 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
gs1 is deprecated and highly inefficient: you should take the time to convert your script to GS2.

You should place the tests for player directions inside the if (weaponfired) condition otherwise each time anything happens, every single condition in the code must be tested and that is highly inefficient (ultimately, player direction should be done inside a weaponfired function). You should also use if->elseif->else otherwise each condition must be interpreted as well <- further inefficieny and it looks really poor.

PHP Code:
//The power of nesting!
// Far more efficient then 5 conditional checks right after each other
if (weaponfired)
{
  if (
condition1)
  {
    
//stuff
  
}
  else if (
condition2)
    
//stuff
  
}
  else
  {
    
//stuff
  
}

You should provide the gani you referenced.

With your attitude and attacks on forum members, you will continue to be treated like ****. You brought in a script you didn't even understand, abused members until they fixed it for you then dumped it here as if it were golden. Grow up.

Last edited by Darlene159; 08-07-2009 at 05:54 PM.. Reason: No need to insult, it doesn't help
Reply With Quote
  #4  
Old 03-04-2009, 01:39 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Also, you're using the assignment operator for comparisons. Instead of using '=' to compare, use '=='.

Last edited by Codein; 03-04-2009 at 04:33 PM..
Reply With Quote
  #5  
Old 03-04-2009, 10:58 PM
GULTHEX GULTHEX is offline
Registered User
Join Date: Jul 2008
Posts: 148
GULTHEX can only hope to improve
Okay I will note that.

K I just dont know much gs2

because I played graal when gs1 was the main scripting language.
And also my scripting teacher only knew gs1 so lol.
Reply With Quote
  #6  
Old 03-04-2009, 11:27 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by GULTHEX View Post
Okay I will note that.

K I just dont know much gs2

because I played graal when gs1 was the main scripting language.
And also my scripting teacher only knew gs1 so lol.
I thought nobody taught you?

Anyway, please make the effort to learn GS2.
Reply With Quote
  #7  
Old 03-05-2009, 04:03 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
i think there have been alot of GS1 around the newbie scripters, they learn GS1 instead of GS2 because of the level editor and the un-updated wiki.
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #8  
Old 03-05-2009, 04:05 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Deas_Voice View Post
i think there have been alot of GS1 around the newbie scripters, they learn GS1 instead of GS2 because of the level editor and the un-updated wiki.
I don't think that's an excuse anymore now there's the Testbed server.
Reply With Quote
  #9  
Old 03-05-2009, 11:12 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Someone (Global Scripting Team???) needs to go through the most important pages on the wiki (e.g. "Serverside Functions") and just write in a description for all the commands & their parameters. I know someone else could do it, but most scripters are generally too busy. What is it that the GST does, anyway? I certainly don't see them out on servers helping people much.
__________________
Reply With Quote
  #10  
Old 03-05-2009, 11:23 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by cbk1994 View Post
Someone (Global Scripting Team???) needs to go through the most important pages on the wiki (e.g. "Serverside Functions") and just write in a description for all the commands & their parameters. I know someone else could do it, but most scripters are generally too busy. What is it that the GST does, anyway? I certainly don't see them out on servers helping people much.
It's a wiki. Do it yourself.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #11  
Old 03-06-2009, 03:19 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Tigairius View Post
It's a wiki. Do it yourself.
Good idea. On top of me paying to develop their game, why don't I also update their documentation so I can continue to develop their game?

I don't have the time to go through the wiki and update all the functions. Isn't this why the GST was formed?
__________________
Reply With Quote
  #12  
Old 03-06-2009, 12:34 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by cbk1994 View Post
I certainly don't see them out on servers helping people much.
Because it's just Skyld now?
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #13  
Old 03-06-2009, 12:36 AM
Vulgar Vulgar is offline
()
Vulgar's Avatar
Join Date: May 2008
Location: Chesapeake, Virginia
Posts: 59
Vulgar is an unknown quantity at this point
Send a message via AIM to Vulgar
Quote:
Originally Posted by Tolnaftate2004 View Post
Because it's just Skyld now?
Quitter
__________________
.
Reply With Quote
  #14  
Old 03-06-2009, 01:30 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by Vulgar View Post
Quitter
I didn't quit...
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #15  
Old 03-06-2009, 01:31 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Tolnaftate2004 View Post
I didn't quit...
Being absent over a long period of time is what I would call indirect quitting.
__________________
Follow my work on social media post-Graal:Updated august 2025.
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 08:56 PM.


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