• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Adding new Ammo Type

suicunei

New Member
Joined
Jun 27, 2013
Messages
61
Solutions
1
Reaction score
2
Guys, I have a doubt on it, and tried to search in the forum and also in the internet but didn't find what I want.

I am creating a server 8.6, but I'm adding items until the 10.56 version and outfits until 10.9. Until now everything is okay, but some arrows and bolts of the new version uses their own ammo type, like the vortex bolt, it has a unique ammo type.

I added the sprite of the missile into the .dat and .spr files of my client, added the correct lines in the 000-constant.lua, added the codes in the const.h of the source and in the tools.cpp.

Now I am able to write the correct ammo type in items.xml, to use /x and the number of the effect with the god, but I still get an error:

When I use the arbalest with the vortex bolt, and try to hit something, the client just crashes... I don't know what to do, can someone help me?

Imgur: The most awesome images on the Internet --------------- image

There are all the modifications that I've done:

000-constant.lua: hastebin
const.h: hastebin
tools.cpp: hastebin


ps.: This crash happens with all the new ammo types.


Please someone help me!

up? someone?

PLEASE SOMEONE
 
Last edited by a moderator:
Solution
You won't be able to use the files you changed with any client, either re do it and make sure it's 100%, if it is then it's most likely a block from the client, if it is then upgrade the client and or remove one effect to replace it with.

shit.... but if the limit of effects is 255, why does this happen? it was supposed to work, I'm not exceding the limit... I added the sprites with OB 100% correctly, i'm sure.. but i can't even imagine what is happening with the source... obviously, with the otc's help, the problem is the protocolgame.cpp right?

I got the solution, just fixed the hexa values in const.h hahahaha

look:
it was
SHOOT_EFFECT_CRYSTALLINEARROW = 0x30, //42 --------------- starts here
SHOOT_EFFECT_DRILLBOLT...
Are you able to use the /x command and the effects shows up?
If it dosn't re-do everything with "fresh" spr and dat.
If the effect shows up with the command im guessing there is something wrong with the client, have you given OTC a try? Normally you can get more info about crashes etc from OTC and try to sniff the error down.
 
Are you able to use the /x command and the effects shows up?
If it dosn't re-do everything with "fresh" spr and dat.
If the effect shows up with the command im guessing there is something wrong with the client, have you given OTC a try? Normally you can get more info about crashes etc from OTC and try to sniff the error down.

firstly I am able to use /x command successful.

I have added all the sprites into the client spr and dat using Object Builder, and the limit of effects is of 255. I am using just about 70 effects nad I added the effects to the sources of tfs and compiled without errors... Idk what to do..

I tried to use OTC once, but I am not able to compile it by myself due to alot of errors/warnings(this happens only with x64 version), and I want to compile because of the modifications I would want to do. The Cip client is very good for me, the only problem is this crash with the ammo type..
 
firstly I am able to use /x command successful.

I have added all the sprites into the client spr and dat using Object Builder, and the limit of effects is of 255. I am using just about 70 effects nad I added the effects to the sources of tfs and compiled without errors... Idk what to do..

I tried to use OTC once, but I am not able to compile it by myself due to alot of errors/warnings(this happens only with x64 version), and I want to compile because of the modifications I would want to do. The Cip client is very good for me, the only problem is this crash with the ammo type..

Okay then it should be something regarding the code for the arrow / bolt, either client sided or server sided.
Just download a pre-compiled OTC and swap the dat and spr files, if you can get it to crash with OTC then post the error log in the OTC directory.
 
Okay then it should be something regarding the code for the arrow / bolt, either client sided or server sided.
Just download a pre-compiled OTC and swap the dat and spr files, if you can get it to crash with OTC then post the error log in the OTC directory.


I was given the error with OTC:

Imgur: The most awesome images on the Internet

What can I do? I didn't added the missile 54 neither in sources nor the server.. My last missile is 47


Edit.

My missiles in OB:
Imgur: The most awesome images on the Internet -- it starts on 1 and ends on 48


In the 000-constant.lua file, the missiles starts on 0 and ends on 47, look:
hastebin
 
Last edited:
I was given the error with OTC:

Imgur: The most awesome images on the Internet

What can I do? I didn't added the missile 54 neither in sources nor the server.. My last missile is 47


Edit.

My missiles in OB:
Imgur: The most awesome images on the Internet -- it starts on 1 and ends on 48


In the 000-constant.lua file, the missiles starts on 0 and ends on 47, look:
hastebin

otclient/protocolgameparse.cpp at master · edubart/otclient · GitHub
otclient/thingtypemanager.h at e870110875627d55006236b7e4996f28fed9a287 · edubart/otclient · GitHub

You didn't add the effect the correct way, im guessing the client is expecting (ex) 10 effects but it's getting 11.
 
so i am not able to use cip client?

You won't be able to use the files you changed with any client, either re do it and make sure it's 100%, if it is then it's most likely a block from the client, if it is then upgrade the client and or remove one effect to replace it with.
 
You won't be able to use the files you changed with any client, either re do it and make sure it's 100%, if it is then it's most likely a block from the client, if it is then upgrade the client and or remove one effect to replace it with.

shit.... but if the limit of effects is 255, why does this happen? it was supposed to work, I'm not exceding the limit... I added the sprites with OB 100% correctly, i'm sure.. but i can't even imagine what is happening with the source... obviously, with the otc's help, the problem is the protocolgame.cpp right?

I got the solution, just fixed the hexa values in const.h hahahaha

look:
it was
SHOOT_EFFECT_CRYSTALLINEARROW = 0x30, //42 --------------- starts here
SHOOT_EFFECT_DRILLBOLT = 0x31, //43
SHOOT_EFFECT_ENVENOMEDARROW = 0x32, //44
SHOOT_EFFECT_PRISMATICBOLT = 0x33, //45
SHOOT_EFFECT_TARSALARROW = 0x34, //46
SHOOT_EFFECT_VORTEXBOLT = 0x35, //47


the correct is

SHOOT_EFFECT_CRYSTALLINEARROW = 0x2A, //42 --------------- starts here
SHOOT_EFFECT_DRILLBOLT = 0x2B, //43
SHOOT_EFFECT_ENVENOMEDARROW = 0x2C, //44
SHOOT_EFFECT_PRISMATICBOLT = 0x2D, //45
SHOOT_EFFECT_TARSALARROW = 0x2E, //46
SHOOT_EFFECT_VORTEXBOLT = 0x2F, //47
 
Last edited by a moderator:
Solution
Back
Top