Home   Help Search Login Register  

Author Topic: Help on sripts  (Read 1594 times)

0 Members and 1 Guest are viewing this topic.

marcus3

  • Guest
Help on sripts
« on: 22 Dec 2004, 14:52:43 »
Hi. I am WAY NEW to this stuff so i need some help.
i have written a script that makes time stop but when I click the actoin butten nothing happens so somebody help please.
 ??? :-[

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re:Help on sripts
« Reply #1 on: 22 Dec 2004, 15:44:13 »
Need a little bit more information to help you  ;D Post your script and any error messages
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Lean Bear

  • Guest
Re:Help on sripts
« Reply #2 on: 22 Dec 2004, 17:11:48 »
I'm assuming that you made a script that is to be activated by an action in-game to make time stop.

(btw why did you do this? The result would make everything stop and the only options would be then to restart time or exit the game :P)

A script to do this should be something like this:

First, in the init.sqs :

StopTime = player AddAction ["Stop Time!!", "stoptime.sqs"]

Then, in stoptime.sqs :

setAccTime 0 // although I'm not sure about this, I think this syntax only accepts values from 1 - 4.



bored_onion

  • Guest
Re:Help on sripts
« Reply #3 on: 22 Dec 2004, 17:22:11 »
you can almost any value for setacctime. the most interesting is -1 which messes with your head.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Help on sripts
« Reply #4 on: 22 Dec 2004, 17:24:59 »
I never thought of using a negative number.  I must look at that.

marcus3

  • Guest
Re:Help on sripts
« Reply #5 on: 24 Dec 2004, 15:31:32 »
here it is.
; A script that slows down time
SetAccTime 0.1; playMusic "7thfly";
then i make a add action trigger but after its activated and i click it......NOTHING.
p.s sorry for replying so late i have been busy ;D

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Help on sripts
« Reply #6 on: 24 Dec 2004, 16:46:41 »
Have you tested it as simple trigger?  It could be the way the addaction is set up.

Lean Bear

  • Guest
Re:Help on sripts
« Reply #7 on: 24 Dec 2004, 18:31:49 »
Check your syntax.

If it looks like what you've posted it'll never work.

In the script it should read:

SetAccTime 0.1

playMusic "7thfly"

exit


Then, in your trigger, it should look something like this:

player addAction ["Slow Down Time", "YourScriptName.sqs"]

Just to add (you may have done this to save space) but in scripts if you put ";" (without quotations) it makes it void like "//" (without quotations. That's why I say that if it's laid out like that in your script, it won't work.

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Help on sripts
« Reply #8 on: 24 Dec 2004, 20:44:06 »
Actually, ';' is used to separate two commands and will work fine, for instance:

this setbehaviour "careless"; this flyinheight 20

Two separate commands which will be executed one after the other.


Planck
I know a little about a lot, and a lot about a little.

Lean Bear

  • Guest
Re:Help on sripts
« Reply #9 on: 24 Dec 2004, 22:57:37 »
Isn't that only in triggers though?

If you do that in a script it should be ":", right?
« Last Edit: 24 Dec 2004, 23:22:11 by Lean Bear »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Help on sripts
« Reply #10 on: 24 Dec 2004, 23:19:40 »
Quote
Isn't that only in trigegrs though?
Nope...

; is called 'end of line'...

In sqs if there's no ; after some argument/whatever line the 'converter' (in OFP engine) then treats the the line ended...
And that is used to separate different things on one line, so Planck is right..
Only things that can't be separated with ; are the if/then sentences and the ~
delay...

In sqf you need to use ; after every single 'closed' line...

: means the same as 'then' and can only be used in if/then sentence which is usually in sqs something like
? stuff: that=true...
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

marcus3

  • Guest
Re:Help on sripts
« Reply #11 on: 25 Dec 2004, 21:42:26 »
ok i made a script thats says.

SetAccTime 0.1

playMusic "7thfly"

exit

then saved it as [time.sqs] then in the trigger i put
player addAction ["Slow Down Time", "time.sqs"]
then the same thng happend.......NOTHING. i dont know whats happening >:( but can somebody post a working script for me?
 ;D

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Help on sripts
« Reply #12 on: 25 Dec 2004, 22:16:08 »
Did you put your script.....time.sqs......inside your mission folder?

EDIT:  Shouldn't that be:

playMusic "7thIamGonaFly"


Planck
« Last Edit: 25 Dec 2004, 22:36:13 by Planck »
I know a little about a lot, and a lot about a little.

marcus3

  • Guest
Re:Help on sripts
« Reply #13 on: 26 Dec 2004, 00:35:35 »
yup

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Help on sripts
« Reply #14 on: 26 Dec 2004, 00:51:57 »
Please re-read my last post.


Planck
I know a little about a lot, and a lot about a little.