Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   How does this NPC work please? (https://forums.graalonline.com/forums/showthread.php?t=37231)

Glory 09-03-2002 08:57 AM

How does this NPC work please?
 
if (created)
{ for (i=0;i<allplayerscount;i++)
{ if (strequals(#F,))
{ if (strequals(#a,accname))
{ setplayerprop #3,headname;}
}
}
}

Python523 09-03-2002 09:17 AM

Re: How does this NPC work please?
 
Quote:

Originally posted by Glory
if (created)
{ for (i=0;i<allplayerscount;i++)
{ if (strequals(#F,))
{ if (strequals(#a,accname))
{ setplayerprop #3,headname;}
}
}
}

that wouldnt work at all
NPC Code:

if(created){
for(i=0;i<allplayerscount;i++){
with(allplayers[i]){
if(strlen(#F)==0){
if(strequals(#a,accname)){
setplayerprop #3,head;
}
}
}
}
}


Glory 09-03-2002 09:18 AM

Oh ok thanks...well it was suppose to change the RC head, I got it off a friend but I r super confused.

Com013 09-03-2002 11:25 PM

Re: How does this NPC work please?
 
Quote:

Originally posted by Glory
if (created)
{ for (i=0;i<allplayerscount;i++)
{ if (strequals(#F,))
{ if (strequals(#a,accname))
{ setplayerprop #3,headname;}
}
}
}

But...that would set the heads of all the RCs when the script was created! You'd have to use actionplayeronline or so in the Control NPC.

Something like this:
NPC Code:

if (actionplayeronline) {
if (strequals(#F,)) setplayerprop #3,headname;
}


Spark910 09-04-2002 03:13 AM

Is #F equal to the RC?

Python523 09-04-2002 04:43 AM

Quote:

Originally posted by Spark910
Is #F equal to the RC?
#F is the level of the player / npc when using with statements

G_yoshi 09-04-2002 04:45 AM

Quote:

Originally posted by Python523

#F is the level of the player / npc when using with statements

I thought #L was the level?

emortylone 09-04-2002 04:46 AM

Argit. #L is the NPC's level, #F is the PLAYER's level... and the coding is VERY unorganized and hard to read =/
---Shifter

Python523 09-04-2002 04:47 AM

Quote:

Originally posted by G_yoshi


I thought #L was the level?

if I did on an npc that was in the level stuff.nw and G_yoshi is in dkstuff.nw
with(getplayer(G_yoshi)){
setstring client.level,#L;
}
client.level = stuff.nw
inside a with statement, #F is the npc of what you got in the with statement, #L would be the NPC you used to send the with statement

emortylone 09-04-2002 04:48 AM

Did I not already explain it?? x.X
---Shifter

Python523 09-04-2002 04:49 AM

your post was posted less than a minute before mine and it took me a little more than a minute to type mine

emortylone 09-04-2002 04:51 AM

LOl, all mine take less than a minute, lolz. You didn't need to go into detail anyway... if you put if (strequals(#F,)) it means RC;
---Shifter

Python523 09-04-2002 04:57 AM

Quote:

Originally posted by emortylone
LOl, all mine take less than a minute, lolz. You didn't need to go into detail anyway... if you put if (strequals(#F,)) it means RC;
---Shifter

strlen(#F)==0 would work the same but both have there faults, I dont feel like testing this theory right now but it could work and it couldnt work

set the file cofig to
level <bunch of spaces here>
then create a level, go into DOS, and rename to level so it has no name (basically "" without the "s) then upload it, theoretically you could warp to the level since graal will still read the NW header (GLEVNW01) or whatever .graal uses to make it .graal and you are now in a level that has a length of 0 and that it equals nothing (null)

Falcor 09-04-2002 05:28 AM

Quote:

Originally posted by Python523

strlen(#F)==0 would work the same but both have there faults, I dont feel like testing this theory right now but it could work and it couldnt work

set the file cofig to
level <bunch of spaces here>
then create a level, go into DOS, and rename to level so it has no name (basically "" without the "s) then upload it, theoretically you could warp to the level since graal will still read the NW header (GLEVNW01) or whatever .graal uses to make it .graal and you are now in a level that has a length of 0 and that it equals nothing (null)

I'm not sure you can warp to nothing, I think you indeed have to be on a level with a name atleast 1 character.

Python523 09-04-2002 06:16 AM

Quote:

Originally posted by Falcor


I'm not sure you can warp to nothing, I think you indeed have to be on a level with a name atleast 1 character.

I think so to but I was mearly suggesting that there is no 'correct' way to find out if something really IS an RC if you could go to nothing, unless you set a flag or a string when actionplayeronline in the CNPC, since I dont think RCs load attributes


All times are GMT +2. The time now is 08:15 PM.

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