Custom weapon stacking on insert

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.
Post Reply
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Custom weapon stacking on insert

Post by biosek »

Hello,
i need to fix a bug, but i don't know how.

I am running 97 pol server. I have custom weapon type called shuriken. It is throwable item. They are stacking fine when i am inserting them into backpack. But when i want to grab them and insert them on another stack, they just wont insert into one stack.

Can anybody help? Do you need some configs to help?

Thanks.
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Custom weapon stacking on insert

Post by Tomi »

How are you inserting those weapons in your backpack when they are stacking ?
Have you checked your tiledata and tiles.cfg if they really are stackable ?
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

Yes in my tiledata they are set to be stackable. Even ingame when I read info about them the property stackable is set.

They are stacking when I drop them to my backpack in my paperdoll. So it is calling default onInsert for my backpack and it stacks them fine.

I will post configs for them, so you have all information.

Code: Select all

from tiles.cfg:
tile 0x2e22
{
    Desc shuriken
    UoFlags 0x04400802
    Layer 1
    Height 1
    Weight 1
    Stackable 1
    Movable 1
    Equippable 1
}

Code: Select all

from itemdesc.cfg:
Weapon 0x2E22
{
    Name            shuriken
    desc            shuriken
    Difflevel	    10
    Speed           21
    Hit             25
    Damage          2d3+10
    DamageType      4
    BlocksCastingIfInHand 0
    Material        metal
    Attribute       Blades
    Anim            0x0009
    MaxHP           60
    Weight          1/20
    Script          :shooting:throw
    HitSound        0x23C
    MissSound       0x23A
    strrequired     5
    equipscript     :combat:noequip
    //unequipscript   :combat:unequip
    //destroyscript   :combat:destroy
    Throwing        1
    ThrowMinRange   1
    ThrowMaxRange   8
//    Difficulty      -1
    ProjectileAnim  0x2E22
    ProjectileType  0x2E22
    ProjectileSound 0x53b
    cprop NoMelee   i1
    Stacking        1
    minTimer        2000
    //PreventStacking 1
}
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Custom weapon stacking on insert

Post by RusseL »

Make sure you have same object properties on both items (stack and inserting item)

Or use http://docs.polserver.com/pol099/config ... acking.cfg
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

I will check by script all props and cprops of both stacks. Thanks.

But still i dont understand why they stacks on inserting in backpack and not on inserting on another stack. Dost that onInsert in backpack ignores something?
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

So, i have just printed showprop for both shuriken stacks, i guess there are not all properties so i get stackable prop with command as you can see in journal.
Every property shown is similar and i don't really know why they can't stack

Image
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Custom weapon stacking on insert

Post by RusseL »

As i understand these are config properties. You need CProps

http://docs.polserver.com/pol099/single ... e=uoem.xml
http://docs.polserver.com/pol099/single ... e=uoem.xml


ps. You can use this command to check CProps
http://forums.polserver.com/viewtopic.php?f=8&t=2108
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

Ok then.

Both stacks have one CProp only it is called NoMelee and has value 1.

But even when I remove this CProp on both stacks I cant stack them together.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Custom weapon stacking on insert

Post by CWO »

Do this...

Create three stacks of something that is usually stackable (maybe arrows or something) and three stacks of the shurikens.

Have one stack of both items in your backpack and the other two stacks of both items outside on the ground next to you.

Once you have yourself completely set up for the test, type .startlog

Pick up one stack of the arrows (or other item) and drop it on your paperdoll backpack. Then pick up the other stack of arrows (or other item) and drop it directly on the stack inside your backpack.

Next, do the same thing with the shurikens.

type .stoplog.

post pol/log/[acctname].log here.

I have a suspicion that this is a client side problem and the packet log will tell me if this is so.
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

Ok i took "ham" with type "0x3df7". Made what you asked. First from ground to bag in my paperdoll then from ground to stack in my bag. Worked fine.
Then the same with shurikens of type "0x2e22".

I looked it over and the packets with ham type in them are identical in both cases, but the packets with shuriken type are different and the first one (that worked on bag in paperdoll) is nearly same as those with ham. Thats about it what i can get from it by myself :).

edit: Ok i searched the packets and when i tried to stack shurikens on shurikens i got "0x27 - Reject Move Item Request" with reason "0x5: empty message on client?" I don't know what that means :/

