Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   For all of you people who need Kingdom Gates (https://forums.graalonline.com/forums/showthread.php?t=20278)

Kumada 01-03-2002 09:25 PM

For all of you people who need Kingdom Gates
 
Here...
Remeber these are 2 seperate npcs.. one is the gate and one can be a block so if the player touchs it and the gate is open then they can get warped.. (usually under the gate like the bricks at dustari)
NPC Code:

//Gate NPC
if (created){
setimg gate.png;
show;
}

if (playerchats&&strequals(#g,myguild)){
if (strequals(#c,open gate)&&!strequals(#s(this.gate),open)){
move 0,-2,2,0;
setstring this.gate,open;
}
}

if (playerchats&&strequals(#g,myguild)){
if (strequals(#c,open gate)&&strequals(#s(this.gate),open)){
move 0,2,2,0;
setstring this.gate,closed;
}
}



This is the npc that you use so players cannot lag thru.. just put some tiles under it like yellow blocks.

NPC Code:

//Block NPC
if (created){
setimg block.png;
show;
}

//Entering
if (playertouchsme&&playerdir == 2){
if (strequals(#s(this.gate),open)){
playerx=<The x coords after gate>;
playery=<The y coords after gate>;
}
}

//Leaving
if (playertouchsme&&playerdir == 0){
playerx=<The x coords before gate>;
playery=<The y coords before gate>;
}

//Guild Members Entering
if (playertouchsme&&playerdir == 2){
if (strequals(#g,myguild)){
playerx=<The x coords after gate>;
playery=<The y coords after gate>;
}
}


Loriel 01-03-2002 10:44 PM

That could be made much more effective.

Kumada 01-03-2002 11:05 PM

Quote:

Originally posted by Loriel
That could be made much more effective.
Please dont make fun of my leet scripting skillz.

ShockwaveISTHEBEST 01-04-2002 02:08 AM

Exactly what I needed.

Python523 01-04-2002 03:23 AM

Wouldn't you run into a problem with people who aren't in the level at the time of the closing and opening, you should probably use a server.string

zell12 01-04-2002 06:32 AM

Exactly ;)

ShockwaveISTHEBEST 01-04-2002 06:43 AM

Cant you just use timereverywhere

Falcor 01-04-2002 07:01 AM

Timereeverywhere is obsolete on a P2P server, since if its not defined client side it is already global. therefor timers effect everyone. But acuallt. timers dont effect everyone, just the server. Becasue the server sends data to you.

You forgot the attach and setshape2.got other errrors but if this was a first attempt, i wouldnt blame you.

Falcor 01-04-2002 07:03 AM

If this is non ppp2p- you really can even used setshpae 2 so its impossible to make a bridge.

ShockwaveISTHEBEST 01-04-2002 07:03 AM

So how would I put a server.string into that

TDO2000 01-04-2002 07:06 AM

Quote:

Originally posted by Python523
Wouldn't you run into a problem with people who aren't in the level at the time of the closing and opening, you should probably use a server.string
omg y does everyone want to use serverstrings?
save-vars can be used in this part much better and do not lagg the server...

nyghtGT 01-04-2002 10:36 PM

Quote:

Originally posted by Python523
Wouldn't you run into a problem with people who aren't in the level at the time of the closing and opening, you should probably use a server.string
well the this.string saves it to the NPC itself so i see no problem with people not in the levels ....

Saga2001 01-05-2002 05:16 AM

Quote:

Originally posted by Loriel
That could be made much more effective.
i agree

Saga2001 01-05-2002 05:37 AM

hmmmmmm....
 
i was gonna suggest save[] vars too, they be nice...


All times are GMT +2. The time now is 10:03 PM.

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