Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Trees. (https://forums.graalonline.com/forums/showthread.php?t=18426)

maximus_asinus 12-07-2001 05:07 AM

Trees.
 
I am a decent scripter but I have a question and I hope you guys will point me in the right direction.I made a tree script and such but I find it isn't that effiencent.I was wondering if you peoples can tell me commands (not the script!!) to make my tree script more effiencent.It would help me A LOT!
Contact me on AIM or on classic.I might be on g2k1 for a couple hours.

Thak2 12-07-2001 05:25 AM

What is your tree script supposed to do?

maximus_asinus 12-07-2001 05:54 AM

reply
 
I guess I should have indicated that.Well I basically want what the p2p servers have with the tree growing/ apple getting.I have/had a tree but I used putnpc.I know you can use setarray but I don't know how to use it.This is some of the things I need to know about.Saving the tree steps is another thing.And doing it with a low amount of strings would be good.(like 5-10 strings max).Please point me in the right direction.

Python523 12-07-2001 08:00 AM

Re: reply
 
Quote:

Originally posted by maximus_asinus
I guess I should have indicated that.Well I basically want what the p2p servers have with the tree growing/ apple getting.I have/had a tree but I used putnpc.I know you can use setarray but I don't know how to use it.This is some of the things I need to know about.Saving the tree steps is another thing.And doing it with a low amount of strings would be good.(like 5-10 strings max).Please point me in the right direction.
Let me give you a little push into the right direction about arrays:
Arrays are like having a string with more than one string in it, let's start out by setting the array:
setarray myarray,2;
it will set the array and will allow you to set three different parts (0, 1, and 2)

to read the arrays, you do this:
if (myarray[0]=0)
if (myarray[1]=0)
if (myarray[2]=0)
if (myarray[0]=1)
ext...
to set part of an array to a value, you do this:
if (created) {myarray[0]=1;}
and you can do a lot of other things with arrays, hope you understand now

maximus_asinus 12-07-2001 08:56 AM

thanks
 
Thanks for helping me with setarray.I was wondering how to use those for awhile.Now I gotta make some sorta NPC with it to fully understand it.:cool:
Thanks.

Python523 12-07-2001 10:51 AM

Re: thanks
 
Quote:

Originally posted by maximus_asinus
Thanks for helping me with setarray.I was wondering how to use those for awhile.Now I gotta make some sorta NPC with it to fully understand it.:cool:
Thanks.

No problem, try making something like this using arrays:
Make a 'mimic' that will look in the direction you do, it was the first thing I did using arrays

maximus_asinus 12-08-2001 04:40 AM

ok.
 
1 Attachment(s)
I will try to make it but I proably will make a mess of it.I used:
if (playerdir=2) {
dir=4;
say whatever;
}

But that is repetitive.This way I hope is easier and less repetitive.
And if you notive my pic I included.That is from a crafting place I made and the bomy script that I also made.(it doesn't have every little thing in it from g2k1 bomy script but it has almost everything.)

Python523 12-08-2001 05:08 AM

Re: ok.
 
Quote:

Originally posted by maximus_asinus
I will try to make it but I proably will make a mess of it.I used:
if (playerdir=2) {
dir=4;
say whatever;
}


if (playerdir==2)
remember, = is an assignment, == means equals

maximus_asinus 12-08-2001 05:20 AM

sorry
 
that was just a spelling mistake.I would have picked that up if I was looking at the editor.
so let me get this straight.
If I make an NPC that you touch it will activate the setarray command?
Example:
if (playertouchsme) {
setarray testarray,2;
}

If thats proper I have a few other questions.Can you use client.variables or server.variables in the script? And where you pu the # does that set the limit of how many arrays I use?Like if I make it higher can I make more arrays?Same thing with lower?
I just like trying to figure as much as I can about these things.:rolleyes:


All times are GMT +2. The time now is 06:39 AM.

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