Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-06-2004, 10:23 AM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
attachplayertoobj and setshape2?

I tried to make a Bridge but it wont work right.
I tried some things:
NPC Code:

attachplayertoobj 0,id;
attachplayertoobj 0,npcid;
attachplayertoobj 0,npcsid;
...



But setshape2 wont works right
i can walk above the whole bridge :/
the blocking tiles dont works.

NPC Code:
if(created){
setimg testbridge01.png; //IMG Datei der Brücke
setstring client.at,0;
detachplayer;
message #v(id),#v(npcid),#v(npcs.[id]),#v(npc.id);
}
if(playertouchsme&&strtofloat(#s(client.at))==0){
if(strequals(#m,swim)){
setshape2 14,9,{
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
22,22,22,22,22,22,22,22,22,22,22,22,22,22
};
}
else{
setshape2 14,9,{
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
22,22,22,22,22,22,22,22,22,22,22,22,22,22
};
attachplayertoobj 0,1;
setstring client.at,1;
setshape2 14,9,{
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
22,22,22,22,22,22,22,22,22,22,22,22,22,22
};
}
}


Last edited by projectigi; 06-06-2004 at 10:57 AM..
Reply With Quote
  #2  
Old 06-07-2004, 12:00 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
Ok now i dunno why but i changed the script a bit.
I included a timeout and taken a other thign for checking if the player swims.
Now it keeps warping me in the top left corner of the level when i wlak on the bridge. WHY?
NPC Code:

//#CLIENTSIDE
if(created||timeout){
if(playerswimming){
drawoverplayer;
setshape2 14,9,{
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22,
22,11,11,11,11,11,11,11,11,11,11,11,11,22
};
}
else{
drawunderplayer;
setshape2 14,9,{
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
22,22,22,22,22,22,22,22,22,22,22,22,22,22,
22,22,22,22,22,22,22,22,22,22,22,22,22,22
};
}
if(playerx in |x,x+10|&&playery in |y-1,y+9|){
attachplayertoobj 0,id;
}
else{
detachplayer;
}
timeout=.05;
}

Reply With Quote
  #3  
Old 06-07-2004, 05:04 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
You don't really need that timeout.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #4  
Old 06-07-2004, 06:38 PM
projectigi projectigi is offline
Registered User
Join Date: Jan 2004
Posts: 403
projectigi is an unknown quantity at this point
I triggered it to serverside and now it works lol
Reply With Quote
  #5  
Old 06-07-2004, 08:37 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Though it's good you found the solution, it ofcourse is better if you find the solution before you post
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:53 AM.


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