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-04-2009, 02:06 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Exclamation Help: Making a weapon

The best way to learn to script is to ask the ones that knows it, that's what i've learned so here we go, im gonna be using Testbed as server.

I have made a GFX of a Weapon, and I have also made a GANI for Reload, Idling, Walking / Running and Firing.

So, what's left is the script.

And here is it when your help comes in; Do you maybe know a perfect thread for this, tutorial or maybe you can just explain it easily in a post?

It's your choice, and if your here to be an idiot then you can just press the X button in the north-east corner of your Web Browser.

I want this to be a serious thread, im here to learn, not to waste time.

Thanks.
~ Rjax S.
Reply With Quote
  #2  
Old 12-04-2009, 02:29 PM
Samposse Samposse is offline
Chopa Shopa !
Samposse's Avatar
Join Date: Nov 2008
Location: Norway
Posts: 87
Samposse is an unknown quantity at this point
Send a message via AIM to Samposse Send a message via MSN to Samposse
if ur Learning ur self to script so shoud u maybe give it an try of making the script by your self
you will alot of help on the forums for that
__________________
Delitto :3

A
SERVER
UNDER
CONSTRUCTION !

feel free to ask me about delitto
Reply With Quote
  #3  
Old 12-04-2009, 02:37 PM
firefighter firefighter is offline
Registered User
Join Date: Jan 2009
Location: Germany
Posts: 70
firefighter is on a distinguished road
Each server has its own weapon system

GScript Guide
Reply With Quote
  #4  
Old 12-04-2009, 06:17 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Quote:
Originally Posted by Samposse View Post
if ur Learning ur self to script so shoud u maybe give it an try of making the script by your self
you will alot of help on the forums for that
I know that I need to find it out by myself, but I was mostly wanting like, a good start. And that's why I made this thread, it would maybe help others to that need help with such scripts?

Quote:
Originally Posted by firefighter View Post
Each server has its own weapon system

GScript Guide
Thanks for the site, though I know about it already, and I have read it. But of course, im not gonna stop reading, I will go read now anyways so yeh.

And thanks for the replies.

Note: But it's right that I need to make a Weapon System in Classes right?
Reply With Quote
  #5  
Old 12-04-2009, 10:09 PM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Umm, well usually you would start off by making a Weapon System in...weapons. But maybe you know you should start on a lot of smaller things to cover all the basics and make sure you understand some of the most simple yet confusing things.
__________________
Stan.
Reply With Quote
  #6  
Old 12-04-2009, 10:18 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Quote:
Originally Posted by Kyranki View Post
Umm, well usually you would start off by making a Weapon System in...weapons. But maybe you know you should start on a lot of smaller things to cover all the basics and make sure you understand some of the most simple yet confusing things.
I understand a little, but I still need a little push to get started.
Reply With Quote
  #7  
Old 12-04-2009, 10:47 PM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by Dnegel View Post
I understand a little, but I still need a little push to get started.
Honestly, if you don't have any prior coding experience...and that was an assumption which could possibly be wrong, it's going to hard to try and teach yourself. Like it was for me. If you can find a good teacher to try and show you the path and things then you will learn Gscript relatively easily. Gah...where's Hell Raven when you need him.
__________________
Stan.
Reply With Quote
  #8  
Old 12-04-2009, 11:49 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Mhmmm yes, I can of course try to do it all alone.

But that will take alot of time, and I dont wanna use that much time. I mostly just wanna learn some basics in scripting.
Reply With Quote
  #9  
Old 12-05-2009, 09:25 AM
Sage_Shadowbane Sage_Shadowbane is offline
Graal Developer
Sage_Shadowbane's Avatar
Join Date: Mar 2004
Posts: 585
Sage_Shadowbane will become famous soon enough
Quote:
Originally Posted by Dnegel View Post
Mhmmm yes, I can of course try to do it all alone.

But that will take alot of time, and I dont wanna use that much time. I mostly just wanna learn some basics in scripting.
Best way to learn, is to practice on your own. You're really not going to learn how to script by depending on other people on the forums to "guide" you in the right direction.
Reply With Quote
  #10  
Old 12-05-2009, 04:48 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Quote:
Originally Posted by Sage_Shadowbane View Post
Best way to learn, is to practice on your own. You're really not going to learn how to script by depending on other people on the forums to "guide" you in the right direction.
I knwo your right, and I would try to practice.

First I need to make a way to show the weapon when I click a button, D for example.
Reply With Quote
  #11  
Old 12-05-2009, 05:13 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
Experiment, experiment and experiment! When you find out about a function you didn't know about, work with it. Pinch and pull every part of GScript until you know what it can do and what it can't do.

If you need someone to help you when you get stuck, send a message my way on MSN, AIM or on here.

Looking at other people's scripts also help quite a lot.

I also agree that you're jumping in at the deep end here. Take small projects, and build on them. Then choose a slightly bigger project, so on and so forth.
Reply With Quote
  #12  
Old 12-05-2009, 06:14 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Quote:
Originally Posted by Codein View Post
Experiment, experiment and experiment! When you find out about a function you didn't know about, work with it. Pinch and pull every part of GScript until you know what it can do and what it can't do.

If you need someone to help you when you get stuck, send a message my way on MSN, AIM or on here.

