Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Will this work online (https://forums.graalonline.com/forums/showthread.php?t=13598)

Metal-Slug 10-02-2001 08:18 AM

Will this work online
 
will this work on a pw with no npc server?
NPC Code:

// NPC made by unknown
// Hirathia Door Script
// Urond's Tavern
if (created) {
setimg newdoor.gif;
this.Door1 = 1;
}
if (playerchats && strequals(#a,Metal-Slug) && startswith(Door, #c)) {
setstring Doormessage1,#c;
message #s(Doormessage1);
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Closed)) {
this.Door1 = 1;
}
if (this.Door1 = 1 && playertouchsme) {
say2 Sorry
#bThis door is locked;
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Opened)) {
this.Door1 = 0;
}
if (this.Door1 = 0 && playertouchsme) {
setlevel2 metal-slugbar.nw,30.5,57;
}


i know it works off line, but im not sure if the this.Door1 stuff is online stuff

entravial 10-02-2001 08:36 AM

~AlphaFlame~

Use server. strings instead of this. variables.

Poogle 10-02-2001 08:38 AM

Re: Will this work online
 
Quote:

Originally posted by Metal-Slug
will this work on a pw with no npc server?
NPC Code:

// NPC made by unknown
// Hirathia Door Script
// Urond's Tavern
if (created) {
setimg newdoor.gif;
this.Door1 = 1;
}
if (playerchats && strequals(#a,Metal-Slug) && startswith(Door, #c)) {
setstring Doormessage1,#c;
message #s(Doormessage1);
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Closed)) {
this.Door1 = 1;
}
if (this.Door1 = 1 && playertouchsme) {
say2 Sorry
#bThis door is locked;
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Opened)) {
this.Door1 = 0;
}
if (this.Door1 = 0 && playertouchsme) {
setlevel2 metal-slugbar.nw,30.5,57;
}


i know it works off line, but im not sure if the this.Door1 stuff is online stuff

Wont work offline too! (Door, #c)) is the error it backwards!

Vinvect 10-02-2001 08:40 AM

lol

entravial 10-02-2001 08:43 AM

~AlphaFlame~

Quote:

Wont work offline too! (Door, #c)) is the error it backwards!
Actually, sir, it's correct. Starts with format is

startswith(start,string)

Poogle... you, too, can go read commands.rtf and come back when you learn to script.

Vinvect 10-02-2001 08:44 AM

MMMmmmMMmmMm............
Mutated Brocli Monster Hungry!
*drools*
*drools even more*
*drools to the floor*
.....
.........
........
....
.......
a guy says: AHHHHHHHHH!
Because
Mutated Brocli Monster Ate Him!
YUmmmm.....!

:spam:
(read my sig)

Metal-Slug 10-02-2001 08:49 AM

Quote:

Originally posted by entravial
~AlphaFlame~



Actually, sir, it's correct. Starts with format is

startswith(start,string)

Poogle... you, too, can go read commands.rtf and come back when you learn to script.

i knew that too, i just choose to ignore stupidity and arogance mixed now, also, why does playerhearts = +2; make the player have to full hearts? ven if they had 3?

entravial 10-02-2001 08:52 AM

~AlphaFlame~

You have the + in the wrong place. Put it in front of the =.

playerhearts += 2;

Metal-Slug 10-02-2001 08:59 AM

thanks

Vinvect 10-02-2001 09:09 AM

Re: Will this work online
 
Quote:

Originally posted by Metal-Slug
will this work on a pw with no npc server?
NPC Code:

// NPC made by unknown
// Hirathia Door Script
// Urond's Tavern
if (created) {
setimg newdoor.gif;
this.Door1 = 1;
}
if (playerchats && strequals(#a,Metal-Slug) && startswith(Door, #c)) {
setstring Doormessage1,#c;
message #s(Doormessage1);
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Closed)) {
this.Door1 = 1;
}
if (this.Door1 = 1 && playertouchsme) {
say2 Sorry
#bThis door is locked;
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Opened)) {
this.Door1 = 0;
}
if (this.Door1 = 0 && playertouchsme) {
setlevel2 metal-slugbar.nw,30.5,57;
}


i know it works off line, but im not sure if the this.Door1 stuff is online stuff

can i use in my server plz?

entravial 10-02-2001 09:11 AM

~AlphaFlame~

Why not script your own that's better than that? :-P

Vinvect 10-02-2001 09:16 AM

:mad: :grrr:

nyghtGT 10-02-2001 04:38 PM

Re: Re: Will this work online
 
Quote:

Originally posted by Poogle
Wont work offline too! (Door, #c)) is the error it backwards!
when you use 'startswith' the format is:
startswith(content,str)

nyghtGT 10-02-2001 04:39 PM

Re: Re: Will this work online
 
Quote:

Originally posted by Vinvect

can i use in my server plz?

no offense but that script is not exactly that hard....

Bravo_Admin1 10-02-2001 04:51 PM

Re: Will this work online
 
Quote:

Originally posted by Metal-Slug
will this work on a pw with no npc server?
NPC Code:

// NPC made by unknown
// Hirathia Door Script
// Urond's Tavern
if (created) {
setimg newdoor.gif;
this.Door1 = 1;
}
if (playerchats && strequals(#a,Metal-Slug) && startswith(Door, #c)) {
setstring Doormessage1,#c;
message #s(Doormessage1);
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Closed)) {
this.Door1 = 1;
}
if (this.Door1 = 1 && playertouchsme) {
say2 Sorry
#bThis door is locked;
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Opened)) {
this.Door1 = 0;
}
if (this.Door1 = 0 && playertouchsme) {
setlevel2 metal-slugbar.nw,30.5,57;
}


i know it works off line, but im not sure if the this.Door1 stuff is online stuff

u could always use

if (playerenters) {hide;}

that usualy works 4 me :)

