Jump to content
Sign in to follow this  
Kommiekat

Mount barrels to back of open ural

Recommended Posts

Hello,

I want to have barrels, as many as I can, put into the back of an open ural or truck.

I'm going to use the red barrels and/or green barrels.

In other words, the truck is loaded and ready to go with these barrels.

I don't need addaction or anything like that.

This truck will be transported to a destination later in the mission.

Share this post


Link to post
Share on other sites

hey you may have issues trying to attach so many Barrels to a truck and it looking adequate I would use the group barrels. I have a script that I made construction vehicle by attaching a cargo container using this code

box1 attachTo [name of vehicle,[0,0,0]]; however I needed to adjust the coordinance to [-.02,-2,.7] to get the cargo container centered.

Share this post


Link to post
Share on other sites

Hey guy, I'll give that a try.

I don't know how many a Ural can carry.

Seems I'll have to use your code for each and every barrel, such as barrel1, barrel2 and so forth.

Not sure how to "group barrels" Can you show me how you did that?

Thanks again for your help.

Share this post


Link to post
Share on other sites

Even if it might be a bit of an overkill for your needs, maybe have a look at my draggables/droppables demo. Sure, you don't need the draggables/actions, but maybe you can just use the "droppable" part. By means of a simple rectangle-packer the barrels would be automatically arranged onto your ural. Plus: I've already measured the ingame-dimensions of the barrels and official cargo-vehicles in ArmAII, s.t. things look about right... (if you use addon-vehicles or even barrels, you'd need to manually measure the cargo area for vehicles and the bounding box for barrels by yourself though...).

~edit~

Here, I've quickly put a small demo together. Check it out:

...which essentially is a two-liner:

// now make that truck droppable (target for draggables)
[_truck] call RUBE_makeDroppable;

// pack truck with barrels (overflow/objects that don't fit won't be considered/created)
[
  ["vehicle", _truck],
  ["objects", _objects]
] call RUBE_packVehicle;

screenshots:

http://non.sense.ch/shared/BarrelsOnATruck.utes.1.jpg (178 kB)

http://non.sense.ch/shared/BarrelsOnATruck.utes.2.jpg (204 kB)

Edited by ruebe

Share this post


Link to post
Share on other sites

Wow, looks like you did it.

I'll download this right away and see what I can do.

Thanks for that!

Hope you don't mind if I came back here for any questions later.

BTW, just played your FireAnts mission on Takistan map. Good fun!

---------- Post added at 04:19 AM ---------- Previous post was at 02:45 AM ----------

Hey Rube. Looks really good.

Was wondering. Player will not drive the truck.

I'll have it driven by AI for the Intro and also, later in the mission itself. It will be parked near a village. Some of those barrels are going to be placed at varies places in the village, emitting a poisonous gas.

So, I may need two trucks like the one you produced.

Question is, does it have to be player? I noticed you have "player Pos" in the script.

Can I change that to an AI unit with a given name then place that unit near the truck or even have that AI driving the truck in the Intro?

Cheers!

Share this post


Link to post
Share on other sites
BTW, just played your FireAnts mission on Takistan map. Good fun!

:shoot::rthumb:

Was wondering. Player will not drive the truck.

I'll have it driven by AI for the Intro and also, later in the mission itself. It will be parked near a village. Some of those barrels are going to be placed at varies places in the village, emitting a poisonous gas.

So, I may need two trucks like the one you produced.

Lovely scenario you got going there. And IMHO this is a perfect use case for my draggables/droppables, since they're designed keeping the AI in mind (i.e. the AI can load/unload trucks and drag objects around too - either by scripting or even by ingame interface, in case you're the commanding unit over some AI loons).

So in short: you can have your truck (or two...) being loaded by AI if you wish (or start with an already loaded one, just like in the demo). Your AI "can drive" (...well... you know..., sort of :ok:) that truck somewhere else. Once arived, you can assigne some AI loons to unload that truck - barrerl for barrel. Give them move positions to desired places in the village (they're now dragging those barrels after the unload command has been fired). And once there tell em to put the barrel down. Depending on the size of your AI loons assigned to this task and the number of barrels... rinse and repeat (best write a small fsm to drive this complete task, separated into the different stages, I'd say, given a pool of trucks (with barrels) and a pool of AI loons to unload - or use the driver... that should be no big deal, keeping count of remaining barrels/waiting until they're all in place to proceed...).

Question is, does it have to be player? I noticed you have "player Pos" in the script.

Can I change that to an AI unit with a given name then place that unit near the truck or even have that AI driving the truck in the Intro?

Of course you can use an AI driver. It's the same truck and some objects being attached to it, doesn't change anything at all. So AI can still do anything - with the draggables/droppables even more (unloading, dragging...)!

That "player Pos" there is just used to get the position (right in front of the player) to spawn that truck. That is all. You can use any truck - preplaced, created on the fly by means of scripting. Anything goes.

Maybe make yourself comfortable with the draggables/droppables (starting point would be the thread initially mentioned) and the functions you'd need to use (stuff should be commented well enough). Shouldn't be too hard (I hope). Otherwise just ask. ;)

Have fun!

Edited by ruebe

Share this post


Link to post
Share on other sites

Hey Rube did you ever fix the coin section of your script? I never really got that to work for me. glade to see you are still around with ARMA2

Share this post


Link to post
Share on other sites
Hey Rube did you ever fix the coin section of your script? I never really got that to work for me.

I don't think that was ever (totally) broken [edit: turns out it totally is, dang...]

Granted, it's a bit obscure and unpolished... need to re-evaluate that approach to building anyways to find an acceptable level of abstraction (in regard to supplies and their ingame representation; and lot's of other stuff too...). Some shiny day... :cool:

