Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   logs (https://forums.graalonline.com/forums/showthread.php?t=49205)

Duwul 11-19-2003 04:25 AM

logs
 
Can somebody tell me ALL of the current log commands?

I know of these:

NPC Code:

savelog text;
savelog2 filename,text;



Thanks

ForgottenLegacy 11-19-2003 04:38 AM

That's all of them, besides
NPC Code:
sendrpgmessage message;


That's the command used on Graal Kingdoms for the RPG Message.

MrGannondorf 11-20-2003 01:49 AM

Can anyone make use of the rpg window?

ForgottenLegacy 11-20-2003 02:08 AM

Quote:

Originally posted by MrGannondorf
Can anyone make use of the rpg window?
Sure I can, easily. Here is a chat system, allthough basic. I submit it to the forums, anyone can use it.

NPC Code:

// NPC made by TGC
// NPC Weapon, weaponname: TGC Chat System.
if (actionserverside) {
for (a=0;a<allplayerscount;a++) {
with (allplayers[a]) {
if (strequals(#s(client.chatsystem),on)) sendrpgmessage #p(0);
}
}
}
//#CLIENTSIDE
if (weaponfired) {
if (strlen(#s(client.chatsystem))==0) setstring client.chatsystem,off;
if (strequals(#s(client.chatsystem),off)) {
setstring client.chatsystem,on;
setplayerprop #c,Chat Enabled, say /chat <message> to send a message;
} else {
setstring client.chatsystem,off;
setplayerprop #c,Chat disabled;
}
}
if (playerchats) {
tokenize #c;
if (strequals(#s(client.chatsystem),on)) {
if (strequals(#t(0),/chat)) {
triggeraction 0,0,serverside,TGC Chat System,"#n: #e(6,-1,#c)";
setplayerprop #c,Message Sent;
}
}
}


Fire the weapon to enable/disable it. Say "/chat <message>" to send a message. Press F2 to view the RPG Window. :-)

MrGannondorf 11-20-2003 02:12 AM

ah, intresting.

say, is there a flag for when an rc logs on to the server?

DustyPorViva 11-20-2003 02:12 AM

Quote:

Originally posted by MrGannondorf
Can anyone make use of the rpg window?
I think it would be best used for sending longer messages.
Such as paragraphs, info, help, stories.

ForgottenLegacy 11-20-2003 02:26 AM

Quote:

Originally posted by MrGannondorf
say, is there a flag for when an rc logs on to the server?
Nope, least not in the current engine. Possobly in the new engine. I check in a timeout loop to see how many rcs are on and who they are. If a new one comes on, then a message is sent to the new RC, greeting it.

MrGannondorf 11-21-2003 06:31 AM

Intresting. How did you check to see if it was an rc?

ForgottenLegacy 11-21-2003 07:38 AM

Check if the strlen of the level, #F, is 0.

if (strlen(#F)==0)

Lance 11-21-2003 07:50 AM

Quote:

Originally posted by ForgottenLegacy
Check if the strlen of the level, #F, is 0.

if (strlen(#F)==0)

Note for Lunpa - #F is valid only within a with() statement.

MrGannondorf 11-21-2003 08:00 AM

Awsome! Thanks alot, guys :D

Kaimetsu 11-21-2003 08:45 AM

Quote:

Originally posted by Lance
Note for Lunpa - #F is valid only within a with() statement.
You're sure? I thought the only prerequisite was that an active player is set.

Lance 11-21-2003 09:21 AM

Quote:

Originally posted by Kaimetsu


You're sure? I thought the only prerequisite was that an active player is set.

I wasn't specific enough; I'm at fault.

Revised statement: An active player has to be set within a with() statement for #F to be valid. :)

Kaimetsu 11-21-2003 09:32 AM

Of course, there are other ways for active players to be set :-p

Lance 11-21-2003 09:47 AM

Quote:

Originally posted by Kaimetsu
Of course, there are other ways for active players to be set :-p
List some...? :)

Kaimetsu 11-21-2003 10:10 AM

Well, my message was kinda misleading. I mean that there are other circumstances in which an active player is set, such as when a player-specific event has occured. Otherwise we'd all be fumbling with ProjectShifter-esque 'with(#a)'s ;)

Lance 11-21-2003 10:25 AM

Quote:

Originally posted by Kaimetsu
Well, my message was kinda misleading. I mean that there are other circumstances in which an active player is set, such as when a player-specific event has occured. Otherwise we'd all be fumbling with ProjectShifter-esque 'with(#a)'s ;)
Ah, I understand what you mean. ^_^

(Gasp! I was indeed suffering from a misconception. I blame the original explanation of #F I was fed. The way it works makes sense, though; I should have picked up on it earlier. o.O)

MrGannondorf 11-26-2003 02:03 AM

I got it somewhat working. This...
NPC Code:

if (actionplayeronline) {
//stuff
for(i=0; i<allplayerscount; i++) {
with(allplayers[i]) if (strlen(#F)=0) setplayerprop #3,head122.png;
}
//more stuff
}


...is what I have so far. Works nice, with the exeption that RCs don't seem to trigger actionplayeronline... so it ends up that the rc will have the default head when the log on untill a player logs on. Any ideas?

I was thinking of having it check for when the rc chat says "New RC: blah blah blah", but I've been having trouble getting the (rcchat) flag to work.

Riot 11-26-2003 02:29 AM

Quote:

Originally posted by MrGannondorf
I got it somewhat working. This...
NPC Code:

if (actionplayeronline) {
//stuff
for(i=0; i<allplayerscount; i++) {
with(allplayers[i]) if (strlen(#F)=0) setplayerprop #3,head122.png;
}
//more stuff
}


...is what I have so far. Works nice, with the exeption that RCs don't seem to trigger actionplayeronline... so it ends up that the rc will have the default head when the log on untill a player logs on. Any ideas?

I was thinking of having it check for when the rc chat says "New RC: blah blah blah", but I've been having trouble getting the (rcchat) flag to work.

I do believe that if (rcchat) only calls when /npc is used.

Lance 11-26-2003 03:24 AM

Quote:

Originally posted by MrGannondorf
I got it somewhat working. This...
NPC Code:

if (actionplayeronline) {
//stuff
for(i=0; i<allplayerscount; i++) {
with(allplayers[i]) if (strlen(#F)=0) setplayerprop #3,head122.png;
}
//more stuff
}



Ugh! Unnecessarily laggy, improper way to compare values, and bad formatting.

Quote:

...is what I have so far. Works nice, with the exeption that RCs don't seem to trigger actionplayeronline... so it ends up that the rc will have the default head when the log on untill a player logs on. Any ideas?
Keep a list of currently logged in RCs. Loop through every so often and update the list. If there are new RCs, set their head using allplayers.

Quote:

I was thinking of having it check for when the rc chat says "New RC: blah blah blah", but I've been having trouble getting the (rcchat) flag to work.
Riot is correct about rcchat - it only works when you type /npc(command name).

MrGannondorf 11-26-2003 07:41 AM

Quote:

Ugh! Unnecessarily laggy, improper way to compare values, and bad formatting.
o.o free critique! :D


Isn't there a better way then looping through every so often?

Lance 11-26-2003 07:43 AM

Quote:

Originally posted by MrGannondorf

Isn't there a better way then looping through every so often?

Currently, no. There've been quite a few requests for actionrconline, as it'd be really nifty. Of course, like all really nifty suggestions, it's got its disadvantages too: It could easily be exploited to do malicious things. It'd probably go through, though.

GoZelda 11-26-2003 06:12 PM

Quote:

Originally posted by ForgottenLegacy


Sure I can, easily. Here is a chat system, allthough basic. I submit it to the forums, anyone can use it.

Fire the weapon to enable/disable it. Say "/chat <message>" to send a message. Press F2 to view the RPG Window. :-)

Whoever uses this is stupid - you have to close, reopen, close, reopen RPG window all the time if you want to be up-to-date with the chat :|

Lance 11-26-2003 10:00 PM

Quote:

Originally posted by GoZelda

Whoever uses this is stupid - you have to close, reopen, close, reopen RPG window all the time if you want to be up-to-date with the chat :|

...Or you could just leave the RPG Window open?

ForgottenLegacy 11-26-2003 10:09 PM

Quote:

Originally posted by Lance
it's got its disadvantages too: It could easily be exploited to do malicious things. It'd probably go through, though.
actionplayeronline has the same disadvantages, if not more, and it got through.

MrGannondorf 11-26-2003 10:32 PM

Quote:

Originally posted by GoZelda

Whoever uses this is stupid - you have to close, reopen, close, reopen RPG window all the time if you want to be up-to-date with the chat :|

:) then don't use it for chat. I just use it for semi-important things, such as to help test a script (if it doesn't say something, then I know where it went wrong)...

if you use it for something like 2k2 does, I supose you could also do what they do, and inform the player when something is updated.

Lance 11-26-2003 11:16 PM

Quote:

Originally posted by ForgottenLegacy


actionplayeronline has the same disadvantages, if not more, and it got through.

No (to the 'if not more')? Example: exploits used to crash a player on login are obviously less bad than exploits used to crash an RC on login.


All times are GMT +2. The time now is 04:51 PM.

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