LollyMS
Oh dear, it seems you're not logged in. Please log in or register with us to view our forums(:

Join the forum, it's quick and easy

LollyMS
Oh dear, it seems you're not logged in. Please log in or register with us to view our forums(:
LollyMS
Would you like to react to this message? Create an account in a few clicks or log in to continue.

NPC scripting halps

2 posters

Go down

NPC scripting halps Empty NPC scripting halps

Post  iloveps Sat Apr 17, 2010 9:39 am

Hello, I would like to say I will be back now, got alot of things resolved. Now, I have been learning NPC scripting a bit and still need help. Here is one, tell me if this right right please!

var status = 0;

function start() {
status = -1;
action(1, 0, 0);
}

function action(mode, type, selection) {

if (mode == 0) {
cm.dispose();
}
else {
if (status == 0 && mode == 0) {
cm.dispose();
return;
}

if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendNext ("I am testing :)")
cmdispose ();
cm.sendOk ("I am testing again :)")
cmdispose ();
}
}
}

Please help me out now Natural, the guru :P.
iloveps
iloveps
Spam Addict
Spam Addict

Posts : 184
Join date : 2009-07-28
Age : 28
Location : Hugging my kitty plushy<3.

Back to top Go down

NPC scripting halps Empty Re: NPC scripting halps

Post  Natural Sat Apr 17, 2010 12:40 pm

Epic fail. I will edit it for you now! Edit2: It's cm.dispose(); and you put a status after every cm.sendOk because.... I forgot ;P Edit3: you don't put a dispose after everyone, because dispose ends the chat automatically. The mode=-1 is the "End Conversation" at the bottom right corner. Edit4: This is to make sure you understand. Since you placed cm.dispose(); after every statement, or the "ok's", it closes it after reading the "ok's". Most liekly the script you made will either: A. D\c B. Error C. Not talk, or D. Something magical.

Edit:var status = 0;

function start() {
status = -1;
action(1, 0, 0);
}

function action(mode, type, selection) {
if (mode == -1) {
cm.dispose();
}
else {
if (mode == 0) {
cm.SendOk(" Well, too bad.");
cm.dispose();
return;
}
if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendYesNo("Is this a good example or what?!");
}
else if (status == 1) {
cm.sendOk("ikr!!!");
cm.dispose();
}
}
Well, not edit completely.
Natural
Natural
Spam Addict
Spam Addict

Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth

Back to top Go down

NPC scripting halps Empty Re: NPC scripting halps

Post  iloveps Sat Apr 17, 2010 4:17 pm

LOL!!! I need helps, no? I am getting there though ^^. Give me lessons now, I need em. Also scripting things like this has also fascinated me. Help me learn =S.


Last edited by iloveps on Sat Apr 17, 2010 4:38 pm; edited 1 time in total
iloveps
iloveps
Spam Addict
Spam Addict

Posts : 184
Join date : 2009-07-28
Age : 28
Location : Hugging my kitty plushy<3.

Back to top Go down

NPC scripting halps Empty Re: NPC scripting halps

Post  Natural Sat Apr 17, 2010 4:20 pm

Right.
Natural
Natural
Spam Addict
Spam Addict

Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth

Back to top Go down

NPC scripting halps Empty Re: NPC scripting halps

Post  iloveps Sat Apr 17, 2010 4:43 pm

Oh psh. It is better than when I didn't understand the next button. =S.
iloveps
iloveps
Spam Addict
Spam Addict

Posts : 184
Join date : 2009-07-28
Age : 28
Location : Hugging my kitty plushy<3.

Back to top Go down

NPC scripting halps Empty Re: NPC scripting halps

Post  Natural Sat Apr 17, 2010 5:57 pm

Next button ALWAYS needs a status. And to continue that, you put another status ( the second one) and continue that with something else. You can always end it with The Next, but it seems weird. ] else if (status == 1) [ cm.SendNext("sdfsdfsfsdfs."); cm.dispose();
Natural
Natural
Spam Addict
Spam Addict

Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth

Back to top Go down

NPC scripting halps Empty Re: NPC scripting halps

Post  Natural Sun Apr 18, 2010 12:15 pm

iloveps wrote:Hello, I would like to say I will be back now, got alot of things resolved. Now, I have been learning NPC scripting a bit and still need help. Here is one, tell me if this right right please!
var test = I am testing
var status = 0;

function start() {
status = -1;
action(1, 0, 0);
}

function action(mode, type, selection) {

if (mode == -1) {
cm.dispose();
}
return;
}

if (mode == 1) {
status++;
}
else {
status--;
}
if (status == 0) {
cm.sendNext ("+test+ Smile")
} else if (status == 1) {
cm.sendOk ("+ test + again Smile");
cmdispose ();
}
}
}

Please help me out now Natural, the guru Razz.
Fixed. There ya go.
Natural
Natural
Spam Addict
Spam Addict

Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth

Back to top Go down

NPC scripting halps Empty Re: NPC scripting halps

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum