Action that can only be used by the author, not the player

#1

Hi everyone,

To start off, I want to introduce what I’m trying to create. I though it would be a fun experiment to completely re-create a Pokemon game in Inform 7. Obviously the world building is relatively simple - the tricky bit is building the stat formulas and the AI, but I’m confident!!

Anyway, my first step was to come up with a way to change a template Pokemon (a kind of animal) into any other Pokemon that I want. To do this, I’ve created an action that adjusts its stats:

Altering is an out of world action applying to one thing and one number. Understand "alter [pokemon] to [a number]" as altering. Carry out altering: now the Dex of the noun is the number understood; now the Name of the noun is the tName corresponding to a tDex of the number understood in the Table of Pokemon Stats; now the Base_HP of the noun is the tB_HP corresponding to a tDex of the number understood in the Table of Pokemon Stats; now the Base_Atk of the noun is the tB_Atk corresponding to a tDex of the number understood in the Table of Pokemon Stats; now the IV_HP of the noun is a random number between 0 and 31; now the IV_Atk of the noun is a random number between 0 and 31; now the True_Nat of the noun is a random Nature; now the Nat_Atk of the noun is the tAtk corresponding to a tNat of the True_Nat of the noun in the Table of Pokemon Natures; now the True_HP of the noun is ((((Base_HP * 2) + IV_HP + (EV_HP / 4)) * Level) / 100) + Level + 10; now the True_Atk of the noun is ((((((Base_Atk * 2) + IV_Atk + (EV_Atk / 4)) * Level) / 100) + 5) * Nat_Atk) / 10.

(That’s stripped back a bit to save space, because the other 4 stats are the same formulas as Atk)

This works absolutely perfectly - I’m able to launch the game and change my template Pokemon into anything I like. The problem is, I don’t want this action to be able to be used by the player. Maybe the chances that a player will find and use that action are pretty slim, but I’d like to cover all bases. How do I make it so that I can call this action when I’m writing the story, but the player is unable to perform it when playing the game?

Thanks in advance. :slight_smile:

#2

You probably want to check out this: inform7.com/learn/man/WI_11_2.html

And make it a phrase instead of making it an action. :slight_smile:

#3

Taking some more info from here: ifwiki.org/index.php/Inform_ … ers/Part_2

I’ve come up with this example of “To…” that also accepts a number as an argument:


The cornfield is a room. "A lovely place to watch corn grow.".

The cage is an enterable container in the cornfield. "An obvious trap".

To spring the trap to (mynum - number):
	say "'Sproing!' go the [mynum] hinges and, with a flash of silver, the enormous blades whisk together!";
	end the story.
	
Instead of entering the cage:
	spring the trap to 5. 

Example output:

cornfield
A lovely place to watch corn grow.

An obvious trap

>spring trap to 5
That's not a verb I recognise.

>enter cage
"Sproing!" go the 5 hinges and, with a flash of silver, the enormous blades whisk together!



    *** The End ***
#4

Thank you so much @howtophil, that’s exactly what I’m looking for!

#5

You’re welcome :slight_smile:

(Andrew Plotkin) #6

A phrase is the simplest solution.

However, just so you know: if you don’t write an Understand line for an action, the player will have no way to trigger the action.