Post new topic    
Liquid Metal Slime
Send private message
tag help 
 PostSat Nov 10, 2012 6:16 pm
Send private message Reply with quote
I'm having a very confusing problem. I hope I'm explaining it well.

When ITEM1 is in inventory, TAG1=ON. I have a text box that runs a script afterwards. This script deletes ITEM1 making TAG1=OFF, but then SETS TAG1=ON. However, it doesn't seem to work and TAG1 is still off.

Code:
The script reads: plotscript, bountykill1, begin
delete item (112)
set tag (135, on)
end


My 2nd question: In the Edit NPC menu are two "APPEAR IF TAG =" commands. Are these related by an "and" or an "or"? For instance, IF APPEAR IF TAG1 = ON and APPEAR IF TAG2 = ON are both being used. Does the NPC appear if either TAG1 and TAG2 are on of if both TAG1 and TAG2 are on?
Slime Knight
Send private message
Re: tag help 
 PostSat Nov 10, 2012 6:49 pm
Send private message Reply with quote
Willy Elektrix wrote:
I'm having a very confusing problem. I hope I'm explaining it well.

When ITEM1 is in inventory, TAG1=ON. I have a text box that runs a script afterwards. This script deletes ITEM1 making TAG1=OFF, but then SETS TAG1=ON. However, it doesn't seem to work and TAG1 is still off.

Code:
The script reads: plotscript, bountykill1, begin
delete item (112)
set tag (135, on)
end


My 2nd question: In the Edit NPC menu are two "APPEAR IF TAG =" commands. Are these related by an "and" or an "or"? For instance, IF APPEAR IF TAG1 = ON and APPEAR IF TAG2 = ON are both being used. Does the NPC appear if either TAG1 and TAG2 are on of if both TAG1 and TAG2 are on?


First: I don't know enough about scripting to solve your issue, but couldn't you remove the item and turn on tag1 in the text box itself using conditionals?

Second: It's an 'and' statement. Leaving the second APPEAR IF blank makes it rely only on the first APPEAR IF. (this is shown at the bottom of the screen when you turn both to a tag. it will read "Appears if tag * = on/off and tag * = on/off")
Red Slime
Send private message
 
 PostSat Nov 10, 2012 8:20 pm
Send private message Reply with quote
Tags that are autoset by an inventory item shouldn't be changed by plotscripting. The engine will automatically set them to be either on or off depending on if you have the item. Hence, when you set TAG1 to on in your script, the engine will immediately turn around and set TAG1 to off.

What's the purpose of the first script? Are you checking if they won an item from a battle, then if they did, removing it and trying to "remember" that they did? If you can give me a bit more detail, I can suggest an alternate design. You'll probably need to use an additional tag, though - one that gets set when the game has detected and removed the bounty item.

Also, try using HSI names for your tags. If you export the HSI from your game file in Custom under Script Management, you can import it into your script at the top with a line like:

Code:
include, projectname.hsi


Then you can use the name of the tag you set in Custom under Edit Tag Names instead of the number (helpful for both reading and writing your scripts.) It works for items too!

Code:
delete item (item:Bounty)
set tag (tag:BountyAchieved, true)

I... I still exist... somewhere.

Come join us on irc.esper.net in channel #slimesalad for help, chat, and general fun! We love company.
Metal King Slime
Send private message
 
 PostSat Nov 10, 2012 9:07 pm
Send private message Reply with quote
Quote:
Tags that are autoset by an inventory item shouldn't be changed by plotscripting. The engine will automatically set them to be either on or off depending on if you have the item.


Yes, never do this. In fact it's even worse than Minnek described: the tag will be set back to the correct (autoset) value at an unknown time (depending on the engine version, for example).
Liquid Metal Slime
Send private message
 
 PostSat Nov 10, 2012 11:22 pm
Send private message Reply with quote
Minnek wrote:
Tags that are autoset by an inventory item shouldn't be changed by plotscripting. The engine will automatically set them to be either on or off depending on if you have the item. Hence, when you set TAG1 to on in your script, the engine will immediately turn around and set TAG1 to off.


That's what I needed to know. I found a work-around. Thanks!
Display posts from previous: