|
Haven't seen a tutorial on this so, here it goes
1. In objectmanager.java search for(yours might be a bit different..) replace the method with this oneCode:public void removeObject(int x, int y) { c.getPA().object(158, 3097, 3493, 0, 10); for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c = (Client)Server.playerHandler.players[j]; c.getPA().object(-1, x, y, 0, 10); } } }2. In changeregions.java underCode:public void removeObject(int x, int y) { for (int j = 0; j < Server.playerHandler.players.length; j++) { if (Server.playerHandler.players[j] != null) { Client c = (Client)Server.playerHandler.players[j]; c.getPA().object(-1, x, y, 0, 10); c.getPA().object(158, 3097, 3493, 0, 10); } } }add thisCode:public void processPacket(Client c, int packetType, int packetSize) {3. Now add thisCode:c.getPA().removeObjects();in objectmanager.java under loadCustomSpawns method.Code:public void Deletewalls(Client c) { c.getPA().checkObjectSpawn(-1, xxxx, yyyy, -1, 0); }
And add thisunder thisCode:Deletewalls(c);Just change the coords and it will delete the wallCode:loadCustomSpawns(c);
This might help ya understand how it works, thanks Martin btw
This works for doors too
Its been released I have seen it somewhere I think... but still goodjob
Please reply and tell what you think
No matter where I add "
public void Deletewalls(Client c) {
c.getPA().checkObjectSpawn(-1, 4624, 4524, -1, 0);
}" It gives an error.
I get this error:
This is the same for Regions and Region.src\server\model\players\packets\ChangeRegion.java :15: illegal start of expressi
on
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :15: illegal start of expressi
on
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :15: ';' expected
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :15: ';' expected
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :17: reached end of file while
parsing
}→
^
5 errors
mabey you should give more info on how the method works:
c.getPA().object(-1, x, y, 0, 10);
the -1, indicates the new object id, and since your deleting, you want nothing to appear there.
the x, and y is self explantory,
the 0 is the face of the object, illrevent in destroying objects.
and the 10 the most important variable indicates the object type.
In case you want to have multiple objects on a tile you must use different object types for example:
type 0-3 are all walls (sometimes doors) some tiles have 4 walls so 4 different type ids are needed incase type 0 is take it uses 1, then 2 and so fourth.
type 10 are large objects most commonly used they usally take up a minimum of 1x1 squares besides in the case of doors. 90%+ of interactable objects are type 10, its rare to find one that isnt, again its usally doors.
type 5-8? are diagonal walls, and some strange stuff usally just diagonal walls and doors, but again I never bothered refactoring this type of object much for worldmaps Usally just easyer to take them as 1x1 tile size.
type 9 and 22, wall and floor decoration, all wall decorations can be ignored as the wall already counts in the case of worldmaps, but some type 22 objects arent walkable while 99% are. Examples of non walkables are, bank table in edgeville, the wall on that strange house outside bank in edge. Non walkables are details on ground such as very small rocks (if decoration has an option its non walkable)
Although I kinda went off point above on worldmaps, its usefull to also know how to decorate areas if you want to for example having a rug on the ground aswell as having a bank booth etc on top of it, or spinning wheel, but again what you posted is pretty obious since its in most sources you should explain what the variables are
Ok so i registered on these forums just to help you out with this xDNo matter where I add "
public void Deletewalls(Client c) {
c.getPA().checkObjectSpawn(-1, 4624, 4524, -1, 0);
}" It gives an error.
I get this error:
Quote:
src\server\model\players\packets\ChangeRegion.java :15: illegal start of expressi
on
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :15: illegal start of expressi
on
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :15: ';' expected
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :15: ';' expected
public void Deletewalls(Client c) {
^
src\server\model\players\packets\ChangeRegion.java :17: reached end of file while
parsing
}→
^
5 errors
This is the same for Regions and Region.
ok so you wan to add the
In the OBJECTMANAGER.JAVACode:public void Deletewalls(Client c) { }
Under all of your custom spawns
Example:
Yours might be different, Hope I helped (:Code:if (c.heightLevel == 0) { c.getPA().checkObjectSpawn(2492, 2911, 3614, 1, 10); }else{ c.getPA().checkObjectSpawn(-1, 2911, 3614, 1, 10); } } public void Deletewalls(Client c) { }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |