Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-13-2003, 09:28 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Question Bridge

I have only little experience with the commands which were previously p2p only, and so I have got problems making a bridge.

Here is my current script (yes, I know it is not looking nice):

NPC Code:

// Script made by Com013
if (created) {
setarray btiles,14*9;

for (i=0; i<9; i++)
for (j=0; j<14; j++) {
if (i<2 || i>=7)
btiles[i*14+j] = 22;
else
btiles[i*14+j] = 0;
}

setshape2 14,9,btiles;
setarray btiles,0;

drawoverplayer;
dontblock;
}
//#CLIENTSIDE
if (playerenters || timeout) {
if (playerattached) {
if (playerdir==1 && playerx<=x-0.5 ||
playerdir==3 && playerx>=x+11.5)
detachplayer;
} else if (playery in |y+1,y+4|) {
if (playerdir==3 && playerx==x-2.5 ||
playerdir==1 && playerx==x+13.5)
attachplayertoobj 0,npcs[0].id;
}

timereverywhere;
timeout = 0.05;
}



I haven't tested this yet on the NPC Server, so I am not sure whether the attachplayertoobj can be clientside.

The script is working fine, but when you are leaving the bridge, the player is suddenly under it. I have no clue how to improve it except by adding transparent parts at the sides of the bridge.
Attached Files
File Type: zip bridgetest.zip (1.7 KB, 163 views)
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #2  
Old 01-14-2003, 05:55 AM
Googi Googi is offline
A Serious Epidemic
Googi's Avatar
Join Date: Oct 2001
Location: Canada
Posts: 18,866
Googi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud ofGoogi has much to be proud of
Send a message via AIM to Googi
Why not just use move?
__________________
Reply With Quote
  #3  
Old 01-14-2003, 03:43 PM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
I haven't downloaded it yet but couldn't you just widden the setshape to another 2-3 tiles on each side so it doesn't appear to draw over the player?

edit: Oh I see, Just change your x dectection to be 2-3 tiles wider....
__________________
new account: Trevor
Reply With Quote
  #4  
Old 01-14-2003, 06:48 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by tlf288
I haven't downloaded it yet but couldn't you just widden the setshape to another 2-3 tiles on each side so it doesn't appear to draw over the player?
Yes, that was my first idea, but I can only do so for the right / bottom side of it. The left / top side cannot be extended using setshape. I guess I have got to use ganis for it.

Quote:
edit: Oh I see, Just change your x dectection to be 2-3 tiles wider....
No, that doesn't work, because the player cannot walk out of the shape. (To see it you can simply turn the detach command into a comment).
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #5  
Old 01-15-2003, 03:29 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Here you are:

NPC Code:

// Script made by Com013
// fixed by: Trevor

if (created) {
setarray btiles,14*9;

for (i=0; i<9; i++)
for (j=0; j<14; j++) {
if (i<2 || i>=7)
btiles[i*14+j] = 22;
else
btiles[i*14+j] = 0;
}

setshape2 14,9,btiles;
setarray btiles,0;

dontblock;
}
//#CLIENTSIDE
if (playerenters || timeout) {
message #v(npcs[0].id) - #v(playerattachid) - #v(playerattached || false) - (#v(levelorgx) - #v(levelorgy));

if(playerdir==0||playerdir==2){
drawoverplayer;
}

if (playerattached) {
if (playerdir==1 && playerx<=x-0.5 ||
playerdir==3 && playerx>=x+11.5){
drawunderplayer;
detachplayer;
}
} else if (playery in |y+1,y+4|) {
if (playerdir==3 && playerx==x-2.5 ||
playerdir==1 && playerx==x+13.5){
attachplayertoobj 0,npcs[0].id;
}
}

timereverywhere;
timeout = 0.05;
}



I tried everything then I was like "OMG!, this is so simple."

You can see what I did
__________________
new account: Trevor
Reply With Quote
  #6  
Old 01-15-2003, 03:59 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
*smacks self*

I should of cought that...

I guess thats why your the Script Monkey and I'm only a cimpanzee :P
__________________
new account: Trevor
Reply With Quote
  #7  
Old 01-15-2003, 10:09 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by tlf288
*smacks self*

I should of cought that...

I guess thats why your the Script Monkey and I'm only a cimpanzee :P
Cupchino Monkey
__________________
Reply With Quote
  #8  
Old 01-15-2003, 10:34 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by tlf288
Here you are:

NPC Code:

// Script made by Com013
// fixed by: Trevor
...
if(playerdir==0||playerdir==2){
drawoverplayer;
}
...
drawunderplayer;



I tried everything then I was like "OMG!, this is so simple."

You can see what I did
Sorry, but drawover/underplayer won't work here, because then you would see yourself correctly under the bridge, while other players would see you over it. (Or other conflicts happen).

No, I guess I'll use the gani way instead.

Kaimetsu, why is setshape2 not working serverside?
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #9  
Old 01-16-2003, 01:48 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Quote:
Originally posted by Com013


Sorry, but drawover/underplayer won't work here, because then you would see yourself correctly under the bridge, while other players would see you over it. (Or other conflicts happen).
I see...

Just look at the bridge on Avalon. It works as far as I know.
__________________
new account: Trevor
Reply With Quote
  #10  
Old 01-16-2003, 02:49 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Kaimetsu

So I'll answer both.
Please excuse my bad english...yes, I actually wanted to hear both.

Quote:
Originally posted by tlf288

Just look at the bridge on Avalon. It works as far as I know.
Exactly that is the reason why I was posting this: I am redoing them, because they are NOT working correctly.
However, they are too near to the level border, so there are problems. I will just remove the avalon bridges and put stairs there.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #11  
Old 01-16-2003, 03:12 PM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Quote:
Originally posted by Com013

However, they are too near to the level border, so there are problems.
Yes, level borders do seem to mess alot of things up when npcs are crossing over them.

Quote:

I will just remove the avalon bridges and put stairs there.
Only do that temporary. Working around the problem ussually isn't that good. Try to fix and if worse comes to worse ask Kai to try to fix it.
__________________
new account: Trevor
Reply With Quote
  #12  
Old 01-16-2003, 05:15 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
com, maybe you should try making classic a flat gmap, it would solve level border problems
Reply With Quote
  #13  
Old 01-16-2003, 11:47 PM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by Kaimetsu

1) Nope, not last time I checked. I asked Stefan about it but I think he's planning to do some thing where the server sends its shape information to the client, and that'd need a new client release, so it'll probably have to wait.
I don't want to wait...
__________________
Reply With Quote
  #14  
Old 01-18-2003, 09:57 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Quote:
Originally posted by Python523
com, maybe you should try making classic a flat gmap, it would solve level border problems
Already did so (on Classic Developement).
I think the problem is still happening.
__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:29 PM.


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