Jump to content
Sign in to follow this  
Funkman

Dance Script - Simple Question

Recommended Posts

Hello everyone,

I actually have been around these forums for a while, I lost my password so had to create a new account.

Anyway, I want to make a movie in ArmaII and I want to use the awesome Dance Script which I have seen on YouTube.

I had a look a the wiki, and it seems to indicate that using the following playMoves will enable it:

"TestDance"

"ActsPercMstpSnonWnonDnon_DancingDuoStefan"

"ActsPercMstpSnonWnonDnon_DancingDuoIvan"

Well, I tried them in the editor and they dont work, it may only be for Armed Assault, I am not sure.

Can anyone tell me how to enable these moves in ArmaII please?

Share this post


Link to post
Share on other sites

I'm not sure they exist... if they do, you'll probably find you need to run them in an external script or spawn a thread with a small sleep at the start. I think units need a moment to initialise before they can play animations for you.

But I did go through pretty much all the animations earlier in the year to flesh out the moves list on the wiki, and don't recall coming across any dancing.

Share this post


Link to post
Share on other sites

The dance moves do work, you can get them to play one of two ways that i found out.

Option 1:

Step1: Name your unit IE: p1

Step2: Pace trigger: Detect Blufor/opfor/civi/indi (what ever faction yor unit is from)

Step3: in the trigger - onAct:

p1 playmove "ActsPercMstpSnonWnonDnon_DancingDuoIvan"; 

Option 2

Step1: Name your unit IE: p1

Step2: place waypoint where you want your unit to move to

step3: in the way point - onAct:

p1 playmove "ActsPercMstpSnonWnonDnon_DancingDuoIvan"; 

and there you go your boys are dancing machines, hope this helps. and of course you can have multipule units dancing at the same time just replace "p1" with "p2" and so on, is both the unit names, and the trigger or activation before where it says "playmove"

Share this post


Link to post
Share on other sites

Thats great guys thanks.

Woodstock, other than triggers and waypoints, can you just make a script with the same an tell the unit to exec that script as well?

Darkhorse, thanks for the links, but I actually want to create a movie where the dancing will al be scripted. So I am thinking that finding a way to script it would be best if I can manage that.

Share this post


Link to post
Share on other sites

You can simply write the commands into a script file. The syntax is the same in this case.

Share this post


Link to post
Share on other sites

Ok, ok, i see.^^

Create "dance.sqf" with a texteditor like notepad and place it in the mission folder:

p1 playmove "ActsPercMstpSnonWnonDnon_DancingDuoIvan";

And then execute the script from the editor or another script via:

nul = [] execVM "dance.sqf";

Edited by IndeedPete

Share this post


Link to post
Share on other sites

Ok gotcha thanks. Only thing, the last "nil = []" Should be "nul =" if I am not mistaken.

Share this post


Link to post
Share on other sites

The reason I posted those 2 links is because the first one is an animation viewer, and could give you a list of usable animations for your dance script. The 2nd actually has the dance action in it (i must say, people in chernarus have an odd way of dancing) and that means that you could depbo it and take a look at the necessary bits of code.

Hope all goes well with your video. I'm actually trying to make one as well, but I'm running into a laundry list of problems.

Share this post


Link to post
Share on other sites
Only thing, the last "nil = []" Should be "nul =" if I am not mistaken.

Yes you're right, assigning to 'nil' causes all kinds of strange problems.

Share this post


Link to post
Share on other sites

This is why: http://community.bistudio.com/wiki/nil

It is supposed to return Any (Value). But when you use nil = []... you're reassigning it. I.e. hint format ["%1", _undeclaredvar]; you'll get the output Any. Also, clearing a variable using _myvar = nil; no longer clears it (I believe), but sets it to whatever you defined. Also see isNil.

Hopefully I'm not too tired to have messed up this answer. Please correct me if I'm wrong or unclear.

Edit: Yeah, this basically says it all:

Never ever assign a value to nil!

Doing so creates a global variable with the same name that overrides the "command" nil:

Edited by CarlGustaffa

Share this post


Link to post
Share on other sites

Yep, yes indeed, well put everyone.

Darkhorse, thanks for the extra info, the list of animations will very likely prove useful, so I appreciate you including it for me.

I too have been running into problems, I keep making camera scripts and it skips straight to the second shot, I cant work out why.

Example:

showCinemaBorder false;

_cam = "camera" CamCreate [2396.88,4617.84,3.33];

_cam cameraeffect ["external", "front"];

_cam camsettarget [-30394.31,-83025.65,35271.69];

_cam camCommit 0;

_cam camSetTarget [-30394.31,-83025.65,35271.69];

_cam camSetPos [2396.88,4617.84,3.33];

_cam camCommit 4;

Sleep 3.95;

_cam camSetTarget [-94648.53,21416.75,17330.12];

_cam camSetPos [2397.09,4617.52,3.40];

_cam camSetFOV 0.700;

_cam camCommit 4;

Sleep 3.95;

_cam camSetTarget [-35639.53,96222.59,-12739.20];

