getText() doesn't work
0

12 posts in this topic

Recommended Posts

I made a mod, but it doesn't work properly.

111.png.44d4ee0e10348cb09396219f9f341129.png

 

It's very strange, because I made localization file properly and double checked it:

ContextMenu_EN = {
	ContextMenu_Annotation = "Annotation",
}

But for some reason it doen't work.

print("ContextMenu_Annotation" == getText("ContextMenu_Annotation")); --true!

Can somebody explain what am I doing wrong?

I was about to publish the mod but stucked on this issue.

 

CureVirus.zip

Share this post


Link to post
Share on other sites

It's strange. Now I can't reproduce. It seems that I must restart game. I thought that loading main menu should reload all mods.

 

Thank you.

 

There remained one last annoying bug. I have no idea what it is.

If you get CureVirus.CVZombieBlood, then cook it in oven, it become CVZombieBloodCooked. And then if you drag it to you inventory, it disappears! But if you drag it to the ground and then to inventory, all is ok.

Share this post


Link to post
Share on other sites
2 hours ago, Maris said:

It's strange. Now I can't reproduce. It seems that I must restart game. I thought that loading main menu should reload all mods.

 

Thank you.

 

There remained one last annoying bug. I have no idea what it is.

If you get CureVirus.CVZombieBlood, then cook it in oven, it become CVZombieBloodCooked. And then if you drag it to you inventory, it disappears! But if you drag it to the ground and then to inventory, all is ok.

 

Again, I can't reproduce this. I just cooked it and dragged into my inventory and it was fine.

Share this post


Link to post
Share on other sites
1 hour ago, Connall said:

 

Again, I can't reproduce this. I just cooked it and dragged into my inventory and it was fine.

I think Maris set ReplaceOnCooked in scripts.
Some modders have a issue with ReplaceOnCooked string in scripts, works good in SP but MP sometimes item banish when transfer to inventory. (Spawn in inventory and a second after doing that... banish)... If the server owner stops the server and restart, items banished spawns inside the stove inventory.

Share this post


Link to post
Share on other sites
5 hours ago, Snakeman said:

I think Maris set ReplaceOnCooked in scripts.
Some modders have a issue with ReplaceOnCooked string in scripts, works good in SP but MP sometimes item banish when transfer to inventory. (Spawn in inventory and a second after doing that... banish)... If the server owner stops the server and restart, items banished spawns inside the stove inventory.

Exactly.

I host local server (because there is admin panel and I can spawn items for testing).

The bug exists for me.

And if I stop the server and start again, raw uncooked CVZombieBlood appears again in the oven and I can cook it again with the same bug on dragging cooked blood to inventory.

module CureVirus
{
	...
	item CVAntivirus
	{
		...
		ReplaceOnCooked = CureVirus.CVAntivirusCooked,
		...
	}
	...
}

I could avoid using ReplaceOnCooked in scripts folder if there was something like Events.OnCooked.Add() or item:IsCooked() in lua.

Edited by Maris

Share this post


Link to post
Share on other sites
6 hours ago, Maris said:

Exactly.

I host local server (because there is admin panel and I can spawn items for testing).

The bug exists for me.

And if I stop the server and start again, raw uncooked CVZombieBlood appears again in the oven and I can cook it again with the same bug on dragging cooked blood to inventory.


module CureVirus
{
	...
	item CVAntivirus
	{
		...
		ReplaceOnCooked = CureVirus.CVAntivirusCooked,
		...
	}
	...
}

I could avoid using ReplaceOnCooked in scripts folder if there was something like Events.OnCooked.Add() or item:IsCooked() in lua.

yep!

Share this post


Link to post
Share on other sites

This happen also when add a item inside of objectcontainer in lua (MP)... when you transfer the item to your inventory banishes... you need to transfer item to floor first.

Edited by Snakeman

Share this post


Link to post
Share on other sites
24 minutes ago, Snakeman said:

This happen also when add a item inside of objectcontainer in lua (MP)... when you transfer the item to your inventory banishes... you need to transfer item to floor first.

 

Any chance I could get an example mod of this to test this with, I'm curious to see what the issue might be.

Share this post


Link to post
Share on other sites

need to search... because when i detected that issue changed the code to add item on the floor.
like this:
self.character:getCurrentSquare():AddWorldInventoryItem(TheItem, self.character:getX() - math.floor(self.character:getX()), self.character:getY() - math.floor(self.character:getY()), self.character:getZ() - math.floor(self.character:getZ()));

 

i think not working code in MP: self.object:getInventory():additem() or additemonserver() (I can't remember very well)

Share this post


Link to post
Share on other sites
23 minutes ago, Connall said:

 

Any chance I could get an example mod of this to test this with, I'm curious to see what the issue might be.

I think the problem is the generation of item inside of worldobject inventory in MP. When you transfer that item to your inventory, system thinks its non valid item (dupe or like that) but if you transfer that item to floor first maybe system not check that... :P

I think it's the same code that adds ReplaceOnCooked.. because when you set this string and item finish to cooked... generate a new item inside of stove (Non player inventory)

Edited by Snakeman

Share this post


Link to post
Share on other sites
8 hours ago, Connall said:

 

Any chance I could get an example mod of this to test this with, I'm curious to see what the issue might be.

The mod from this topic is an exmaple. Raw blood -> cook -> can't drag cooked blood from oven to inventory (in multiplayer).

Edited by Maris

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
0