Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   GS2 npcprogramming.doc? (https://forums.graalonline.com/forums/showthread.php?t=134266088)

Ducati_Link 03-25-2012 06:48 AM

GS2 npcprogramming.doc?
 
Has anyone made that npcprgramming.doc into GS2? I tried looking but couldn't see anything. I know there is many wiki sites, and this site, and that site... but I'm seriously scripting challenged. I like the pretty pictures, and the basic story book like explanations.

fowlplay4 03-25-2012 07:15 AM

You've looked at my guide, no?

Ducati_Link 03-25-2012 07:26 AM

I kinda did - but I got a bit lost o.O
I'm not to sure how we got from point 1 to point 2. I really wanna learn, the basics, but my scripting consists of dontblock; drawunderplayer; drawoverplayer; - all in GS1.

I dont even get where to start on GS2, and to convert the.. if created to what ever it is these days. I'm seriously seriously scripting retarded. (ask Twinny)

Tricxta 03-25-2012 08:06 AM

You have access to a npc server. Just make up a script of some random functions, find out what's the effect of them and read up on object oriented programming in general, it's worth the time if you don't know what a class is or a function.

Edit: I looked through this,http://en.wikipedia.org/wiki/Object-...ed_programming and it's not what you need.

Basically...

Just remember that classes are libraries of functions so you don't have to retype the same code and they can be joined to level npcs or weapons. I'd also recommend reading fowlplays guide, I thought it was really simple and showed all the basics of gs2 required to produce a script. Just read through it slowly and test the examples to see their effect.

Ducati_Link 03-25-2012 08:30 AM

Okay, so if we are talking the upmost basics of GS1...

if (playertouchsme) {
lay greenrupee;
hide;
}

would it be..

function onCreated () { - I'm already stuck.. I have a feeling it's not onCreated - but I dont know what the others are? I can't see anything on these sites. *face plants into desk*


see, this npcprogramming puts it all down:

- playerenters set when the player currently enters the level
- playertouchsother set when another npc is touched by the player
- playerlaysitem set when an item is layed by the player or another npc
- compusdied set when the last baddy has died
- playerendsreading set when the player ends reading a sign
- timeout set when the npc's timeout runs out

MattKan 03-25-2012 08:32 AM

Quote:

Originally Posted by fowlplay4 (Post 1689918)
You've looked at my guide, no?

Finish it. (please)

Ducati_Link 03-25-2012 08:35 AM

well I figured the most basics would be where you start, which would be at the start. further I went down, the more I got lost. But I shall continue on..

edit:
function onPlayerTouchsMe() { - okay, got that bit. Rest, I still don't know.

callimuc 03-25-2012 12:34 PM

Well there is a document just like the commands.rtf for GS2. It does not have all commands and so on in it, but for the basics it should be fine.

http://forums.graalonline.com/forums...ad.php?t=69323

Skyld 03-25-2012 01:20 PM

Quote:

Originally Posted by Ducati_Link (Post 1689929)
function onCreated () { - I'm already stuck.. I have a feeling it's not onCreated - but I dont know what the others are? I can't see anything on these sites. *face plants into desk*

Actually you are right. http://gscript.graal.net/CategoryFunctionEvent for a few examples.

Ducati_Link 03-25-2012 01:42 PM

Okay, excellent - thanks guys. I will continue to venture forth.

BlueMelon 03-25-2012 04:21 PM

Personally I think it would be hard to learn GS2 without any prior programming experience. Learning another language (with more documentation) would really help. It helped me greatly.

Devil_Lord2 03-25-2012 09:06 PM

3 Attachment(s)
Quote:

Originally Posted by fowlplay4 (Post 1689918)
You've looked at my guide, no?

Quote:

Originally Posted by MattKan (Post 1689930)
Finish it. (please)

Make it more user friendly, sometimes it helps, many times it does not.
Sometimes it is just confusing, like the math problem that says it should work but would never work..

And anything that uses foobar crap that has nothing to do with programming or variables most likely, like myself, confuse the heck out of newcomers.



=====
I personally would love to see npcprogramming2.doc and wanted to do it my self when I had time. (probably wouldn't be as efficient as someone else doing it)

For those that don't have it, it is listed below. ZeroG sent me it a while ago.


npcprogramming.doc = GS1
commands.txt = GS1
commands2.txt = GS2

I added one line into commands 2, findimg().
I'd like to add more but I don't know them and they are floating around randomly.

The owner quit this, but I tried to give user-friendly information here...
It definitely needs more added and I'd like to redo it with images, possibly videos.
http://scriptingschool.forumotion.com/

Ducati_Link 03-26-2012 06:06 AM

Thanks DL :)

Tricxta 03-26-2012 10:00 AM

Converting gs1 to a gs2 like structure is relatively easy
if (playertouchsme) {
lay greenrupee;
hide;
}

function onPlayertouchsme(){
lay("greenrupee");
hide();
}

Strings require quotes instead of the yucky #s(some string) buisness, and every function requires brackets even if there are no arguments as you saw in the example given.


All times are GMT +2. The time now is 03:51 AM.

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