Mercenary_Rent

Darius Trevor

New member
Messages
3
Points
0
Github
Trevor
Hello everybody.

I am having this error in the mercenary_rent.txt script is something strange for me that I have never had this error.
I would like to ask for this help so I can solve it and if someone else also has the same error, solve it too.
Thanks in advance.
The error is below.


[Error]: script:getd: `SPEAR_MERC_GUILD` is already used by something that is not a variable.
[Debug]: Source (NPC): Mercenary Manager#Spear at prontera (41,337)


It happens with the three variables


setarray .@faith$,     "SPEAR_MERC_GUILD",    "SWORD_MERC_GUILD",    "ARCH_MERC_GUILD";

 
Last edited by a moderator:
ARCH_MERC_GUILD, SPEAR_MERC_GUILD and SWORD_MERC_GUILD are hardcoded constants, so you cannot use them as variable

Instead of doing something like this to get their values:

setarray(.@faith$, "SPEAR_MERC_GUILD", "SWORD_MERC_GUILD", "ARCH_MERC_GUILD");

...

getd(.@faith$[1])


Just use the plain constants:

Code:
setarray(.@faith, SPEAR_MERC_GUILD, SWORD_MERC_GUILD, ARCH_MERC_GUILD);

...

.@faith[1]
 
Last edited by a moderator:
hm, but getd should not return errors for constants too

 
wow that's quite awkward then; we should definitely get rid of it

I'll open a PR to remove useless usages of getd

 
Back
Top