fun code help..

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

User avatar
choggoba
Small-town resident
Reactions:
Posts: 29
Joined: Fri Jul 20, 2018 8:30
Location: Korea
Plugins: Show

fun code help..

Post by choggoba » Fri Sep 14, 2018 15:41

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
    }],

I love my hometown. :)

I don't speak English well. Please understand me. ;)

User avatar
ElephantEthan
Inhabitant of a Megacity
Reactions:
Posts: 183
Joined: Sun Aug 26, 2018 14:07
Plugins: Show

Re: fun code help..

Post by ElephantEthan » Fri Sep 14, 2018 15:47

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
Perhaps the smartest elephant here. :calc
I ain't playing TheoTown a lot, but when I do, I am in my city
Euife

Post Reply Previous topicNext topic

Return to “Plug-In Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests