IPB


Welcome Guest ( Log In | Register )

 Forum Rules ArmedAssault.info Forum Rules
 
Reply to this topicStart new topic
> Script Help
Red Star Elite
post Mar 3 2011, 00:04
Post #1


Member
***

Group: Members
Posts: 43
Joined: 6-April 09
From: Milton Keynes, United Kingdom
Member No.: 5,491



Hey guys

Can someone tell me how to take an animation script and loop it so it doesn't end? Any help would be much appreciated

Thanks thumbsup.gif
 
Quote Post
D@V£
post Mar 3 2011, 01:28
Post #2


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



If you know the exact length of the animation, just use a simply script to loop it:
CODE
#start
Soldier playmove anim
~15
goto start

(sqs format)
or
CODE
while {true} do
{
    Soldier playmove anim
    sleep 15;
};

(sqf format)

The sqs format is easier to get working, but the sqf one will save you a lot of headaches down the line, especially if you don't want your soldier repeating the animation 'til the cows come home! ohnoo.gif


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
Red Star Elite
post Mar 3 2011, 01:59
Post #3


Member
***

Group: Members
Posts: 43
Joined: 6-April 09
From: Milton Keynes, United Kingdom
Member No.: 5,491



Oh okay, and is do they have to be in a notepad document saved in the mission folder? Or can I just write it in the 'On Act' box?
 
Quote Post
D@V£
post Mar 3 2011, 11:18
Post #4


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



You'll need to save it in notepad, there's a lot of functions there that won't work in the more primitive language used by the editor.

I forgot to mention, to change the delay with the script, change this:
CODE
~15

for the sqs format, and this:
CODE
sleep 15;

for the sqf one. Both times are in seconds.


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
Red Star Elite
post Jun 19 2011, 13:30
Post #5


Member
***

Group: Members
Posts: 43
Joined: 6-April 09
From: Milton Keynes, United Kingdom
Member No.: 5,491



I take it saving it in the notepad within the mission file isn't all that is needed? I've tried that but the loop doesn't activate. My apologies for being a total noob to this stuff lol, i've been away for a while
 
Quote Post
D@V£
post Jun 19 2011, 15:37
Post #6


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



Ok, step by step:

1. Find your mission's folder (this should be either "My Documents > ArmA 2 > missions > missionname" or "My Documents > ArmA 2 Other Profiles > YourProfile > missions > missionname")
2. Write the script in notepad
3. Save the script as either an .sqs or .sqf file in your mission folder (make sure it's actually saved as an .sqs or .sqf file! Some people don't realize they're saving their scripts something like "Myscript.sqs.txt", as windows sometimes hides the .txt extension!)
4. In the editor, start the script by using either the exec or execVM command. (as a general rule, use exec for sqs and simple sqf scripts, and execVM for any sqf script that has loops)

And that should be it! Note you don't need to close ArmA to do any of this.


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
scorch
post Jun 19 2011, 19:34
Post #7


New Member
*

Group: Members
Posts: 5
Joined: 19-June 11
Member No.: 9,053



sorry to ask you this, but im having the same problem. i know where to place the file etc, but i dont know how to write it out? if that makes sense?
 
Quote Post
D@V£
post Jun 19 2011, 21:22
Post #8


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



I'm afraid that doesn't make much sense... are you asking about running the scripts ingame? Just use:
CODE
exec "myscript.sqs"

(Obviously, replace "myscript.sqs" with the name of your script!)


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
scorch
post Jun 19 2011, 22:51
Post #9


New Member
*

Group: Members
Posts: 5
Joined: 19-June 11
Member No.: 9,053



okay heres what ive done;

ive created the notepad file and all thats in it is;

#start
RUS3 switchMove ActsPercMstpSnonWnonDnon_talking01a
~45
goto start

what i mean in is there anything else that is needed with that? like another part of the script to be written in there?

by the way thats saved in my mission folder as an .sqs file
 
Quote Post
D@V£
post Jun 20 2011, 00:17
Post #10


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



I don't think you need anything else, are you getting any errors?


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
scorch
post Jun 20 2011, 13:51
Post #11


New Member
*

Group: Members
Posts: 5
Joined: 19-June 11
Member No.: 9,053



no there's no errors, infact it stops the animation from happening at all
 
Quote Post
D@V£
post Jun 21 2011, 00:27
Post #12


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



Try this:
CODE
#start
Hint "the script is running"
RUS3 switchMove "ActsPercMstpSnonWnonDnon_talking01a"
~45
goto start


You should get a message come up, if the script is running correctly. Which means the problem is with the way you're calling the switchmove command.


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
scorch
post Jun 22 2011, 17:55
Post #13


New Member
*

Group: Members
Posts: 5
Joined: 19-June 11
Member No.: 9,053



okay that scripts working now, it was a playmove instead of a switchmove. it still doesnt loop? after saving that in the mission folder ive placed a trigger over the unit and put in the on act box this:

RUS3 exec "loop1.sqs" (name of the script file)

is that correct?
 
Quote Post
D@V£
post Jun 22 2011, 22:52
Post #14


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



You shouldn't need to reference RUS3 when calling the script (as he's hard coded in the script itself, you could call it with any arguments, and it'll still only effect RUS3), other than that, it should be working... check the "~45" line, the playmove can be a bit iffy if the soldier hasn't finished another animation he's already been told to do!

Failing all else, use sqf format scripts, they're a bit more of a pain to get working, but they tend to work a lot better! ohnoo.gif


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post
scorch
post Jun 25 2011, 14:04
Post #15


New Member
*

Group: Members
Posts: 5
Joined: 19-June 11
Member No.: 9,053



ive finally got it to work! thanks for the help D@VE thumbsup.gif
 
Quote Post

Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 29th March 2024 - 06:04