Looking at other people's scripts also help quite a lot.

I also agree that you're jumping in at the deep end here. Take small projects, and build on them. Then choose a slightly bigger project, so on and so forth.
Thanks, I will try to do so then.
Reply With Quote
  #13  
Old 12-05-2009, 10:44 PM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
PHP Code:
//#CLIENTSIDE 
Go.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #14  
Old 12-05-2009, 11:19 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Lol, I know that one.

I guess it will start with
PHP Code:
//#CLIENTSIDE
 
functionTest(); 
Reply With Quote
  #15  
Old 12-06-2009, 02:06 AM
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 Dnegel View Post
Lol, I know that one.

I guess it will start with
PHP Code:
//#CLIENTSIDE
 
functionTest(); 
If you do not have your function call inside a function block then it will result in unusual behaviour (being called every time an event occurs perhaps, which would get very messy and use a lot of CPU time). Instead you should call your function from specific events (i.e. onCreated being called when the NPC is updated or the script is first loaded):
PHP Code:
//#CLIENTSIDE

function onCreated()
{
  
functionTest();

__________________
Skyld
Reply With Quote
  #16  
Old 12-06-2009, 01:29 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Ahhh, many thanks for that reminder.

Im thinking about making a script, when you press a button, you shoot.

Im currently now sitting left with this, but the ani wouldnt show, im sure it's something to do with the
if (buttonpressed) (d); .

PHP Code:
//#CLIENTSIDE

function onCreated()
{
  
functionTest();
   if (
buttonpressed)(d);
   
setani ("mp7-fire","");


Last edited by Dnegel; 12-06-2009 at 01:42 PM..
Reply With Quote
  #17  
Old 12-07-2009, 10:21 PM
Sage_Shadowbane Sage_Shadowbane is offline
Graal Developer
Sage_Shadowbane's Avatar
Join Date: Mar 2004
Posts: 585
Sage_Shadowbane will become famous soon enough
Quote:
Originally Posted by Dnegel View Post
Ahhh, many thanks for that reminder.

Im thinking about making a script, when you press a button, you shoot.

Im currently now sitting left with this, but the ani wouldnt show, im sure it's something to do with the
if (buttonpressed) (d); .

PHP Code:
//#CLIENTSIDE

function onCreated()
{
  
functionTest();
   if (
buttonpressed)(d);
   
setani ("mp7-fire","");

You do know that making up your own events isn't going to work, correct? Like almost everyone has already told you, stop trying to depend on us. It's pretty obvious that you haven't even attempted to learn Gscript or you wouldn't be posting silly things like if (buttonpressed)(d);. That doesn't exist, and I'm pretty sure that it never will. So please, go and try to take atleast 10 minutes out of your time and read some scripting tutorials that are posted everywhere on these forums, than come back with a half way reasonable script which we can attempt to help me with. As for your script atm:

PHP Code:
//#CLIENTISIDE
function onKeyPressedkeycodekeyname ) {
  if ( 
keyname == "D" ) {

    
setani ("mp7-fire","");
  }

Something along the lines of that would be more suitable for what you're looking for. But please, don't just use the script I've posted for you, go and edit it adding two lines, than coming back here and asking for help again.
Reply With Quote
  #18  
Old 12-08-2009, 04:44 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Ahhh, finally someone wrote something * Puts hands togheter *

Great respond to.

Well, I guess your right, because you know this more than me. But I have actually read alot, but I guess I didn't have it all scheduled.

Now I got it all scheduled though, and I will actually find scripts lines that works.

Im starting fresh again.
Reply With Quote
  #19  
Old 12-08-2009, 05:09 PM
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
Quote:
Originally Posted by Dnegel View Post
and I will actually find scripts lines that works.
If you only ever take lines of code without ever understanding how they work, you will just become another player world parasite destined to detriment future development. Read the Graal Bible, read the tutorials out there and learn to help yourself.

The graal forums do not support parasitic developers very long....Jigga is a good example of this.
Reply With Quote
  #20  
Old 12-08-2009, 05:23 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Important thing to note: Do not have a space before the parenthesis.

setani ("mp7-fire",""); will invoke the GS1 form and attempt to set your ani to ("mp7-fire".gani

Remove the space so it becomes: setani("mp7-fire","");
Reply With Quote
  #21  
Old 12-08-2009, 07:57 PM
Dnegel Dnegel is offline
Rjax Shizibz
Join Date: Jul 2009
Posts: 1,334
Dnegel will become famous soon enough
Ahhh, thank you very much Riot for that fix.

And to you Twinny, I have read the tutorials.
Reply With Quote
  #22  
Old 12-10-2009, 12:06 PM
Samposse Samposse is offline
Chopa Shopa !
Samposse's Avatar
Join Date: Nov 2008
Location: Norway
Posts: 87
Samposse is an unknown quantity at this point
Send a message via AIM to Samposse Send a message via MSN to Samposse
Quote:
Originally Posted by Dnegel View Post
Ahhh, thank you very much Riot for that fix.

And to you Twinny, I have read the tutorials.

ye, i did to but didnt understand it so mutch
__________________
Delitto :3

A
SERVER
UNDER
CONSTRUCTION !

feel free to ask me about delitto
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:53 AM.


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