Here it is.

Code: Select all

Log opened at Wed Mar 26 14:00:58 2014

Server -> Client: 0x1C, 65 bytes
0000: 1c 00 41 01 01 01 01 01  01 00 03 b2 00 03 53 79   ..A..... ......Sy
0010: 73 74 65 6d 00 00 00 00  00 00 00 00 00 00 00 00   stem.... ........
0020: 00 00 00 00 00 00 00 00  00 00 00 00 49 2f 4f 20   ........ ....I/O 
0030: 6c 6f 67 20 66 69 6c 65  20 6f 70 65 6e 65 64 2e   log file  opened.
0040: 00                                                 ........ ........

Client -> Server: 0xBF, 6 bytes
0000: bf 00 06 00 24 28                                  ....$(.. ........

Client -> Server: 0x7, 7 bytes
0000: 07 40 03 2e 85 00 14                               .@...... ........

Server -> Client: 0x1D, 5 bytes
0000: 1d 40 03 2e 85                                     .@...... ........

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 2b 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .+...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Client -> Server: 0x8, 14 bytes
0000: 08 40 03 2e 85 ff ff ff  ff 00 40 03 2e 7d         .@...... ..@..}..

Server -> Client: 0x25, 20 bytes
0000: 25 40 03 2e 87 3d f7 00  00 1e 00 33 00 7a 40 03   %@...=.. ...3.z@.
0010: 2e 7d 00 00                                        .}...... ........

Server -> Client: 0x54, 12 bytes
0000: 54 01 00 57 00 00 0b b9  08 43 00 00               T..W.... .C......

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 2b 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .+...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Server -> Client: 0xA2, 9 bytes
0000: a2 00 00 00 02 00 37 00  37                        ......7. 7.......

Client -> Server: 0xBF, 6 bytes
0000: bf 00 06 00 24 68                                  ....$h.. ........

Client -> Server: 0x7, 7 bytes
0000: 07 40 03 2e 84 00 14                               .@...... ........

Server -> Client: 0x1D, 5 bytes
0000: 1d 40 03 2e 84                                     .@...... ........

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 3f 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .?...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Client -> Server: 0x8, 14 bytes
0000: 08 40 03 2e 84 00 33 00  7a 00 40 03 2e 87         .@....3. z.@.....

Server -> Client: 0x25, 20 bytes
0000: 25 40 03 2e 87 3d f7 00  00 32 00 33 00 7a 40 03   %@...=.. .2.3.z@.
0010: 2e 7d 00 00                                        .}...... ........

Server -> Client: 0x54, 12 bytes
0000: 54 01 00 57 00 00 0b b9  08 43 00 00               T..W.... .C......

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 3f 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .?...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Client -> Server: 0x7, 7 bytes
0000: 07 40 03 2e 81 00 14                               .@...... ........

Server -> Client: 0x1D, 5 bytes
0000: 1d 40 03 2e 81                                     .@...... ........

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 40 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .@...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Client -> Server: 0xBF, 6 bytes
0000: bf 00 06 00 24 25                                  ....$%.. ........

Client -> Server: 0x8, 14 bytes
0000: 08 40 03 2e 81 ff ff ff  ff 00 40 03 2e 7d         .@...... ..@..}..

Server -> Client: 0x25, 20 bytes
0000: 25 40 03 2e 86 2e 22 00  00 1e 00 57 00 51 40 03   %@....". ...W.Q@.
0010: 2e 7d 00 00                                        .}...... ........

Server -> Client: 0x54, 12 bytes
0000: 54 01 00 57 00 00 0b b9  08 43 00 00               T..W.... .C......

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 40 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .@...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Server -> Client: 0xA2, 9 bytes
0000: a2 00 00 00 02 00 37 00  37                        ......7. 7.......

Client -> Server: 0x7, 7 bytes
0000: 07 40 03 2e 7f 00 14                               .@...... ........

Server -> Client: 0x1D, 5 bytes
0000: 1d 40 03 2e 7f                                     .@...... ........

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 41 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .A...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Client -> Server: 0xBF, 6 bytes
0000: bf 00 06 00 24 4a                                  ....$J.. ........

Client -> Server: 0x8, 14 bytes
0000: 08 40 03 2e 7f 00 57 00  51 00 40 03 2e 86         .@....W. Q.@.....

