Forum Jump :

Author Message


Posts: 8
Rank:


Level: Member

Country: fr
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2017-08-18 19:56        
     
Hello,
I was just messing around with a mission file to make it work on another map.
Usually you'd end up dying in the open ocean but some missions seems to have a workaround as they can work on any map.

Here I want to replace defined pos of spawning coords in the sqm mission file like this one
position[]={8384.0352,97.413429,13712.866};
by
position[]=["water","out"] call BIS_fnc_randomPos;

but I end up with an arma crash.

randomposition=["water","out"] call BIS_fnc_randomPos;
pos={randomposition[1],randomposition[2],randomposition[3]};
... didn't work either.

randomposition=["water","out"] call BIS_fnc_randomPos; should return an array of 3 coords, right ?
What am I missing ?

Thanks for helping.


Author Message


Posts: 106
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#2 Posted at 2017-08-22 00:00        
     
_randomPos = [nil, ["water"]] call BIS_fnc_randomPos;
hint format ["%1",_randomPos];

that what you are looking for? That "blacklists" water from being selected as a Pos from what I understand from the wiki: https://community.bistudio.com/wiki/BIS_fnc_randomPos

I tested this:
_randomPos = [nil, ["water"]] call BIS_fnc_randomPos;
hint format ["%1",_randomPos];
player setPos _randomPos

and it ported me around the map as expected. Only did it about 10x but I never even got Close to the water. Seemed to work.


Advertisement


Author Message


Posts: 8
Rank:


Level: Member

Country: fr
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2017-08-23 17:03        
     
Thanks for your answer, yeah in the console I'm able to make it work, however it's still not working in the sqm file.
So here is an example of a spawn point listed in the sqm:
class Item0
		{
			dataType="Marker";
			position[]={11200.146,173.23399,8789.5225};
			name="spawn1";
			type="Empty";
			id=0;
		};


Author Message


Posts: 106
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#4 Posted at 2017-08-24 01:37        
     
Definitely not an expert, more of a "dabbler" so I'm not sure what you are trying to do. Are you just trying to have a random spawn location for a player?


Author Message


Posts: 8
Rank:


Level: Member

Country: fr
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2017-08-24 16:38        
     
Indeed, something that should be simple.
But I want to keep the rest of the mission "intact" so I can launch it on any other map.
I though maybe sqm was only used for static var definitions ?
And what about those brackets pos[]=... ?

I may try that and see what happens : https://forums.bistudio.com/forums/topic/178767-silent-map-converter/

Edit : didn't work.

This post was edited by BurnToAshes (2017-08-24 17:38, 115 days ago)


Author Message


Posts: 106
Rank:


Level: Member

Country: us
Location: Pennsylvania
Occupation:
Age:
In-game name: Xian

 
#6 Posted at 2017-08-25 00:24        
     
As I understand it, and again just a dabbler, the mission.sqm is just the beginning position of any object on the map. If you are looking for a random spawn, couldn't you just set your player's position using the init.sqf file?


Author Message


Posts: 8
Rank:


Level: Member

Country: fr
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2017-09-03 16:29        
     
You're right, figured it out with an sqf script.
Thanks for your help.