Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Best thing ever for a NPC! Must read!

What do you think about it

  • I had this already, you're really stupid for releasing this

    Votes: 7 50.0%
  • This is nice, so easy, but i just haven't figured this before!

    Votes: 7 50.0%

  • Total voters
    14
Status
Not open for further replies.
The almighty chicken
Loyal Member
Joined
Apr 7, 2008
Messages
570
Reaction score
31
Hey, sometimes there's an event in your server like..

example: i got a first to 200 event
in my free market is an exp seller..
that's quite stupid..

SO.
i came up with a quick solution

if you make a npc put this at the start of it
PHP:
var status = 0;
var on = 1;
var off = 0;
var activated = on;

you see the actived? that's what this is all about
now, ull start your script

PHP:
function start() {
 status = -1;
 action(1, 0, 0);
}
function action(mode, type, selection) {
 if (mode == -1) {
  cm.dispose();
 } else {
  if (mode == 0 && status == 0) {
   cm.dispose();
   return;
  }
  if (mode == 1)
   status++;
  else
   status--;

a script ALWAYS have to start with this! this is the base
lets continue our script from beginning

PHP:
var status = 0;
var on = 1;
var off = 0;
var activated = on;
 
function start() {
 status = -1;
 action(1, 0, 0);
}
function action(mode, type, selection) {
 if (mode == -1) {
  cm.dispose();
 } else {
  if (mode == 0 && status == 0) {
   cm.dispose();
   return;
  }
  if (mode == 1)
   status++;
  else
   status--;
  if (activated == on) {
   YOUR SCRIPT HERE
   script.. script..
   more script!
   end of script :P
  } else {
   cm.sendOk("I am not activated..");
   cm.dispose();
  }
 }
}

ehr. that was it i guess?
thanks would be appreciated ^^


Summary:
PHP:
var on = 1;
var off = 0;
var activated = on;
 
if (activated == on) {
YOUR SCRIPT HERE
} else {
cm.sendOk("I am not activated..");
cm.dispose();
}
 
Last edited:
Junior Spellweaver
Joined
Feb 3, 2008
Messages
183
Reaction score
2
Woa... Thats cool , because we can start making NPCs and after got all the NPCs in GMS start coding it O_O
 
Junior Spellweaver
Joined
Feb 3, 2008
Messages
183
Reaction score
2
lol yea
but it's mostly the easy things that make people happy.
especially the people who don't have the time/knowledge to code their own npcs




wth? i don't understand you.

I dont speak english , so is logic that you dont understand what im talking about o.o

Basically :

We create new NPCs with activate = off
After we create ALL NPCs that are in GMS and not in the source
Start coding the NPCs and change activate = off to activate = on

EDIT: I UNDERSTAND 100% English , but i dont write it O_O
 
Master Summoner
Loyal Member
Joined
Jul 27, 2008
Messages
583
Reaction score
0
So true...

And btw, IMO is better, use just 1 variable.. as so..

if (variable == 0){
No event message
}else{
normal..
 
Burn the land,
Loyal Member
Joined
Aug 7, 2008
Messages
1,903
Reaction score
17
Sorry for being a noob, but what does this do?
 
The almighty chicken
Loyal Member
Joined
Apr 7, 2008
Messages
570
Reaction score
31
nice.
but isnt this more like a guide

i will update it later with changes in the source

I dont speak english , so is logic that you dont understand what im talking about o.o

Basically :

We create new NPCs with activate = off
After we create ALL NPCs that are in GMS and not in the source
Start coding the NPCs and change activate = off to activate = on

EDIT: I UNDERSTAND 100% English , but i dont write it O_O

ok i understand it, good idea!

So true...

And btw, IMO is better, use just 1 variable.. as so..

if (variable == 0){
No event message
}else{
normal..

ooh. i see
well, if you use on or off
you can just simply change 1 word at the top of the script
else you will have to go into the script and edit stuff. i think this is way easier

Sorry for being a noob, but what does this do?

you can simply change activated to off or on in your npc script
if it is on, the npc will say regular text
if it is off, the npc will say he isnt activated and will close
 
Burn the land,
Loyal Member
Joined
Aug 7, 2008
Messages
1,903
Reaction score
17
you can simply change activated to off or on in your npc script
if it is on, the npc will say regular text
if it is off, the npc will say he isnt activated and will close

Thanks
 
The almighty chicken
Loyal Member
Joined
Apr 7, 2008
Messages
570
Reaction score
31
no problem.
i'll maybe update this later today with source changed
 
Master Summoner
Loyal Member
Joined
Jul 27, 2008
Messages
583
Reaction score
0
ooh. i see
well, if you use on or off
you can just simply change 1 word at the top of the script
else you will have to go into the script and edit stuff. i think this is way easier

Nah, you don't get my point..

i means, var variable = 0; for off, and 1 for on.. instead of changin on = 1/0; off = 1/0; activated = 0/1; or maybe i understand wrong :x
 
Experienced Elementalist
Joined
Jul 18, 2008
Messages
232
Reaction score
0
Erm... I really prefer having an event NPC that links to a command and then warps you there >_>
 
The almighty chicken
Loyal Member
Joined
Apr 7, 2008
Messages
570
Reaction score
31
Nah, you don't get my point..

i means, var variable = 0; for off, and 1 for on.. instead of changin on = 1/0; off = 1/0; activated = 0/1; or maybe i understand wrong :x

yea i know.
with my method people can write on or off.
there are people who don't know that on = 1 and off = 0.
i really think this is way more easy

Erm... I really prefer having an event NPC that links to a command and then warps you there >_>

lol? this is no npc i released..
it's a function to easily enable/disable a npc
 
Master Summoner
Loyal Member
Joined
Jul 27, 2008
Messages
583
Reaction score
0
ahhhhhhhhhh

My bad, i read it wrong.. yea, this is more friendly..
 
Experienced Elementalist
Joined
Jul 26, 2008
Messages
280
Reaction score
0
Ahh something decent at last. The release section has recently been a garbage dump.
 
The almighty chicken
Loyal Member
Joined
Apr 7, 2008
Messages
570
Reaction score
31
lol thanks
& agreed with that.
 
Master Summoner
Loyal Member
Joined
Apr 20, 2008
Messages
578
Reaction score
76
This is just common sense.

And you can use true/false instead of 1/0
 
Status
Not open for further replies.
Back
Top