NPC scripting halps
2 posters
LollyMS :: The Forum :: Help & Questions
Page 1 of 1
NPC scripting halps
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.
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- Spam Addict
- Posts : 184
Join date : 2009-07-28
Age : 28
Location : Hugging my kitty plushy<3.
Re: NPC scripting halps
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.
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- Spam Addict
- Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth
Re: NPC scripting halps
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- Spam Addict
- Posts : 184
Join date : 2009-07-28
Age : 28
Location : Hugging my kitty plushy<3.
Re: NPC scripting halps
Right.
Natural- Spam Addict
- Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth
iloveps- Spam Addict
- Posts : 184
Join date : 2009-07-28
Age : 28
Location : Hugging my kitty plushy<3.
Re: NPC scripting halps
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- Spam Addict
- Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth
Re: NPC scripting halps
Fixed. There ya go.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+ ")
} else if (status == 1) {
cm.sendOk ("+ test + again ");
cmdispose ();
}
}
}
Please help me out now Natural, the guru .
Natural- Spam Addict
- Posts : 138
Join date : 2010-03-16
Age : 29
Location : Earth
LollyMS :: The Forum :: Help & Questions
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|