Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   Creative Corner (https://www.graalians.com/forums/forumdisplay.php?f=17)
-   -   Tutorial: Creating a character NPC (https://www.graalians.com/forums/showthread.php?t=5548)

callimuc 04-17-2012 01:13 PM

Quote:

Posted by Tricxta (Post 97281)
how to count to 10 in gs1:
PHP Code:

for (this.i=0;this.i<10;this.i++){
  
message #v(this.i);
  
sleep 1;


K, I'll have my rep now thanks

How to do it in GS2:

PHP Code:

function onCreated() {
  for (
this.i=0this.i<10this.i++) {
    
this.chat temp.i;
    
sleep(1);
  }


well IŽd use temp.i rather than this.i if you will just need it in the onCreated() part.

Lollo 04-17-2012 01:31 PM

what about making a npc with personal head and body?=o

callimuc 04-17-2012 01:31 PM

Quote:

Posted by Lollo (Post 97345)
what about making a npc with personal head and body?=o

Change the filenames to yours. And make sure the images are 8bit.

Tricxta 04-25-2012 08:00 AM

Quote:

Posted by callimuc (Post 97335)
How to do it in GS2:

PHP Code:

function onCreated() {
  for (
this.i=0this.i<10this.i++) {
    
this.chat temp.i;
    
sleep(1);
  }


well IŽd use temp.i rather than this.i if you will just need it in the onCreated() part.

your game of the obvious is here by accepted.

How to count from 10 to 1 in GS2:
PHP Code:

function onCreated() {
  for (
this.i=10this.i>=0this.i--) {
    
this.chat temp.i;
    
sleep(1);
  }



callimuc 04-25-2012 08:04 PM

Quote:

Posted by Tricxta (Post 102132)
your game of the obvious is here by accepted.

How to count from 10 to 1 in GS2:
PHP Code:

function onCreated() {
  for (
this.i=10this.i>=0this.i--) {
    
this.chat temp.i;
    
sleep(1);
  }



Maybe its kinda late for me but that should go down to 0 :P

MysticalDragon 05-01-2012 09:20 PM

I would do personally do!
PHP Code:

function onCreated() {
  for (
10>= 0--) {
   
this.chat temp.i;
   
waitfor(this"noevent"1);
  }


And replying to MattKan,
Its not ineffectiveness to use GS1 Characters online, has the same effect as GS2, although it isn't as clean as GS2. Its still perfectly fine.

Godoco 12-31-2012 02:55 PM

I really hate to bump old threads, but what is the GS1 code for implementing a GANI in an NPC?

Emera 12-31-2012 04:19 PM

Quote:

Posted by Godoco (Post 270293)
I really hate to bump old threads, but what is the GS1 code for implementing a GANI in an NPC?

I'm not good with GS1 at all, but I think it's just ani = moo; or charani = moo; under the showcharacter function.

callimuc 12-31-2012 04:22 PM

Quote:

Posted by Godoco (Post 270293)
I really hate to bump old threads, but what is the GS1 code for implementing a GANI in an NPC?

PHP Code:

if (created) {
  
showcharacter//or showcharacter() not sure anymore
  //outfitstuff here
  
setcharani ani,params//if you dont have parameters: setcharani ani,;



Tricxta 12-31-2012 10:13 PM

Quote:

Posted by callimuc (Post 270345)
PHP Code:

if (created) {
  
showcharacter//or showcharacter() not sure anymore
  //outfitstuff here
  
setcharani ani,params//if you dont have parameters: setcharani ani,;



showcharacter is only used if the player's a character, it tells the npc to use **** like a head and what not.

Also due to it being GS1, functions with 0 arguments meant not brackets had to be provided hence what I just said.

Also all commands for GS1 can be found in commands.rtf which should be lying around in some old graal file which you can scavenge from somewhere...


All times are GMT. The time now is 09:06 PM.

Powered by vBulletin/Copyright ©2000 - 2026, vBulletin Solutions Inc.