i can't get my new action to work?

i made an action called casting, it works fine but it has to well action…
i can’t put a rule on the action to make it do something.

[code]“the witch” by sally

casting is an action applying to one topic and one thing.
understand “cast [text] on [something]” as casting.
understand “cast [text] on [someone]” as casting.
report casting: say “you begin to cast your magic”.

the dorm is a room. “this is your dorm in the magic school. you can see tan wallpaper on your wall”.
the dummy is a thing in the dorm.
after casting “fireball” on the dummy:
say “your hands begin to flame as a fireball forms in your palm. you then throw it at the dummy”;
now the printed name of the dummy is ashes";
now the description of the dummy is “its a pile of ashes. what looks like something has been disentigrated”.[/code]

i can’t make it so i can cast something at another thing…
that text part i used so the spells would have names like fireall…

anyway i tried many rules many way none of them worked…

usually i thought since the topic was text i’d need " " but that didnt work either … insyead of didnt work for this either and i dont know why.

im confused

There is a special syntax to declare a verb with the form “cast something ON something”. Call the verb casting it on and Inform 7 will understand that there are two parameters to the verb.

[code]casting it on is an action applying to one topic and one thing.
understand “cast [text] on [something]” as casting it on.
understand “cast [text] on [someone]” as casting it on.
report casting: say “you begin to cast your magic”.

the dorm is a room. “this is your dorm in the magic school. you can see tan wallpaper on your wall”.
the dummy is a thing in the dorm.
after casting “fireball” on the dummy:
say “your hands begin to flame as a fireball forms in your palm. you then throw it at the dummy”;
now the printed name of the dummy is “ashes”;
now the description of the dummy is “its a pile of ashes. what looks like something has been disentigrated”.
[/code]

I played around with your code and came up with this.

It looks like zombie produced a straightforward answer in the interim, but I’ll go ahead and post this anyway in case anyone finds it interesting or wants to suggest improvements.

(I’ve kept the lower-case aesthetic going.)

"the witch" by sally

a spell is a kind of thing.
fireball is a spell.
xyzzy is a spell.

casting it on is an action applying to one visible thing and one visible thing.
understand "cast [any spell] on/at [something]" as casting it on.
understand "cast [any spell] on/at [someone]" as casting it on.

report casting it on:
	say "you cast [noun] on [the second noun], but nothing obvious happens."

the dorm is a room. "this is your dorm in the magic school. you can see tan wallpaper on your wall".

a target is a kind of thing. a target can be intact or destroyed. a target is usually intact. a target has a text called the original name.
understand "pile" or "ash" or "ashes" or "pile of ashes" as a target when the item described is destroyed.
understand "piles" or "ashes" or "piles of ashes" as the plural of a target when the item described is destroyed.

before listing contents:
	group destroyed targets together.
	
rule for grouping together destroyed targets:
	say "[listing group size in words] piles of ashes".
	
after printing the name of a destroyed target while asking which do you mean:
	say " (formerly the [original name of the item described])".

the dummy is a target in the dorm.

the extremely fragile wooden puppet is a target in the dorm.

the fluffy kitten is an animal in the dorm.
understand "cat/kitty" as the kitten.

check casting fireball on:
	if the second noun is not a target:
		instead say "you can't bring yourself to do it.";
	if the second noun is destroyed:
		instead say "you've already blasted it into ashes."

carry out casting fireball on:
	now the second noun is destroyed;
	now the original name of the second noun is the printed name of the second noun;
	now the printed name of the second noun is "pile of ashes";
	now the description of the second noun is "it's a pile of ashes. what looks like something has been disintegrated."

report casting fireball on:
	instead say "your hands begin to flame as a fireball forms in your palm. you then throw it at the [original name of the second noun]."

thanks it worked, but i got an error when i was trying to create a new spell
glulxe fatal error: -something about stacking-

This usually means that your code is going to an infinite loop somehow. For instance, if you write this:

[code]Time stop is a spell.

Carry out casting time stop on: try casting time stop on the player.[/code]

then I think (I haven’t tried it) you’ll get one of those errors when the player tries to cast time stop. Because when they cast time stop on something, then the carry out rule runs and tries to get them to cast time stop on the player, and in order to do that the carry out rule runs to cast time stop on the player, and in order to do that… Eventually the interpreter can’t take it any more and crashes.

Exactly what happened probably depends on the details of how you added the spell, but I’m guessing there’s probably an infinite loop somewhere.

BTW, my extension Spellcasting is designed for exactly this type of thing. I believe it’s in the Public Library, on the Extensions tab; it’s certainly in my IDE for 6M62.