Jump to content
Sign in to follow this  
Grizzle

Module: Visual House Positions

Recommended Posts

Hmm, what would be very useful would be display (and copy to clipboard and rpt file via action) such an object located in front of you, but coordinates shown (and copied) would be in world coordinates and object coordinates. If the object happens to be near a "selection name" (not only houses, but also vehicles) this should be put in as well.

Ex:

1) Stand in a unique building and find the perfect world coordinate to place a furtiture item.

2) Stand in a non unique building and find the location of the door wrt the object/house itself (i.e. to create door triggers for all barracks).

3) Stand in fron of a BM21 and "point" the object on the end of the BM21s "barrel" and the selection name shows.

Is this possible at all? Yeah I know, dreaming a bit here :)

Funny you should mention those things. Though I had only intended for this to be a 'quick and dirty' mod, the more I play with it the more features I want to add :D

Now, I don't know about doing exactly those things, but I am thinking along similar lines. So far, in addition to the A2 compatibility, I've added the following hint text to display:

- Your current position above sea level

- The name and distance of the 'nearest location' (whether it be capital, city, village or other)

I'm going to make the display a real dialog so the user can have more interaction. I'm going to include some helper functions so users can utilize the info displayed. I will probably allow the user to 'tag' spots then output a full list to the clipboard/rpt when they've got them all. Maybe even surrounded by code framework to make it easier to implement the spawns.

Anyhow, I should be releasing the next version in a day or two as time permits.

Share this post


Link to post
Share on other sites

You should implement a copy to clipboard command in the mod. So when you've got the pos you want just copy to clipboard and then you can paste into the editor?

Share this post


Link to post
Share on other sites

One thing I noticed was that a building was listed as having 23 positions, which it did 0-23, however the hint was saying the last position was "23", so if you put in 23 as the value you'd end up at 0,0,0 because 23 didn't exist.

Could the hint be changed to list positions starting from 0 as the game does perhaps? Thanks!

Share this post


Link to post
Share on other sites

Just for clarification;

How does one use the script provided in the first post? Forgive me for my nooby-ness (I am new to mission making), but from what I understand, you input information provided by the addon (the information that is copied to the clipboard) and the building name is output? How does one run the script so that they could get said output?

Sorry if I am sounding vague, just doing my best to understand all this XD

Share this post


Link to post
Share on other sites

No worries mate,

The mod does two things useful for me (and possibly more, someone else might chip in); It allows you to view in the editor which 'house positions' correspond to their physical location on the Map. Therefore, if you're looking to make an ambush mission, then load this up prior and note down good 'house positions' for your ambushers to use, then put instructions into their init line like the following example:

this setPos ((position this nearestObject 123456) buildingPos 3);

buildingPos 3 is 'house number 3'

nearestObject 123456 is a specific number assigned to every building in Arma which you can view in the editor by clicking on the 'IDs' button on the right hand side.

Then you also need to copy some code in their 'init line' so they don't run off.

Try this:

dostop this; this allowfleeing 0; this setUnitPos "Middle";

It commands the unit to be stationary (with the ability to rotate, unlike disableAI), never to flee, and also determines the unit will always stay crouched.

To see how it all works, open up the editor on Utes and place a player unit down, near the control tower on Utes airfield. Then place another unit anywhere and paste this into the init:

this setPos ((position this nearestObject 6540) buildingPos 18); dostop this; this allowfleeing 0; this setUnitPos "Middle";

The code puts the unit on the top of the control tower and makes him crouch.

The second thing about this mod that's good for me is being able to stand somewhere (for example, where you would like an object to be) then copy the location on the clipboard so you can use it with setpos to place the object accurately. Eg:

this setPos [123.123, 432.432, 666.666];

in the format [x,y,z].

I might be a bit mistaken there though as I'm inebriated, but hopefully someone can correct me and expand on it if they feel lucid.

Edited by Das Attorney
Transition!

Share this post


Link to post
Share on other sites

Gotcha. Thats where I was having the most trouble; I wasn't sure how to view house ID's (instead I relied on nearestbuilding or whatever that command is, which proved of course to be rather tedious).

Thanks again for the assistance; it can be quite intimidating when browsing through the scripting forums for someone who is new to mission making.

Edit: Wow, thanks a lot for that example. Things are quite a bit more clear now, and I can't thank you enough.

Edited by aurondude

Share this post


Link to post
Share on other sites

Updated - See first post and read the whole thing ;)

@Das Attorney - I never thought to try using nearestObject with just the ID...you just made my day :). The only downside I can see is if the unit and the position are far apart during init, but other than that what a time saver! Thanks!

Edited by Grizzle

Share this post


Link to post
Share on other sites

Hey

Ive nearly finished setting up a mission i take it i can delete the module once iam ready to pdo up the mission.

And all my snipers ect with be there where i left them right?

This makes the job so much easyier good job grizzle :)

Share this post


Link to post
Share on other sites

This is a great addon, just a warning though, if youve used the old version in any missions your working on, make sure you delete the module and save again before updating to the new version, or you may get an error when trying to open your wip mission.

Share this post


Link to post
Share on other sites
Hey

Ive nearly finished setting up a mission i take it i can delete the module once iam ready to pdo up the mission.

And all my snipers ect with be there where i left them right?

This makes the job so much easyier good job grizzle :)

Yes, just remove the module from your mission before distribution.

Share this post


Link to post
Share on other sites

this is great, the one problem im haveing is when i try puting this guy in the biulding he falls from the sky to his death. this is what I have in my line:

this setPos ((position this nearestObject 2314) buildingPos 2); dostop this; this allowfleeing 0; this setPos [4313.44,3240.71,27.4387];

Share this post


Link to post
Share on other sites

Remove the last setPos - it's not needed since you are setting the house position.

Share this post


Link to post
Share on other sites
Remove the last setPos - it's not needed since you are setting the house position.

thanks, but that did not work now he just falls in the ocean

Share this post


Link to post
Share on other sites

Well, the buildingPos isn't always perfect, but it works fairly well most of the time. Are you using the latest version?

Try the opposite, instead of using buildingPos just use the ASL position (this setPos [4313.44,3240.71,27.4387]; etc...) and see what happens. You can also try lowering or raising the last value to get the height right.

Share this post


Link to post
Share on other sites

@esco7800 - I failed to mention that if you use the ASL position from the hint box that you should use the setPosASL command instead of setPos. This doesn't apply when using the buildingPos, just when using the x,y,z POS shown.

Share this post


Link to post
Share on other sites

EDIT: Cancelled

Edited by Speedle
I'm an idiot

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  

×