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 04-10-2006, 04:03 PM
Omini Omini is offline
Millenium Owner
Join Date: Feb 2006
Location: N.Ireland
Posts: 293
Omini is on a distinguished road
Send a message via AIM to Omini Send a message via MSN to Omini Send a message via Yahoo to Omini
An easier method for the setshape bit would be

NPC Code:

setshape 1,16*x,16*y;



Replace the x with the amount of Graal tiles horizontal and the y with the amount of Graal tiles vertical, this stops you having to calculate the amount of pixels since each Graal tile is 16x16 pixels.
Reply With Quote
  #2  
Old 04-11-2006, 05:41 PM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Quote:
Originally Posted by Omini
An easier method for the setshape bit would be
Hadnt really thought of doing that for some reason. Sounds like that could be a good plan but make sure that the x or y is greater then one tile otherwise you might have trouble grabbing the npc in the level editor again :P

Quote:
Kind of. but you can't fight befor you say start and it doesn't add to your deaths.
all you put in an npc to make it a "sparringzone" is just that
NPC Code:

sparringzone



It appears its still picky in editor what you have there, and Ive always done it that way online also.

And you want it not to start before you say fight? Now you are getting into bigger scripts, you wanna check where the players are at, and have their weapons disabled first!

NPC Code:

if (playerenters) {
disableweapons;
}



Next we need to expand the playerchats block to make sure only people inside the spar zone can say "start" and then anyone in the block, enable their weapons.

NPC Code:

if (playerx in |21,42| && playery in |25,40|) {
...
}


NPC Code:

for (i=0;i<playerscount;i++) {
if (playerx in |21,42| && playery in |25,40|) {
enableweapons;
}
}



All its doing is checking the |start,end| and seeing if your x and y are in those numbers, if you are in the sparring zone, you should be in them. Otherwise you cant start the spar, or get your weapons enabled.

Of course youll need to combine this with everything else, to make a complete script, go ahead and check the level. The healer is in there too.

Hope you are learning something
Attached Files
File Type: nw hnd-fire-spar.nw (10.8 KB, 132 views)
Reply With Quote
  #3  
Old 04-12-2006, 12:09 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
i just have to say how wonderful it is to see people actually helping new players learn things. Has Lance been removed as a moderator? Or have the scripting forums rules changed? Keep up the good work, its great to see the open sharing of basic code principles come back to this part of the forums again.
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 09:00 AM.


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