nyghtGT 10-02-2001 05:28 PM

Re: Re: Will this work online
 
Quote:

Originally posted by Bravo_Admin1


u could always use

if (playerenters) {hide;}

that usualy works 4 me :)

stop spamming cause you only have 12 posts !!!

btedji 10-02-2001 07:13 PM

Re: Will this work online
 
try this

NPC Code:

// NPC made by unknown
// Hirathia Door Script
// Urond's Tavern
if (created) {
setimg newdoor.gif;
this.Door1 = 1;
}
if (playerchats && strequals(#a,Metal-Slug) && startswith(#c,Door)) {
message #c;
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Closed)) {
this.Door1 = 1;
}
if (this.Door1 = 1 && playertouchsme) {
say2 Sorry
#bThis door is locked;
}
if (playerchats && strequals(#a,Metal-Slug) && strequals(#c,Door Opened)) {
this.Door1 = 0;
}
if (this.Door1 = 0 && playertouchsme) {
setlevel2 metal-slugbar.nw,30.5,57;
}



this seems like it should work

nyghtGT 10-03-2001 02:51 AM

Quote:

Originally posted by Kaimetsu
Hmm... Should be able to use save[] variables. Dunno exactly how they work without an NPC Server, though.
save works online (p2p and non) but they dont work offline but if you have a server.string set to make an NPC do a function to set them back then it will work...
Well it did on Delteria ....

btedji 10-03-2001 02:53 AM

Quote:

Originally posted by Kaimetsu
Hmm... Should be able to use save[] variables. Dunno exactly how they work without an NPC Server, though.
can you give me some tips on how to use save[] variables?

nyghtGT 10-03-2001 02:57 AM

uhh
 
Quote:

Originally posted by btedji


can you give me some tips on how to use save[] variables?

i think they work like this .....
if (playerchats && startswith(notes:)) {
save[1]=#c;
}
if (playersays(view notes)) {
setplayerprop #c,save[1];
}
I think this is how they may work ... but i am pretty much just spamming so ....

btedji 10-03-2001 02:59 AM

they hold strings and vars but dont need to be put in players flag list, i see, simple enough

Metal-Slug 10-03-2001 04:38 AM

vinvect, if if ind this scrip on your server i will hit you

Poogle 10-03-2001 04:49 AM

Quote:

Originally posted by entravial
~AlphaFlame~



Actually, sir, it's correct. Starts with format is

startswith(start,string)

Poogle... you, too, can go read commands.rtf and come back when you learn to script.

=/ I use it #c,HOLY COW all the time and it works =\

btedji 10-03-2001 04:54 AM

im pretty sure on all those type of things it doesnt matter the order

Metal-Slug 10-03-2001 06:15 AM

well i want to send the info to every one, so i would change it to server.Door1?

Metal-Slug 10-03-2001 08:22 AM

so, how would i set it up? if i want to send the "flag (i dunno)" to every one on the server, and its non p2p, or hel;p me along like you did with the #v stuff.

btedji 10-03-2001 07:17 PM

save[] variables are like global variables i think

btedji 10-04-2001 03:09 AM

Quote:

Originally posted by Kaimetsu


A save var is just like the variables "ap" or "rupees". You can set it and then people can read it.

And no, they're not global.

ahhhhhh, i see

Metal-Slug 10-04-2001 05:35 AM

Quote:

Originally posted by Kaimetsu


A save var is just like the variables "ap" or "rupees". You can set it and then people can read it.

And no, they're not global.

splain more please? also, i want it to be global, so i need server.whatever or this.whatever

btedji 10-04-2001 06:29 AM

Quote:

Originally posted by Metal-Slug


splain more please? also, i want it to be global, so i need server.whatever or this.whatever

server.strings are global

Metal-Slug 10-04-2001 06:58 AM

ok... so i use server.Door = 1?

btedji 10-04-2001 07:00 AM

Quote:

Originally posted by Metal-Slug
ok... so i use server.Door = 1?
why wont this.vars work?

Metal-Slug 10-04-2001 07:02 AM

Quote:

Originally posted by btedji


why wont this.vars work?

cause i wanna use it online

btedji 10-04-2001 07:04 AM

Quote:

Originally posted by Metal-Slug

cause i wanna use it online

it should work online

btedji 10-04-2001 07:12 PM

Quote:

Originally posted by Kaimetsu


YOU DON'T NEED IT TO BE GLOBAL.



Nope. this.vars are stored only on the computer of the client who runs the script.

oh i see, i thought it was the same for everyone who used that npc

Metal-Slug 10-05-2001 05:39 AM

Quote:

Originally posted by Kaimetsu


YOU DON'T NEED IT TO BE GLOBAL.



Nope. this.vars are stored only on the computer of the client who runs the script.


ok, then what do i use?


All times are GMT +2. The time now is 04:11 AM.

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