Jump to content
Sign in to follow this  
ssm4862

Unit into a House and Random place.

Recommended Posts

thank you. but I want desired position. (See the Screenshot)

Share this post


Link to post
Share on other sites

make yourself a teamleader, and have 1 ai in your group, press space and look at the positions, you should then see the position number to use with the links from twirly.

Share this post


Link to post
Share on other sites

No. The unit is a one hostage. I was put directly House. Once again, See screenshot as I want to put the unit(Hostage) in the desired Place. See screenshot as Its location is just two place. I want Unit into a room left or right placement and just a random

Share this post


Link to post
Share on other sites
No. The unit is a one hostage. I was put directly House. Once again, See screenshot as I want to put the unit(Hostage) in the desired Place. See screenshot as Its location is just two place. I want Unit into a room left or right placement and just a random

Group the unit to 2 different markers and place each marker on one side of house. Put this setPos [getPos this select 0, getPos this select 1, 0]

in unit init field to make sure it goes inside room not on top of house.

Now when game starts it will move unit to location of one of the two markers.

You will have to test with amrkers movement to make sure it is inside room placement.

Share this post


Link to post
Share on other sites

Load up the Visual House Position Module while editing to find what the two buildingPos locations are nearest to where you want your guys to spawn then simply use those locations in your random spawning script.

Share this post


Link to post
Share on other sites

Sincere thanks to all. Other problems resolved. But Not solved a single one. I want game starts two locations(See the ScreenShot) and unit random placement. But I do not know the command.

Share this post


Link to post
Share on other sites

Where exactly is that house? Which map, which objectID, which coords?

Share this post


Link to post
Share on other sites

Built-in map is not the House. I was added Immediate house object.

---------- Post added at 06:35 PM ---------- Previous post was at 06:32 PM ----------

Where exactly is that house? Which map, which objectID, which coords?

Built-in map is not the House. I was added Immediate house object.

Share this post


Link to post
Share on other sites

In that case you're going to have to physically place the units based on the house's location I think. I don't believe placed objects have valid buildingPos locations?

Share this post


Link to post
Share on other sites
In that case you're going to have to physically place the units based on the house's location I think. I don't believe placed objects have valid buildingPos locations?

Why ? Buildingpos are inheriting from pathway lod.

Share this post


Link to post
Share on other sites

That'll be helpful than. I guess just figure out which buildingPos is each room and use those.

Share this post


Link to post
Share on other sites

I think Unit Random placement of the "maker" would be nice... But I do not know the command.

Share this post


Link to post
Share on other sites

Ok, figured out which house it is. There are three buildingPos locations in each of those rooms.

buildingpos.jpg

To have a hostage spawn in a random position do this:

Place your hostage on the map anywhere you'd like and name him hostage.

Place your building on the map by putting down a gameLogic where you want it and spawning it with this in the gameLogic's init field:

myHouse = "Land_HouseV2_02_Interier" createVehicle getPos this; hostage setPos (myHouse buildingPos ([2,3,4,5,6,7] select random 5));  

That will create that building where the game logic is and move the pre-placed hostage into one of the 6 random locations in those two rooms.

Share this post


Link to post
Share on other sites

Answer the questions given our heartfelt thanks. But "hostage setPos (myhouse buildingPos ([2,3,4,5,6,7] select random 5))" use command has not been resolved.

92066045.jpg

Link : http://imageshack.us/photo/my-images/638/92066045.jpg/

This screenshot is an object I directly insert the House.

78868514.jpg

Link : http://imageshack.us/photo/my-images/853/78868514.jpg/

But, Can I use the above command and occurs frequently a hostage not exist.

47836361.jpg

Link : http://imageshack.us/photo/my-images/62/47836361.jpg/

In other cases, When there is a hostage exist.

What I want to tell the mean, Hostages must be present. but, House Object is on the water.

Source

Gamelogic (House) : myBuilding = "Land_HouseV2_02_Interier" createVehicle position this; deleteVehicle this;myBuilding setdir 90;mybuilding setPos [getPos this select 0, getPos this select 1, (getPos this select 2) +3]; mybuilding setVectorUp [0,0,1]; mybuilding allowdamage false; hostage setPos (mybuilding buildingPos ([2,5] select random 5));

Share this post


Link to post
Share on other sites

Ahh yeah! If you only want to use position 2 or 5 change to this:

hostage setPos (mybuilding buildingPos ([2,5] select random [b]1[/b])

Share this post


Link to post
Share on other sites

I think this line is supposed to be...

hostage setPos (mybuilding buildingPos ([2,5] select floor (random 2)));

Share this post


Link to post
Share on other sites

Either way works to get you a 50/50 chance but you're right, select floor is great if you're looking for a whole number because it would return specifically either a 0 or a 1 and not the floating numbers you get with random 1. random is always such a pain. :P

Share this post


Link to post
Share on other sites

If he wants to select between two (non preset building positions), why not just do copytoclipboard getposasl instead of using buildingpos?

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  

×