Edited by ruebe

Share this post


Link to post
Share on other sites

Hey Rube, your thread here:

http://forums.bistudio.com/showthread.php?123740-RUBE-draggables-droppables-demo-(object-drag-n-drop)/page2&highlight=draggables%2Fdroppables

.............is way outdated and not sure if the mods will take kindly to me bumping it, but I do have questions about it.

Should I post them there or here?

Basically, I'll have the player drive the truck that is already loaded with barrels to a trigger someplace on the map then end the mission_2 there (Yes I know, so short mission).

Then..................

I'll start the next mission_3 with the truck parked some place, empty of barrels, and have the barrels placed at the back of the truck.

Player has to drag, say 10 barrels, one at a time, to a trigger.

That's 10 barrels and 10 different located triggers.

No need for player to drag any other objects in the game. Just the barrels.

So, when barrel1 is dragged into a trigger, it will show TASK SUCCESS.

Is this possible?

I read both pages on your thread and some of your script library.

I think I'm going to need help on this.

I'll need to name each barrel, then there will need to be the addaction for player "drag barrel" and "release barrel" in the trigger.

I have NO IDEA where to even begin this.

Mission_4, player will go to each barrel and start the gas going, activated by the trigger.

Cheers

Share this post


Link to post
Share on other sites
your thread here ...is way outdated and not sure if the mods will take kindly to me bumping it

As you like. I don't see a problem in posting there if it's exactly about draggables/droppables. But stay in this thread if it's about this mission of yours.

So, when barrel1 is dragged into a trigger, it will show TASK SUCCESS.

Is this possible?

Sure. Shouldn't be too hard either. Basically all you need is a trigger (for each position) that checks if a barrel is there (check some minimal distance) and I'd also add the condition that the barrel isn't currently being draggged any more (i.e. released). While I don't remember, I'm pretty sure there is some variable on the barrel, which you can query if that is the case or not. And you should most likely keep track of a counter, you'll increment each time a barrel more is in place, s.t. you know when all barrels are put down.

I'll need to name each barrel, then there will need to be the addaction for player "drag barrel" and "release barrel" in the trigger.

I have NO IDEA where to even begin this.

I don't think you'll need to deal with the drag/release stuff at all. Have your barrels, make them draggable by means of RUBE library and then have simple triggers as described above. As for "naming" barrels... you just need to keep track of (or references/pointers to) them. In case you init barrels by packing them on the truck by script, you'll get an array of packed barrels. Otherwise you need to keep track of barrels by yourself (I suggest you don't place them down in the editor, but spawn them by means of scripting.. but that's up to you...)

Tweak on!

:cool:

Share this post


Link to post
Share on other sites

Rube, Thanks for your reply.

Again, rube, I have no idea where to begin.

I know I need your folder named "RUBE".

I opened it and you have 12 folders in there and 15 .hpp files.

Inside each of your 12 folders is another 6 folders.

Honestly, I understand you're trying to be helpful, but it's way over my head and almost intimidating.

I'm scared, Rube. Really, I'm scared!

Share this post


Link to post
Share on other sites
I'm scared, Rube. Really, I'm scared!

Now don't panic.

Relax. Take a deep breath.

:toilet:

If you manage to load the RUBE library as script version, you're already there for the most part (no need to be intimidated by all the files. This is of no concern to you. Maybe you wanna look at the makeDraggable/Droppable files though, if only to read the description/comment at the top of the file.).

From what I can tell, you will need to interact with that stuff only at two single points: if the barrels start loaded on the truck, you want to use the rectangle packer as demonstrated in the example posted earlier (which also makes the barrels draggable). No big deal.

Second scenario: you have your barrels unloaded/somewhere else, and you just want to make them draggable. Here you simply need to make a call to RUBE_makeDraggable for all the barrels. Maybe you still wanna make the truck (or something else droppable), but I guess not. So you're already done.

From there you simply need to create the needed triggers to make your scenario(s) work.

If you have problems, you can always ask here.

And hey, if you don't feel like it, you really don't have to mess around with the RUBE library stuff. I know it's kind of a mess :crazy_o:

Have fun!

Share this post


Link to post
Share on other sites

Hi Rube,

Which folder and where do I find it?

In the RUBE folder, you have:

ai

aicoef

aisr

cam

dialogs

fn

lib

modules

pe

recipes

sounds

weather

Also, if it is within this folder "RUBE", I'll need to know which folders I can safely take out as not to make the

mission file too heavy for the players download.

Thanks!

Share this post


Link to post
Share on other sites

Which folder and where do I find it?

Start with the one or two function names that you wanna use. Then search/grep for the file that defines said function (most likely in the fn directory).

I'll need to know which folders I can safely take out

Once you got that (or these) files, you need to grep for any occurence of "RUBE_*", because you're going to need to copy/define these functions too. Repeat for any such function/file you've found until you've got em all. ...shouldn't be too deep down the rabbit hole. :p

Then just copy that list of files and compile them (as done in RUBE\init.sqf, so you'll end up with just a subset of those compile lines... put em somewhere in your init.sqf. Make sure to adapt the paths.)

With the correct tools (e.g. baregrep or grepWin on windows), this shouldn't be too much of a hassle and you'll end up with just a bunch of additional sqf files.

Share this post


Link to post
Share on other sites

Hi Rube,

gren? grep? grepWin?

Grope? You trying to grope me, Rube? :bounce3:

Let me spend some time with it. If I don't get it working, I'll find a way to pass on it, like having the barrels already in place at the locations and told so in the story briefing.

Be better if the player can drag them around, though.

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  

×