Condition Index

Any information about the fun attribute is given here.

Moderator: Plugin Moderators

User avatar
Imran M
Inhabitant of a Conurbation
Reactions:
Posts: 492
Joined: Wed Oct 24, 2018 13:41
Plugins: Show
Phone model: Huawei p8 lite

Platform

Plugin Creator

Re: Condition Index

#21

Post by Imran M » Sun Feb 10, 2019 14:16

So rnd picks a number from 0-9, min and max means a range of numbers it can choose. would i put action, then type:frame, and frame:x? Is this correct?
https://m.youtube.com/watch?v=AqpYHdv3S00 gives 404 error.

User avatar
Lobby
Developer
Reactions:
Posts: 3345
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Condition Index

#22

Post by Lobby » Sun Feb 10, 2019 17:12

The result of the condition will only be true if min <= x <= max is fulfilled.
x will be a randomly picked integer between 0 and frame exclusively (namely 0, 1, 2, ..., frame - 1).

Yes, you set frames by something like

Code: Select all

{"type":"frame","frame":0}
However that's for building animations, only. For animations appended to a building (that means by using the "animation" attribute and some pre-defined animation(s)) you have to use the animation control attributes.

Namely you can use

Code: Select all

{"type":"animation resume","frame":0,"level":0} 
to set the frame of the first appended animation (indicated by "level":0) to 0. Use "type":"animation resume" to set a frame of an animation without pausing it.
...Have a nice stay

User avatar
Imran M
Inhabitant of a Conurbation
Reactions:
Posts: 492
Joined: Wed Oct 24, 2018 13:41
Plugins: Show
Phone model: Huawei p8 lite

Platform

Plugin Creator

Re: Condition Index

#23

Post by Imran M » Sun Feb 10, 2019 17:37

Lobby wrote:
Sun Feb 10, 2019 17:12
The result of the condition will only be true if min <= x <= max is fulfilled.
x will be a randomly picked integer between 0 and frame exclusively (namely 0, 1, 2, ..., frame - 1).

Yes, you set frames by something like

Code: Select all

{"type":"frame","frame":0}
However that's for building animations, only. For animations appended to a building (that means by using the "animation" attribute and some pre-defined animation(s)) you have to use the animation control attributes.

Namely you can use

Code: Select all

 {"type":"animation resume","frame":0,"level":0} 
to set the frame of the first appended animation (indicated by "level":0) to 0. Use "type":"animation resume" to set a frame of an animation without pausing it.
So, would the code be along the lines of this?

Code: Select all

 "fun":{"condition":{"type":"rnd","min":1,"max":3,"frame":0},"action":{"type":"animation resume","frame":0,"level":0},"condition":{"type":"rnd","min":4,"max":10,"frame":0},"action":{"type":"animation resume","frame":1,"level":0}}
https://m.youtube.com/watch?v=AqpYHdv3S00 gives 404 error.

User avatar
CommanderABab
AB
Reactions:
Posts: 7709
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Condition Index

#24

Post by CommanderABab » Sun Feb 10, 2019 18:51

Imran M wrote:
Sun Feb 10, 2019 17:37
Lobby wrote:
Sun Feb 10, 2019 17:12
The result of the condition will only be true if min <= x <= max is fulfilled.
x will be a randomly picked integer between 0 and frame exclusively (namely 0, 1, 2, ..., frame - 1).

Yes, you set frames by something like

Code: Select all

{"type":"frame","frame":0}
However that's for building animations, only. For animations appended to a building (that means by using the "animation" attribute and some pre-defined animation(s)) you have to use the animation control attributes.

Namely you can use

Code: Select all

 {"type":"animation resume","frame":0,"level":0} 
to set the frame of the first appended animation (indicated by "level":0) to 0. Use "type":"animation resume" to set a frame of an animation without pausing it.
So, would the code be along the lines of this?

Code: Select all

 "fun":{"condition":{"type":"rnd","min":1,"max":3,"frame":0},"action":{"type":"animation resume","frame":0,"level":0},"condition":{"type":"rnd","min":4,"max":10,"frame":0},"action":{"type":"animation resume","frame":1,"level":0}}

Code: Select all

 "fun": {
 	"condition": {
 		"type": "rnd",
 		"min": 1,
 		"max": 3,
 		"frame": 0
 	},
 	"action": {
 		"type": "animation resume",
 		"frame": 0,
 		"level": 0
 	},
 	"condition": {
 		"type": "rnd",
 		"min": 4,
 		"max": 10,
 		"frame": 0
 	},
 	"action": {
 		"type": "animation resume",
 		"frame": 1,
 		"level": 0
 	}
 }
is wrong.
759!759Currently using beta 759. 759 What's new? :)
way to make fence!!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
Imran M
Inhabitant of a Conurbation
Reactions:
Posts: 492
Joined: Wed Oct 24, 2018 13:41
Plugins: Show
Phone model: Huawei p8 lite

Platform

Plugin Creator

Re: Condition Index

#25

Post by Imran M » Sun Feb 10, 2019 19:26

CommanderABab wrote:
Sun Feb 10, 2019 18:51
Imran M wrote:
Sun Feb 10, 2019 17:37
Lobby wrote:
Sun Feb 10, 2019 17:12
The result of the condition will only be true if min <= x <= max is fulfilled.
x will be a randomly picked integer between 0 and frame exclusively (namely 0, 1, 2, ..., frame - 1).

Yes, you set frames by something like

