Home   Help Search Login Register  

Author Topic: Addaction, Remove Action  (Read 539 times)

0 Members and 1 Guest are viewing this topic.

RunAwayScientist

  • Guest
Addaction, Remove Action
« on: 08 Feb 2003, 20:09:11 »

    We've all (almost all) seen it before, in RTS (Real Time Strategy) for OFP. Fun game that was...

      In the RTS, in the actions menu, it had an option that said "Show Options". When you clicked on that, it showed a bunch of new Actions, and it "closed" the "Show Options" command, and a new command became available: "Close Options".

     When you hit "Close Options", all the Options go away, and "Close OPtions" disappears, and "Show Options" comes back. You can do this for an unlimited number of times, and it continues to work....
 
    My question is: "How did he do that?!?!". How can you, like the example, be able to have those actions repeatly come and go, and come and go, and come back again. I've tried my own methods, me not being an expert scripter, more of a Intermediate, and it doesn't seem to work. My previous command was this:

    #ShowOptions
Removeaction 0;
Player1 AddAction ["(Close Options)", "CloseOptions.sqs"];
exit

      The problem was, that as you create an action, it assigns it a number. When the game starts, ShowOptions is assigned as 0, and Close Options in 1. If I hit Show OPtions, then Close Options, then Show Options, it wouldn't get rid of "ShowOptions". So then I'd have 1 Show Option (Extra) on my Action Menu.

      So, how do I do it? Is it a mathmatical calculation?:

N = N + 1;
RemoveAction N;
this Addaction ["(Close Options)", "CloseOptions.sqs"];
exit

  #Condfused
    RunAwayScientist globalchat "?!?!??!?...";
    exit


       If anyone has any idea or input, I'll be here all week...Heh heh....

    -RunAwayScientist (Left is not always right, right?)

RunAwayScientist

  • Guest
Re:Addaction, Remove Action
« Reply #1 on: 11 Feb 2003, 07:05:27 »


   Aww, come on now, I know this is Editorial 101. I know the Addaction, and Removeaction commands, but like I stated (I'm not over rated! Boo yeah!) I know both the commands, just want to know if there is a way to continously make the number at the end of RemoveAcion update...

    Hey, if you didn't understand me, I said send me a message...Which, happens alot yet I have 0 Messages....Py Jingo!

        I hope this dose not disturb the rest of your toilets....

   -RunAwayScientist

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Addaction, Remove Action
« Reply #2 on: 11 Feb 2003, 09:45:24 »
Hey there, RunAwayScientist

Instead of giving your action a number (and getting confused with all the other numbers out there ;)), you can give it a name. eg.:

Closeopt = Player1 AddAction ["(Close Options)", "CloseOptions.sqs"];

Then you can use:

Player1 removeaction Closeopt

to get rid of it when you're finished with it...

RunAwayScientist

  • Guest
Re:Addaction, Remove Action
« Reply #3 on: 12 Feb 2003, 04:34:27 »



                                          !

                          I love you Sui man! Err...Not literally...Really, not Literally...Oh you think I'm gay now eh? C'mon, I'll be here all week...Again...Eating Cherry Pie on the Can...Wait, does the Can refer to a Soda Can, or a Can-Can (I think I can!)? There's too many cans...

  RunAwaySci list "Cans";
  RunAwaySci exec "BlowUp.sqs";
  RunAwaySci exec "Just Kiddin'.sqs";
  RunAwaySci globalchat "BOOM!";
  RunAwaySci globalchat "Just kiddin'...";
  RunAwaySci globalchat "Heh, I didn't even need to script it...wait, did that bomb have a timer? Uh oh...";
  RunAwaySci action ["(Open Cell Phone)"];
  RunAwaySci action ["(Call Mommy)"];
  RunAwaySci globalchat "MOMMMIIIII!!!!!";
  RunAwaySci AskChat "Do I really need ";" at the end of my commands in a scrip? I mean, it's like a huge activation field, right? Right?!!!!";
  RunAwaySci exec "End;.sqs";


        Ehhh, I just kind of got a little creative there, with all the numbers  ;) and all...Ow, my eye hurts. I can't make it stop! I can't make it stop! AHHH!  ;)

      Thanks for your help Sui, all hail and praise the might Sui...Heh heh, Sui Corn, Sui Potatoes, Candy is Sui. Sui is kind of like "Sweet", but more Mexican/Spainish/Canadian/American/Black/Japaneese/PyJingo type language...Ehh, don't ask me, he's the Mexican/Spainish/Canadian/American/Black/Japaneese/PyJingo  person.

        -RunAwayScientist