![]() |
NPC warping
I am working on a new battle system for ELemental Kingdoms but I cannot find a way to warp npcs to a level, which is a huge part of it (I have tried a few other ways, to no avail). anyb suggestions (please dont say get a good NAT)?
|
Quote:
|
I am not using a db npc, its a class npc, that's what makes it hard :(
|
use canwarp/canwarp2 and warpto x,y,level;
|
warpto doesnt work except on database npcs :/
|
Quote:
|
hmm i know the command to attatch to a player i just didnt think it warped with them plus I wqas told that it wasnt a good thing to do. I will try that soon and let you guys know.
|
NPCs that were layed with putnpc2 can warpto and stuff.
|
Quote:
|
Quote:
|
well mine just join the class directly, so that wouldnt work, ill try the attatching. But i'll remeber that putnpc2 thing, maybe make a summoning spell :)
|
hmm, how do i find the npcs id that i want the player to be attached to? i tried a couple ways, like a for loop, but it didnt seem to work.
|
The current NPC's ID is stored, unsurprisingly, in the variable
NPC Code:. By extension, you should be able to useid NPC Code:.players[index].id |
ok, i wasnt sure if that worked, because it didnt seem to, i'l lretry it.
|
It attaches, but doesn't warp, here's the script, I can't see what's wrong:
PHP Code:
|
Quote:
PHP Code:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Right, now about the script? Help? please? (as for the mods of thsio forum that enjoy closing these type threads: I have tried several ways to get it working, i understand what I'm doing, ect ect, I just can't find the bug in my script)
|
Quote:
|
Quote:
|
Quote:
|
Quote:
NPC Code: |
You misspelled detachplayer.
This probably doesn't fix your problem, but I thought I'd let you know. |
Quote:
Quote:
EDIT: PHP Code:
Doesn't work still, that's the current script, it attaches you to the mold, but doesnt create or warpto the new level, nor make you warp there. |
I suggest instead of creating a random level, you make a database npc to hold the indexes of the levels created. Then when the player ends the battle, erase the level.
You could also have a timeout NPC running in the level. Read the index of the level with #e(#,#,#L) or something and make the script run deletelevel if the playerscount is 0. If the player enters, start the timeout. |
yes i was considering the second thing in the leve, but figured there isn't a point until I both;
A) Get the script to work. B) have enough people on that it would matter |
You could do:
NPC Code: and in levels/neutral-battle.nw put this script exactly: NPC Code: But make sure you have a backup of the original neutral battle. We're deleting the level to make less lag. Now if that doesn't work i'll get online and play with it. |
The only change you made to the original script was making this.w progressively increase instea dof being random. I tried it just in case and it didn't help, so i went back to the original desing. Again iw on't be deleting the levels with a script until the average playercount is higher (crrently it's 2 :( )
|
It would kind of help if I knew the whole script so I knew what you were trying to do exactly.
|
That is the part of the script that is broken, the fighting system level warp, the overall script is the monster, mold. Posting it would only give noobs a script to copy.
|
Quote:
|
no i think they meant "==0", and if not, well.....
|
Quote:
|
Quote:
NPC Code: Returns 0. (DB NPC) Quote:
|
Quote:
|
Yes, less arguing more helping my problem :D, this should be working.......
|
If you want to get all the players you're going to need
NPC Code: To get serverside NPCs use: NPC Code: This works for classes aswell. You can control text's of a class and such with this, possibly warpto in the script, Which I have never tried. I'm starting to lose understanding of your question. |
| All times are GMT +2. The time now is 12:00 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.