Code: Select all

{"type":"frame","frame":0}
However that's for building animations, only. For animations appended to a building (that means by using the "animation" attribute and some pre-defined animation(s)) you have to use the animation control attributes.

Namely you can use

Code: Select all

 {"type":"animation resume","frame":0,"level":0} 
to set the frame of the first appended animation (indicated by "level":0) to 0. Use "type":"animation resume" to set a frame of an animation without pausing it.
So, would the code be along the lines of this?

Code: Select all

 "fun":{"condition":{"type":"rnd","min":1,"max":3,"frame":0},"action":{"type":"animation resume","frame":0,"level":0},"condition":{"type":"rnd","min":4,"max":10,"frame":0},"action":{"type":"animation resume","frame":1,"level":0}}

Code: Select all

 "fun": {
 	"condition": {
 		"type": "rnd",
 		"min": 1,
 		"max": 3,
 		"frame": 0
 	},
 	"action": {
 		"type": "animation resume",
 		"frame": 0,
 		"level": 0
 	},
 	"condition": {
 		"type": "rnd",
 		"min": 4,
 		"max": 10,
 		"frame": 0
 	},
 	"action": {
 		"type": "animation resume",
 		"frame": 1,
 		"level": 0
 	}
 }
is wrong.
So how should I do this? I'm clueless to fun.
https://m.youtube.com/watch?v=AqpYHdv3S00 gives 404 error.

User avatar
Imran M
Inhabitant of a Conurbation
Reactions:
Posts: 492
Joined: Wed Oct 24, 2018 13:41
Plugins: Show
Phone model: Huawei p8 lite

Platform

Plugin Creator

Re: Condition Index

#26

Post by Imran M » Sun Feb 10, 2019 19:52

Wait a minute, would this work?

Code: Select all

 "fun":{"condition":{"type":"rnd","min":0,"max":3,"frame":0},"action":{"type":"animation resume","frame":1,"level":0},"else action":{"type":"animation resume","frame":1,"level":1}} 
The condition is what number it is from the range, the action resumes with the first animation, if the number doesn't match a number from the range, it uses the second animation and flys safely, am I right? I think I haven't used frames correctly
https://m.youtube.com/watch?v=AqpYHdv3S00 gives 404 error.

User avatar
CommanderABab
AB
Reactions:
Posts: 7709
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Condition Index

#27

Post by CommanderABab » Sun Feb 10, 2019 22:21

Code: Select all

[{
	"fun": {
		"condition": {
			"type": "rnd",
			"min": 0,
			"max": 3,
			"frame": 0
		},
		"action": {
			"type": "animation resume",
			"frame": 1,
			"level": 0
		},
		"else action": {
			"type": "animation resume",
			"frame": 1,
			"level": 1
		}
	}
}]
which one is the pause? (Nevermind!)
759!759Currently using beta 759. 759 What's new? :)
way to make fence!!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
CommanderABab
AB
Reactions:
Posts: 7709
Joined: Tue Jun 07, 2016 21:12
Plugins: Show
Version: Beta

Platform

Plugin Creator

Re: Condition Index

#28

Post by CommanderABab » Sun Feb 10, 2019 22:27

Code: Select all

[{
	"fun": [{
		"condition": {
			"type": "rnd",
			"min": 0,
			"max": 3,
			"frame": 0
		},
		"action": {
			"type": "animation resume",
			"frame": 1,
			"level": 0
		},
		"else action": {
			"type": "animation resume",
			"frame": 1,
			"level": 1
		}
	}]
}]
759!759Currently using beta 759. 759 What's new? :)
way to make fence!!
:)

Telegram - t.me/
🆎️🆎️🆎️🆎️Commander🆎️🆎️

User avatar
Imran M
Inhabitant of a Conurbation
Reactions:
Posts: 492
Joined: Wed Oct 24, 2018 13:41
Plugins: Show
Phone model: Huawei p8 lite

Platform

Plugin Creator

Re: Condition Index

#29

Post by Imran M » Fri Feb 15, 2019 12:58

CommanderABab wrote:
Sun Feb 10, 2019 22:27

Code: Select all

[{
	"fun": [{
		"condition": {
			"type": "rnd",
			"min": 0,
			"max": 3,
			"frame": 0
		},
		"action": {
			"type": "animation resume",
			"frame": 1,
			"level": 0
		},
		"else action": {
			"type": "animation resume",
			"frame": 1,
			"level": 1
		}
	}]
}]
So would this be the correct code?
https://m.youtube.com/watch?v=AqpYHdv3S00 gives 404 error.

User avatar
Lobby
Developer
Reactions:
Posts: 3345
Joined: Sun Oct 26, 2008 12:34
Plugins: Show
Version: Beta
Phone model: S7 edge

Platform

Re: Condition Index

#30

Post by Lobby » Fri Feb 15, 2019 14:16

Imran M wrote:
Sun Feb 10, 2019 14:16
So rnd picks a number from 0-9, min and max means a range of numbers it can choose. would i put action, then type:frame, and frame:x? Is this correct?
No, it picks a number from 0 to (frame-1), so you'd have to change at least the value of frame:

Code: Select all

"condition": {
  "type": "rnd",
  "min": 0,
  "max": 3,
  "frame": 10
}
Please test the code and if it doesn't work as intended then let us know what exactly you expected and what happened instead.
...Have a nice stay

Post Reply Previous topicNext topic

Return to “Fun attribute”