Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help: Making a weapon (https://forums.graalonline.com/forums/showthread.php?t=134257191)

Dnegel 12-04-2009 02:06 PM

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.

Samposse 12-04-2009 02:29 PM

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

firefighter 12-04-2009 02:37 PM

Each server has its own weapon system ;)

GScript Guide

Dnegel 12-04-2009 06:17 PM

Quote:

Originally Posted by Samposse (Post 1542385)
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 (Post 1542387)
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?

Kyranki 12-04-2009 10:09 PM

Umm, well usually you would start off by making a Weapon System in...weapons. :p 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.

Dnegel 12-04-2009 10:18 PM

Quote:

Originally Posted by Kyranki (Post 1542470)
Umm, well usually you would start off by making a Weapon System in...weapons. :p 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.

Kyranki 12-04-2009 10:47 PM

Quote:

Originally Posted by Dnegel (Post 1542472)
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. :cry:

Dnegel 12-04-2009 11:49 PM

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.

Sage_Shadowbane 12-05-2009 09:25 AM

Quote:

Originally Posted by Dnegel (Post 1542489)
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.

Dnegel 12-05-2009 04:48 PM

Quote:

Originally Posted by Sage_Shadowbane (Post 1542629)
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.

Codein 12-05-2009 05:13 PM

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.

Dnegel 12-05-2009 06:14 PM

Quote:

Originally Posted by Codein (Post 1542667)
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. :)

Switch 12-05-2009 10:44 PM

PHP Code:

//#CLIENTSIDE 

Go.

Dnegel 12-05-2009 11:19 PM

Lol, I know that one.

I guess it will start with
PHP Code:

//#CLIENTSIDE
 
functionTest(); 


Skyld 12-06-2009 02:06 AM

Quote:

Originally Posted by Dnegel (Post 1542724)
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();




All times are GMT +2. The time now is 04:57 PM.

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