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 08-27-2005, 03:47 AM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Using a NPC to move tiles: Help!

I'm making a jousting arena, but the ET member who controls it sits in a seat INSIDE the arena, making him vunerable to attacks. I want to do two things:

I want, when the ET member says something like begin judging that a tile hides for 3 seconds, then the ET member goes in side and sits in the seat, and is protected.

I also want, to move the player out of the level when he/she dies, or into a graveyard part on the field. I also want to incorporate this into a boot function, only accessible by ET members.

How would I do that? Help is greatly appriecated.

My current PvP herald code:
NPC Code:

// NPC by Sephir/Raeiphon
// Please credit if you use!
if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head19.png;
setcharprop #C0,orange;
setcharprop #C1,gray;
setcharprop #C2,gray;
setcharprop #C3,brown;
setcharprop #C4,black;
setcharprop #n,PvP Herald;
setcharprop #2,no-shield.png;
shieldpower = 1;
dir = 2;
message Say start to begin the joust!;
}

if (playerchats) {

if(strequals(#c,start)){
putbomb 0,38,25;
sleep 5;
message ET Judges from now!;
}
if(strequals(#c,superjoust)){
putcomp goldenwarrior,npcs[self].x,npcs[self].y+10;
putcomp goldenwarrior,npcs[self].x,npcs[self].y+10;
putcomp goldenwarrior,npcs[self].x,npcs[self].y+10;
putcomp goldenwarrior,npcs[self].x,npcs[self].y+10;
putcomp goldenwarrior,npcs[self].x,npcs[self].y+10;

}
}

if (playerdies) {
message A PLAYER HAS WON!!;
setlevel2 mainhouse.nw,0,0

}




The setlevel2 was my original means, but i cant get it to work in the Offline test.
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #2  
Old 08-27-2005, 05:41 AM
Idrox0 Idrox0 is offline
Registered User
Join Date: Oct 2003
Posts: 66
Idrox0 is on a distinguished road
Well, first of all, the superjoust thing should use a for loop, considering it's the same thing five times in a row.

Now, as for the whole the-ET's-vulnerable-hide-tiles-then-he's-safe thing, could you be a bit more specific of what you want to happen?

And as for the go-to-a-graveyard-when-dead thing, I would just set the playerx and playery to whatever when playerhearts = 0, but I only know that would work offline. I'm not exactly sure how you access a given player's variables except through direct account association (with (account))... but yeah, I think that should help a bit.
__________________
Reply With Quote
  #3  
Old 08-27-2005, 05:51 AM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
To change tiles via a script, you can access the tile array directly using tiles[y][x]=integer; and then updating the tiles with updateboard x,y,width,height;

to get the tile ID's, go into the editor and select a tile (draw a box around one tile) then go up to the toolbar and click on the thing that looks like four cobbles. that will give you the ID of that tile (use that as the value in the tiles[][] array)

tiles[0][0]=0x00; will replace the top left tile with the left side of the two-tile grass tuft.
note, the level is 64x64, so you can do up to tiles[64][64]

you -must- to updateboard in order to have the new tile display on the level without having to re-enter the level (or at least move so the tile you changed is off-screen) before it will update.
__________________
Reply With Quote
  #4  
Old 08-27-2005, 04:10 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
Okay, i'll be a little more specific (thanks calani, i now understand how to do it.) with the booting thing:

When a player dies, i want him/her off the map. Or warped to a co-ordinate on the current map so they can exit thorugh a door. I've tried setlevel2 when playerdies, but it doesnt work.
__________________

I hope for nothing. I fear nothing. I am free.
Reply With Quote
  #5  
Old 08-27-2005, 06:32 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Check if the player has been hit. Check if the players HP hits 0, if yes setlevel2.
__________________
Reply With Quote
  #6  
Old 08-27-2005, 09:08 PM
calani calani is offline
Scriptess
calani's Avatar
Join Date: Aug 2003
Location: asmgarden.gmap
Posts: 606
calani is on a distinguished road
Send a message via AIM to calani
Yes (playerdies) doesn't work right, if at all. I remember getting it to work two or so years ago on babylon, but it could be depreciated in the current release.
check the player's HP in a timeout loop (all you'll need is .5 or so: no need to check it 20 times a second)
__________________
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 07:52 AM.


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