_cam camSetPos [2397.10,4622.16,4.69];

_cam camSetFOV 0.700;

_cam camCommit 4;

The pos and target where the camera is created, as well as the second camera shot (which is the same pos and target) just does not work.

Can anyone give me a clear answer as to why this is not working?

Share this post


Link to post
Share on other sites

are you talking about the top being the first scene

showCinemaBorder false;

_cam = "camera" CamCreate [2396.88,4617.84,3.33];
_cam cameraeffect ["external", "front"];
_cam camsettarget [-30394.31,-83025.65,35271.69];
_cam camCommit 0;

and then the below being the 2nd scene that it just cuts to?

_cam camSetTarget [-30394.31,-83025.65,35271.69];
_cam camSetPos [2396.88,4617.84,3.33];
_cam camCommit 4;

If this is so the case, have you tried

changing _cam camCommit 0;

to

_cam camCommit 4:

(4 being the number of seconds you want the cam to be on that target?

Share this post


Link to post
Share on other sites

No I have not tried that yet. I could not see how that would help, but I will try it and post back...

OKOKOKOK Something is clearly wrong.

Have a look at this, it looks complicated, but actually what I am showing is not.

I have been using the following script:

showCinemaBorder false;

_cam = "camera" CamCreate [2396.88,4617.84,3.33];

_cam cameraeffect ["external", "front"];

_cam camsettarget [-30394.31,-83025.65,35271.69];

_cam cameraSetFOV 0.7;

_cam camCommit 0;

_cam camSetTarget [-43382.81,-66220.49,-53149.10];

_cam camSetPos [2943.46,4692.17,51.00];

_cam camCommit 0;

_cam camSetTarget [-34473.81,-62970.97,-63365.79];

_cam camSetPos [2873.88,4670.37,41.73];

_cam camCommit 12;

Sleep 7.99;

_cam camSetTarget [-34473.81,-62970.97,-63365.77];

_cam camSetPos [2784.45,4640.59,27.16];

_cam camCommit 12;

Sleep 7.99;

_cam camSetTarget [-97118.57,-278.60,-2403.12];

_cam camSetPos [2732.36,4618.66,1.36];

_cam camSetFOV 0.7;

_cam camCommit 12;

Sleep 7.99;

Now that works fine.

However, I want it to hit the last position, and then zoom in, so I added this at the end:

_cam camSetTarget [-97118.57,-278.60,-2403.12];

_cam camSetPos [2732.36,4618.66,1.36];

_cam camSetFOV 0.2;

_cam camCommit 12;

What I did was copy and paste the last camera, except I change the FOV setting.

Now when I add this, all of the target changes for the whole scene dissapear. That is the movement still happens, but there is no change in the camera direction, and it starts zooming right from the get-go, what is with that?

Edited by Funkman

Share this post


Link to post
Share on other sites

Not sure, but all my camera scripts are using camPrepareTarget, camPreparePos, camPrepareFOV, and camCommitPrepared. Not sure what the difference is, but the non-Prepare ones seem to be from OFP so maybe they work slightly differently?

I also use waitUntil { camCommitted _cam }; rather than just sleeping... that shouldn't matter though.

---------- Post added at 10:57 PM ---------- Previous post was at 10:55 PM ----------

P.S. You're running this in a context where sleep is permitted, yes? e.g. from execVM? Just a thought - can't see any other reason why it'd start zooming right away unless it was skipping through them.

Share this post


Link to post
Share on other sites

Ah thank you so much - I have been writing exec, not execVM - totally forgot about that. Now that makes sense...Ah big relief.

Can you tell me now why this is not working properly?

nul = execVM "Cam2.sqf"

I am calling this in the initialisation feild of the player in order to exec the camera...

----

When I call the camera through the above command, I just get this wierd still shot, where as at least before when I was calling inorrectly through the

this exec ""
it was sort of working...Can you please give me some advice as to why the script I have posted above would not be working through the execVM way of calling it? Edited by Funkman

Share this post


Link to post
Share on other sites

exec is used for running the old-style SQS scripts (line-delimited, sleep uses ~delay format instead "sleep delay;") and other differences.

execVM tends to expect a parameter so you'll probably have better luck with

nul = [] execVM "cam2.sqf"

Share this post


Link to post
Share on other sites

Thanks I was doing this but it wasnt working...Will try again, one sec.

----

Ok, I tried that.

Now here is the full script that I am using for Cam2.sqf:

showCinemaBorder false;

_cam = "camera" CamCreate [2396.88,4617.84,3.33];

_cam cameraeffect ["external", "front"];

_cam camsettarget [-30394.31,-83025.65,35271.69];

_cam cameraSetFOV 0.7;

_cam camCommit 0;

_cam camSetTarget [-43382.81,-66220.49,-53149.10];

_cam camSetPos [2943.46,4692.17,51.00];

_cam camCommit 0;

_cam camSetTarget [-34473.81,-62970.97,-63365.79];

_cam camSetPos [2873.88,4670.37,41.73];

_cam camCommit 12;

Sleep 7.99;

_cam camSetTarget [-34473.81,-62970.97,-63365.77];

_cam camSetPos [2784.45,4640.59,27.16];

_cam camCommit 12;

Sleep 7.99;

_cam camSetTarget [-97118.57,-278.60,-2403.12];

_cam camSetPos [2732.36,4618.66,1.36];

_cam camSetFOV 0.7;

_cam camCommit 12;

Sleep 3;

//Second Part

//_cam camSetTarget [-75931.83,-56459.55,-11524.77];

//_cam camSetPos [2406.73,4613.89,6.33];

//_cam camSetFOV 0.7;

//_cam camCommit 12;

//Sleep 11.9;

//_cam camSetTarget [-75931.83,-56459.55,-11524.60];

//_cam camSetPos [2399.03,4601.64,2.87];

//_cam camSetFOV 0.7;

//_cam camCommit 12;

//Sleep 11.9;

//_cam camSetTarget [-75931.83,-56459.55,-11524.59];

//_cam camSetPos [2384.43,4588.43,0.40];

//_cam camSetFOV 0.7;

//_cam camCommit 12;

Now what happens is as soon as I call with execVM, it jumps straight to that last camera that I have in bold and just sits there. Its really wierd.

---------- Post added at 04:20 AM ---------- Previous post was at 04:15 AM ----------

Incase you want to test, it is on Utes and set to Intro.

Edited by Funkman

Share this post


Link to post
Share on other sites

ll give it a look tommorow, when im done work, unless someone else beats me to the punch on that one, i would right now my work was hell and i need sleep badly

Share this post


Link to post
Share on other sites

There's no function cameraSetFov. It's camSetFov.

You should find your Arma2.rpt file and get used to looking at it if strange things happen. It's a text logfile the game creates which contains various error messages, such as from scripts.

You can also add -showScriptErrors to the arma2.exe command line in order to show them in-game.

On a Vista/Win7 system the .rpt file will live in C:\Users\username\AppData\Local\ArmA 2

Share this post


Link to post
Share on other sites

Ah, yes ta for that..

The Ill try changing that FOV command, but the funny thing is that when I used it, it would zoom to the level I wanted, just ignore all the other commands in between...

Anyway, once again I appreciate your help, I will go and check it out.

Share this post


Link to post
Share on other sites

Well man you are a lucky guy, i got up early today and looked at your cam thingy, and i see what you mean about it just staying on the last scene which is messed up and i don't really know why. But here is the good news i put all your cam stuff into a format that i learned out to use thanks to some nice tutorials out there and it seems to work just nice, and by the way if you are using that cam script on utes, some very nice shots you got there, so here is the stuff for ya

put this in the init line, I dunno why but i like to use Invisable H's for it. maybe just my preference

This exec "scene.sqs";

Save bellow as scene.sqs from notepad or whatever

titlecut ["","BLACK IN",5]
_camera = "camera" camcreate [0,0,0]
_camera cameraeffect ["internal", "back"]

;=== 18:16:59
_camera camPrepareTarget [-43382.81,-66220.49,-53149.10]
_camera camPreparePos [2943.46,4692.17,51.00]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 0
@camCommitted _camera


;=== 18:17:54
_camera camPrepareTarget [-34473.81,-62970.97,-63365.79]
_camera camPreparePos [2873.88,4670.37,41.73]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 12
@camCommitted _camera

~8

;=== 18:18:58
_camera camPrepareTarget [-34473.81,-62970.97,-63365.77]
_camera camPreparePos [2784.45,4640.59,27.16]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 12
@camCommitted _camera

~8

;=== 18:20:14
_camera camPrepareTarget [-97118.57,-278.60,-2403.12]
_camera camPreparePos [2732.36,4618.66,1.36]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 12
@camCommitted _camera

~3

;=== second part
_camera camPrepareTarget [-75931.83,-56459.55,-11524.77]
_camera camPreparePos [2406.73,4613.89,6.33]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 12
@camCommitted _camera

~12

;=== 18:47:27
_camera camPrepareTarget [-75931.83,-56459.55,-11524.60]
_camera camPreparePos [2399.03,4601.64,2.87]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 12
@camCommitted _camera

~12

;=== 22:59:22
_camera camPrepareTarget [75931.83,-56459.55,-11524.59]
_camera camPreparePos [2384.43,4588.43,0.40]
_camera camPrepareFOV 0.700
_camera camCommitPrepared 12
@camCommitted _camera

~5

titlecut ["","BLACK IN",5]
Player cameraEffect ["terminate","back"]
camDestroy _camera
ende1=true
Exit;

Now im not sure how or where you are running the cam script from, are you intending on using it for MP mission or is it just a intro for SP mission? cause at the end here i added in

ende1=true [Place a trigger on the map named ende1 with condition ende1;]

by having that on your map and in your cam sqs file, the cam will end and it will kick you back to your player. otherwise i belive the cam would just be stuck on the last scene forever. Hope this helps you out man. and again some very nice shots in your sequence.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×