fun code help..

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

User avatar
choggoba
Townsman
Reactions:
Posts: 50
Joined: 20 Jul 2018, 08:30
Location: Korea
Plugins: Showcase Store

Platform

fun code help..

#1

Post by choggoba »

Thank you for always being kind to me.



my intention:

when
cityRotation =0 and build road sign5(road deco)

=> set $rn_choggoba = 1

but $rn_choggoba does not change... :cry:




Code: Select all

"fun":
    [{
	 "condition":
        {
          "type":"and","inner":[
            {"type":"value","code":"cityRotation","z":0},   
            {"type":"building","id":"road sign5"}]
			
        },
	
	 "actions":[{"type":"set","id":"$rn_choggoba","code":"1"}],
	
	"always":true
    }],


User avatar
ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 294
Joined: 26 Aug 2018, 14:07
Plugins: Showcase Store

Platform

Re: fun code help..

#2

Post by ElephantEthan »

Code: Select all

"fun":
    [{
	 "condition":
        {
          "type":"and","inner":[
            {"type":"value","code":"cityRotation","z":0},   
            {"type":"building","id":"road sign5"}]
			
        },
	
	 "actions":[{"type":"set","id":"$rn_choggoba","code":"1-$rn_choggoba"}],
	
	"always":true
    }],

Try this, it will set the variable to 1, using it again afterwards will set it to 0 then 1 etc. To read, use the same way like you did with city rotation.

Code: Select all

            {"type":"value","code":"$rn_choggoba","z":1}

Variables are weird to work with, I had a lot of trouble with them. @choggoba

Post Reply Previous topicNext topic

Return to “Plug-In Discussion”