Sign in to follow this  
Lokoluna

Small help with tags

Recommended Posts

Lokoluna    48

Hello! So with the Winona update i'd like to give myself her tags, to lsoe hunger upon building ,build faster, etc However i've hit the tag limit, and I need help around this, is there a more simple way to apply tags, without adding them?

Share this post


Link to post
Share on other sites
Ultroman    704

Yes. I can't remember how, though. A workaround could be to simply add bools to the player inst, like this:

inst.mytag = true

Then just check

if inst.mytag then
	-- do something
end

If a player does not have the variable at all, the if-statement will see inst.mytag as nil which also makes the if-statement false.

Share this post


Link to post
Share on other sites
CarlZalph    4457
Just now, Lokoluna said:

That seems like it would still add a tag to myself, Thus overdoing the tag limit.. since I'm so use to jsut "inst.addtag: fastworker" etc

Tags on entities are networked to clients, hence the limit.

Setting a variable on an entity isn't networked as you'd have to go through netvars to add that functionality.

 

I'd look into which functions cause Winona to build quicker/get hunger on build, then hook them to add in another check to see if it's your character's prefab doing the task.

Share this post


Link to post
Share on other sites
Lokoluna    48
3 hours ago, CarlZalph said:

Tags on entities are networked to clients, hence the limit.

Setting a variable on an entity isn't networked as you'd have to go through netvars to add that functionality.

 

I'd look into which functions cause Winona to build quicker/get hunger on build, then hook them to add in another check to see if it's your character's prefab doing the task.

I'm not familiar with netvars or bools. What sort of way would I hook them? Do you have an example?

Share this post


Link to post
Share on other sites
Ultroman    704

Making a variable does not count towards the tag limit. They are totally different things. The tags are a game-specific thing, whereas variables are a language-specific thing. The number of variables is not limited (at least not in the numbers you'll be hitting).

I've never worked with netvars, which CarlZalph is mentioning, but I know there're threads about how they work on this forum somewhere.

That said, extending the right functions and simply checking which prefab is doing the function and then doing a specific thing, is a very good way to go.

Edited by Ultroman

Share this post


Link to post
Share on other sites
YakumoYukari    148

You can make netvars like this 

inst.testvar = net_bool(inst.GUID, "ontestvar", "ontestvardirty")
inst.testvar:set(false)

There're many other sorts of netvars available. You can see it in netvars.lua.
 

Actually, I have made a similar thing like what you're trying to do.
https://github.com/HimekaidouHatate/YakumoYukari-DST/tree/master/scripts
Look stategraph_yukari.lua and prefab/yukari_classified.lua
You can see how I create netvars and use it.
But you don't actually need to make your own classified.
Just define your netvar at common_poistinit. (if it's not a player character, define it before SetPristine() like this.)

Share this post


Link to post
Share on other sites
zarklord_klei    1496

I'm curious, how the heck do you have 63 tags on your character?
if your having trouble adding a single tag, your character will break with just about any other mod/game update in existence, and you need to find a different option for your stuff.

Share this post


Link to post
Share on other sites
zarklord_klei    1496
13 hours ago, YakumoYukari said:

Has the entity size increased?  I thought it was 31 because I tested it about two or three months ago.

Yeah, somewhat recently they upped the max tag count from 31 to 63(I think it was in January).

Share this post


Link to post
Share on other sites
Lokoluna    48
7 hours ago, Zarklord said:

Yeah, somewhat recently they upped the max tag count from 31 to 63(I think it was in January).

Oh! I thought it was still 31! This changes everything.

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
Sign in to follow this