I feel like I’m about to be run off the forum, asking all these silly questions, but I have another.
Finally starting what will hopefully be the first IF I actually release. I need to create a command that lets a player crouch, then another to stand up. I got it to work. Sort of. Almost. But there’s a few strange things happening, so I need a bit of help.
Here’s the code I have so far:
[code]A person is either crouching or standing. A person is usually standing.
Understand “crouch [something]” as crouching.
Understand “stand [something]” as standing.
Crouching is an action applying to one thing.
Standing is an action applying to one thing.
Check an actor crouching:
if the actor is standing:
Now the actor is crouching;
say “You are crouching.”;
stop the action;
if the actor is crouching:
Now the actor is standing;
say “You are standing.”;
stop the action;
WhatAmI is an action applying to nothing.
Understand “stance” as WhatAmI.
Carry out WhatAmI:
say “You are now[if the player is crouching] crouching.[end if][if the player is standing] standing.”
[/code]
This works well and I can confirm it’s working with the stance command.
One thing that’s slightly annoying is you need to type “crouch self” to make it work. This makes total sense to me based on how the code is written. But is there any way to modify it so as to be able to leave the ‘self’ at the end off? I tried grabbing it before it processed (with “before crouching”) and add on a ‘self’ if it was missing, but I couldn’t get it to compile that way. Using “Crouching is an action applying to the player.” produces a compiler error. I think there’s something I don’t understand here.
It is now 3:30am and I need sleep. So, I’ll check back tomorrow morning. Thanks, everyone, for any help.
(Edited: I had two problems and noticed what was wrong as soon as I posted and fixed one of them. Edited to remove stupidity. It IS 3:30am, in my defense.)