Graal Forums  

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

 
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 06-06-2001, 09:08 PM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
Simple "Block and Button" puzzle.

For the block,
NPC Code:

if(playerenters){
canbepushed;
}
if(x=buttonx&&y=buttony){
//make sure to replace buttonx/y with the x and y the button is on
set puzzlecomplete;
x = startingx;
y = startingy;
//make sure startingx/y are the co-ordinates that the block
//started on
}



For the door, wall, etc.
NPC Code:

if(playertouchsme&&puzzlecomplete){
hidelocal;
dontblocklocal;
}



A simple block puzzle!
  #2  
Old 06-07-2001, 03:50 AM
Thak2 Thak2 is offline
:]
Join Date: Mar 2001
Location: BC
Posts: 1,344
Thak2 is on a distinguished road
Send a message via AIM to Thak2
Will that code work without a timeout?
  #3  
Old 06-07-2001, 04:23 AM
Cloud_X Cloud_X is offline
Cloud_X's Avatar
Join Date: Mar 2001
Posts: 2,921
Cloud_X will become famous soon enough
Quote:
Originally posted by Kaimetsu


Only if "playerpushesme" or whatever works on the NPC Server. But can we even push stuff on the NPC Server?
I believe, Try out the table in the admin house.
__________________
Temporary blocked
Stefan Knorr
  #4  
Old 06-07-2001, 04:57 AM
Guest
Posts: n/a
o.O
  #5  
Old 06-07-2001, 05:01 AM
TB3 TB3 is offline
Registered User
TB3's Avatar
Join Date: May 2001
Location: US of A State of VA
Posts: 658
TB3 is on a distinguished road
Send a message via Yahoo to TB3
ummmmm

Im pretty sure that that was scripted considering it has washit in it too but i doubt they would put it there if it was part of system lol.
By system i mean the canbepushed/pulled.
__________________

To the sun of your age, I arise
  #6  
Old 06-10-2001, 11:59 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
No pulling/pushing is not automatic on the
npcserver. There is
if (actionpulled)
and
if (actionpushed)
and the npc then must move itself and the player.
The script of the table:

NPC Code:

if (created) {
noplayeronwall;
setshape 1,6*16,11*16;
}
if (actionpulled || actionpushed || washit) {
if (washit)
i = playerdir;
else
i = strtofloat(#p(0));
newx = x + vecx(i)*0.5;
newy = y + vecy(i)*0.5;

if (!onwall2(newx,newy,6,11)) {
x = newx;
y = newy;
if (actionpulled) {
playerx += vecx(i)*0.5;
playery += vecy(i)*0.5;
}
}
}



It's not perfect, the player can pull himself into
a wall. But it is working perfectly on npcserver
and you can do your own special effects
like you can do a bowling ball which must be pushed
and then automatically moves
 


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 05:38 AM.


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