Server -> Client: 0x27, 2 bytes
0000: 27 05                                              '....... ........

Server -> Client: 0x1A, 19 bytes
0000: 1a 00 13 c0 03 2e 7f 2e  22 00 14 0b b9 c8 43 14   ........ ".....C.
0010: 00 00 20                                           .. ..... ........

Server -> Client: 0x11, 88 bytes
0000: 11 00 58 00 00 00 02 42  69 6f 73 65 6b 00 00 00   ..X....B iosek...
0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0020: 00 00 00 00 00 00 71 00  71 00 04 00 00 6d 00 48   ......q. q....m.H
0030: 00 32 00 88 00 88 00 37  00 37 00 00 00 00 00 00   .2.....7 .7......
0040: 00 40 00 e1 00 00 00 00  00 00 00 00 00 00 00 00   .@...... ........
0050: 00 00 00 00 00 00 00 00                            ........ ........

Client -> Server: 0xBF, 6 bytes
0000: bf 00 06 00 24 36                                  ....$6.. ........

Server -> Client: 0xA2, 9 bytes
0000: a2 00 00 00 02 00 37 00  37                        ......7. 7.......

Client -> Server: 0xAD, 30 bytes
0000: ad 00 1e 00 00 34 00 03  43 53 59 00 00 2e 00 73   .....4.. CSY....s
0010: 00 74 00 6f 00 70 00 6c  00 6f 00 67 00 00         .t.o.p.l .o.g....

Log closed at Wed Mar 26 14:01:15 2014

User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Custom weapon stacking on insert

Post by CWO »

ya it's definitely POL doing it. What I was figuring was that the client was the one saying it's not stackable so when it sent the 0x08 packet, it would be formed in a way to not stack. By the looks of the packet though, this is not the case. The server is definitely rejecting it for some reason.

if it was the client, the last packet would have been something like

Code: Select all

0000: 08 40 03 2e 7f 00 57 00  51 00 40 03 2e 7d
the last 4 bytes would have been your backpack but the packet has the last 4 bytes being the serial number of the stack inside your backpack which is correct.


Just a shot in the dark, try changing it in the itemdesc from a weapon to an item and reboot POL. The only reason I'm saying this is because I personally have never worked with a stackable weapon... If it doesn't work then obviously change it right back.
Last edited by CWO on Wed Mar 26, 2014 12:49 pm, edited 2 times in total.
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

Hm if this is not a case of client. What could it be? Personaly I've run out of options here.
Configs should be correctly set. There are no available scripts which could make it in POL. I really don't know.

The last thing what comes to my mind. If this stacking could be done through script (from config) that handles these shurikens. ( Script :shooting:throw)

Or do you know how else can I alter the requests for stacking them?
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Custom weapon stacking on insert

Post by CWO »

try the changing it from weapon to item in the itemdesc.cfg.

Also another thing to try, try splitting a stack and recombining it.
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

Split and recombine doesn't work either.

When I just change weapon to item in config, then the stacking works. (But functionality of them is lost :/) So there must be an issue in stacking weapons types.

edit: But we might change it to normal Item and rewrite the script a bit. But anyway if I wanted to make wearable weapon that could stack i would have a problem here :)
Last edited by biosek on Wed Mar 26, 2014 1:08 pm, edited 1 time in total.
User avatar
CWO
POL Expert
Posts: 1160
Joined: Sat Feb 04, 2006 5:49 pm

Re: Custom weapon stacking on insert

Post by CWO »

That would be the problem then. This would probably have to be brought up to those who are experienced at developing the POL core. And unfortunately, any fixes would only be applied to 099.
biosek
New User
Posts: 12
Joined: Mon Feb 24, 2014 3:57 am

Re: Custom weapon stacking on insert

Post by biosek »

Well we are using pol97 so maybe it is fixed on 99 :). But anyway thanks for help.
Agata
Journeyman Poster
Posts: 63
Joined: Sun Oct 30, 2011 6:33 am

Re: Custom weapon stacking on insert

Post by Agata »

Heh, stacking weapons is bad form! I use a "thrower" item. For my shard, I modified the tiledata to make the leather ninja belt into a weapon equipped on the one-handed weapon layer, and scripted it just like a bow.
Post Reply