Jump to content
Sign in to follow this  
dealman

Life RPG - Ride in Back

Recommended Posts

I've seen that quite a lot of Life RPG servers are now using a script where as it enabled players to ride in the back of vehicles via the use of attachTo. I've been wanting to get this to work on one of my missions, to see how it would work out.

However, I am having severe trouble getting it to work. I can't seem to figure out what the dependencies for the script are since it's not returning any errors or warnings, but refuses to work...

This is the script - Pastebin.

I tried using the scriptDone function to see if it actually initializes properly(I assume you can use scriptDone like that?) and it returns my dialog message into the RPT file after it was done. Yet I get no option to get in the back of the Urals.

After lurking around and checking every single file of the Life RPG mission, I found that one file had some functions containing "mounted" in them. Which can be found in this file. But this script doesn't seem to be executed anywhere. I'm so confused... :(

Does anyone have any idea how to get this to work? Any help would be utmost appreciated :)

Share this post


Link to post
Share on other sites

The original script is executed in the Init.sqf:

Line 141: 	[] ExecVM "Awesome\MountedSlots\functions.sqf";

The second script is executed in Awesome\MyStats\functions.sqf

Line 366: 	_h = [] execVM "Awesome\Functions\vehicle_functions.sqf";

Notepad++ has a "find in files" function that allows you to search through all the files in a folder (and subfolders) for a word or phrase. Very handy for this kind of thing.

I might look at this more tomorrow if I remember to...

Edited by Harzach

Share this post


Link to post
Share on other sites

Hey, thanks for the reply! So I added this into my init.sqf;

_h = [] execVM "MountedSlots\functions.sqf";
waitUntil{scriptDone _h};

_h = [] execVM "Functions\vehicle_functions.sqf";
waitUntil{scriptDone _h};

_h = [] execVM "R3F_ARTY_AND_LOG\init.sqf";
waitUntil{scriptDone _h};

But I am still not getting the option to ride in the back of the Ural, and there are no errors or warnings in the RPT Log... I also tried to use the searching via Notepad++ as you suggested but couldn't find anything other than some script to check if there was a armed occupant mounted in the vehicle, which I doubt is a necessity since there was no other code in that file related to this...

However, R3F is working perfectly so it got that for... :P

Share this post


Link to post
Share on other sites

Not sure why you're defining those with local variables in the Init.sqf.

[] execVM "MountedSlots\functions.sqf";
waitUntil{scriptDone _h};

[] execVM "Functions\vehicle_functions.sqf";
waitUntil{scriptDone _h};

[] execVM "R3F_ARTY_AND_LOG\init.sqf";
waitUntil{scriptDone _h};

This is, of course, predicated on the notion that you have folders named "MountedSlots", "Functions", and "R3F_ARTY_AND_LOG" in your mission's root folder, with the relevant scripts contained therein. Also, I can't say that either of the second two will initialize properly from the Init.sqf, particularly since at least "...\vehicle_functions.sqf" was originally called from within another script and might rely upon variables defined there.

Share this post


Link to post
Share on other sites
Not sure why you're defining those with local variables in the Init.sqf.

This is, of course, predicated on the notion that you have folders named "MountedSlots", "Functions", and "R3F_ARTY_AND_LOG" in your mission's root folder, with the relevant scripts contained therein. Also, I can't say that either of the second two will initialize properly from the Init.sqf, particularly since at least "...\vehicle_functions.sqf" was originally called from within another script and might rely upon variables defined there.

I do have the folders MountedSlots and Functions, the script that was inside MyStats which in return initialized the script vehicle_functions.sqf was removed, and I decided to start the vehicle_function.sqf script via the mission's sqf file instead, in hopes of avoiding other possible errors - thinking it would work doing it like that.

But there are so many files in this mission which reference things left and right, I'm too confused to really continue anymore. I can't find any other links between scripts other than those, yet I can't get it to work.

I'll once again try to put MyStats/functions.sqf back in there and see if I can get it to work, but if that doesn't work - I'm all out of ideas :(

Edit: Doing that didn't work at all, the mission wouldn't even load. Yet no errors/warnings in the RPT. Tried to get rid of the files MyStats would otherwise load such as player_functions.sqf, in case that's what was it got stuck on, but still doesn't work...

I'm too inexperienced with ArmA 2 to get it to work, and ArmA 2 isn't really friendly to newbies :(

Edited by Dealman

Share this post


Link to post
Share on other sites

I'd class myself as an "advanced beginner" where scripting is concerned. I don't think I'd touch a "Life" mission with a ten-foot pole. Still, taking one apart to see how it works would be a pretty good education on the subject. Good luck either way!

Share this post


Link to post
Share on other sites

Have still been trying to get this to work, found a reason why it wouldn't work - because it was checking if the vehicle was locked. And my mission doesn't have either locking/unlocking, so fixed that.

After that I've been putting messages inside every function at the start and end for debugging purposes. As well as start of the script and at the end of it. Not a single function whatsoever is being run from either MountedSlots or vehicle_functions.sqf.

Start & End messages of both are being output. (So it is being loaded.)

I absolutely have no idea how the hell this script works, it makes absolutely no sense whatsoever... And the fact that everything is spread out all over the place in this mission isn't helping the slightest...

I really can't do this myself, I've lost too much hair and too many hours to this already. I'll just have to rely on some kind soul out there with more experience to try to solve it.

Edit:

Also ran it with the parameter -showScriptErrors, no error messages either ingame or in the RPT.

Edited by Dealman

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  

×