 
 Hi!  I'm trying to make a macro for Banishment that can place multiple SmartAoE tokens when the spell is upcast. Instead of having the player click the macro multiple times to produce several tokens in case they upcast, I wanted to use a branch within ScriptCards to determine how many SmartAoE tokens should be created - depending on spell level.   I've tried running the called SmartAoE script on its own, and it works as intended. But when I call it from ScriptCards, it produces the error "SmartAoE: You must either select a token or pass the tokenID via --selectedID". In an attempt to fix the error and find something that works, I've tried replacing "@{selected|token_id}" within _selectedID| with [*S:token_id], [*S:character_id], the players token ID string, and  the players character ID string.   I've also tried putting all the commands within --@smartaoe on the same line, with a space between the end of each command and the start of the next one. None of them have solved the issue.    Can anyone point out that I'm either doing something wrong, or if what I'm trying is even possible?   Here's the source code:  !scriptcards {{
+++dnd5elib+++
--/| Queries
  --/|Query Spell Slot
    --=Cast|?{Cast at what level?|4|5|6|7|8|9}
  --/|Lookup Spell Level
    --C[$Cast.Raw]|4:&Level;4th Level|5:&Level;5th Level|6:&Level;6th Level|7:&Level;7th Level|8:&Level;8th Level|9:&Level;9th Level
  --/|Lookup Mana Cost
    --C[$Cast.Raw]|4:=Mana;6|5:=Mana;7|6:=Mana;9|7:=Mana;10|8:=Mana;11|9:=Mana;13
  --/|Number of Targets
	--C[$Cast.Raw]|4:=Targets;1|5:=Targets;2|6:=Targets;3|7:=Targets;4|8:=Targets;5|9:=Targets;6
--/| Spell name, title card design, and other necessary variables
	
	--#title|Banishment
	--#titlecardbackground|PlayerColor
	--#rightsub|The spell was cast at [&Level]
	--#sourceToken|@{selected|token_id}
	--#emoteState|hide
	--=Count|1
	
--/| Mana cost
	
	--/|@modbattr| _silent _charid CharacterID _other_resource|-[$Mana] !!!
	
--/| Outcome | req. updates: damage die, damage mod
	--+|[j]You spent [$Mana] spell points on the spell.[/j]
	--+|[j]Charisma DC [*S:spell_save_dc] saving throw.[/j]
	--+|[j]You targeted [$Targets] creature(s).[/j]
	
	--:TargetLoop|
		-->TargetSelect|
		--=Count|[$Count] + 1
		--?[$Count] -le [$Targets]|TargetLoop
	--X|
	
	--:TargetSelect|
		--@smartaoe| 
			_title|Banishment
			_titlecardbackground|#555555
			_oddrowbackground|#d0e4f5
			_evenrowbackground|#eeeeee
			_selectedID|@{selected|token_id}
			
			_aoeColor|#55555575
			_aoeOutlineColor|#00000000
			_aoeType|square, float
			_radius|3ft
			
			_controlTokName|AoEControlToken
			_controlTokSize|1
			_origin|nearest, face
			_minGridArea|0.55
			_forceIntersection|0
			_instant|1
			_fx|burn-magic
			
			_dc|99
			_saveFormula|5eCHA
			_conditionFail|5488146::Inspired
			_autoApply|yes
	--<|
	
}}  Thanks in advance! Jakob B. From   
 
				
			 
 
