Arma 3
La Volpe 02 22 ENE 2016 a las 10:19 a. m.
respawn in conquered sectors
Hi,
I want to create a multiplayer mission where Blufor and Opfor have to fight for the control of different sectors. There is only one thing that doesn't work and I hope you can help me. It searched some days an solution but i haven't found something.
I cann't solve it that Blufor can respawn in a sector which is under their influence and that it changes if Opfor is the owner of this sector so that they can spawn there now.

I hope you can help me ;-)



PS: Please excuse my english i know it isn't the yellow from the egg :steamhappy:
< >
Mostrando 16-30 de 33 comentarios
La Volpe 02 27 JUL 2016 a las 7:00 a. m. 
OK so your problem is completly solved? ;-)
Moedus 27 JUL 2016 a las 9:41 a. m. 
Yes thank you.
Tovarish 28 JUL 2016 a las 6:59 a. m. 
Hey Surgical. I tried using your script but the problem with it was that once you capture a new sector the old respawn was removed. After a long hair pulling day I finally figured out how to make previous spawns persist and remove the spawn for the enemy. Here's the code:

[_this select 1, _this select 0] call BIS_fnc_addRespawnPosition;
[_this select 2, 1] call BIS_fnc_removeRespawnPosition;

Additionally, you can custom name the spawn point using the following command:

[_this select 1, _this select 0, "CHARLIE"] call BIS_fnc_addRespawnPosition;
[_this select 2, 1] call BIS_fnc_removeRespawnPosition;

Some explanation:
_this select 0 = Sector Control module (where respawn is generated)
_this select 1 = Side that owns the sector
_this select 2 = side that previously owned the sector

the add Respawn Position function is formatted like this:
[target i.e side,position i.e location,"name is optional"] call BIS_fnc_addRespawnPosition;

Relevant Wiki:
https://community.bistudio.com/wiki/BIS_fnc_addRespawnPosition
https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition
Última edición por Tovarish; 28 JUL 2016 a las 7:03 a. m.
Moedus 28 JUL 2016 a las 1:46 p. m. 
Nice awesome work! I was literally trying to get this to work when I saw this notification. Btw thank kylania on bis forums for that code i used. He is the one that gave it to me. Also thanks for the detailed explanation!
Tovarish 29 JUL 2016 a las 11:59 p. m. 
Publicado originalmente por (SKWOD) SurgicalTalents:
Nice awesome work! I was literally trying to get this to work when I saw this notification. Btw thank kylania on bis forums for that code i used. He is the one that gave it to me. Also thanks for the detailed explanation!

Thanks but apparently it's not working properly yet. After more extensive testing today we noticed that the respawns are not being removed properly. I'm pretty sure it has to do with the "1" in:

[_this select 2, 1] call BIS_fnc_removeRespawnPosition;

I'll try and figure out a fix tomorrow and I'll keep you posted.
Última edición por Tovarish; 30 JUL 2016 a las 12:00 a. m.
Tovarish 30 JUL 2016 a las 9:32 a. m. 
Ok I worked out the problem. It was the "1" as it gets the ID of the respawn point and I'm not sure how to use those. I went with the alternate syntax you posted. Basically you have to make a new respawn name for each sector. Seems to work now.

Example:

S1Respawn call BIS_fnc_removeRespawnPosition;
S1Respawn = [(_this select 1), (_this select 0), "ALPHA"] call BIS_fnc_addRespawnPosition;

S2Respawn call BIS_fnc_removeRespawnPosition;
S2Respawn = [(_this select 1), (_this select 0), "BRAVO"] call BIS_fnc_addRespawnPosition;

S3Respawn call BIS_fnc_removeRespawnPosition;
S3Respawn = [(_this select 1), (_this select 0), "CHARLIE"] call BIS_fnc_addRespawnPosition;

etc. etc. Paste the code above into the appropriate sector's expression field. So the S1Respawn into first sectors code, S2Respawn into second sector, etc. You can make as many as you need, just make a new name. It can be anything you want, not necessarily S4Respawn, S5Respawn, etc.
Última edición por Tovarish; 30 JUL 2016 a las 9:34 a. m.
Moedus 30 JUL 2016 a las 7:44 p. m. 
the first one seemed to work fine with me but I will go ahead and use this one just in case. Thank you very much.
oldiron99 6 ENE 2017 a las 8:58 a. m. 
Hi guys.
First thanks to of all of you who share their knowledge, it helped me so many times. I hope that someone returns to this thread (?, not my native language...).
I found Tovarishs way to solve this interesting but it didnt work out for me. So firstly i analyzed the handles of the sector-module:
_this select 0 = name of sector module ie variable,
_this select 1 = conquering side (west, east etc) and
_this select 2 = last ower of sector
Remarkably (this word looks strange to me but it seem 2 b correct) there is no handle in the sector module for any position... so tovarishes commands shouldnt be working, at least they didnt for me.

Then i found out that handles only change after the sector is conquered, so it doesnt repeat every sec or so - good 2 know.

Now I needed a position to respawn the respawn point at. I chose the trigger of that sector which I named distinctively (?, correct?):
Sector-Namevar: S4Respawn
Sector-Trigger-Namevar: S4RespawnTrig

then I did a little script that I started in the EXPRESSION FIELD of the sector module:
[_this,S4RespawnTrig] exec "sectoract.sqs" (i started with OFP in the old days and never had time to adopt to SQF, sry)
The handles passed to the script:
_this = name of the sector module
S4RespawnTrig = obviously the name of the adjacent trigger

Now the script: "sectoract.sqs"

?(not local server_ai): exit
titletext[format ["local server_ai = %1", local server_ai], "PLAIN DOWN"]
~2

_handle = _this select 0
; _handle gets the name of the distinct sector module

_handleTrig = _this select 1
; _handleTrig gets the name/var of the adjacent trigger of that sector module

_handleTrigPos = getpos _handleTrig
; _handleTrigPos copies the position of that trigger. We want to create the respawn-point here.

_respawnPos = _handleTrigPos
; it is a var initialized because BIS_fnc_removeRespawnPosition annoyed me by "not initialized var" or something. Whatever works...

_handle01varname = _handle select 0
; gives name of sector module, only for testing
_handle02ownerside = _handle select 1
; gives name of sector conqueror, only for testing
_handle03previousownerside = _handle select 2
; gives name of previous sector owner, only for testing

#showvar
; titletext[format ["_handle01varname: %1\n _handle02ownerside: %2\n _handle03previousownerside: %3\n", _handle01varname, _handle02ownerside, _handle03previousownerside], "PLAIN DOWN"]
; only for testing, shows the handles that the sector module is using

; now here we are deleting the respawns of the enemy
; BUT only removing without check gives you an error in the case that there was no previous respawn point.
; so I had to check if there was a PREVIOUS OWNER

? (_handle03previousownerside == WEST): _respawnPos call BIS_fnc_removeRespawnPosition
? (_handle03previousownerside == EAST): _respawnPos call BIS_fnc_removeRespawnPosition
? (_handle03previousownerside == RESISTANCE): _respawnPos call BIS_fnc_removeRespawnPosition
? (_handle03previousownerside == INDEPENDENT): _respawnPos call BIS_fnc_removeRespawnPosition

; now we can create the respawn point for the new owner (side! that is: _handle02ownerside) and the POSITION! (that of our trigger because the sector module hasnt one)
[_handle02ownerside,_handleTrigPos] call BIS_fnc_addRespawnPosition;

; Me likes smoke, so for the fun of it:
? (_handle02ownerside == WEST): _rauch = "SmokeShellBlue" createvehicle getpos _handleTrig
? (_handle02ownerside == EAST): _rauch = "SmokeShellRed" createvehicle getpos _handleTrig
? (_handle02ownerside == RESISTANCE): _rauch = "SmokeShellGreen" createvehicle getpos _handleTrig

;S4Respawn select 1 ist Owner des Sectors, getpos _handleTrig ist die Position des Sector-Triggers, derr der Sector hat keine Position

~2
;goto "showvar"

; thats it folks
exit

******

I hope you can verify this solution and plz report any errors.

Thanx 4 reading




fOOx 3 JUL 2017 a las 8:10 a. m. 
Publicado originalmente por Nutlink:
I created an example mission to show you how I did this:
http://www.filedropper.com/respawnteststratis

Now to explain it. First, give your Sector modules different names. I generally go sectorA, sectorB, sectorC, etc etc. Once you have your sectors set up add a Respawn Position module for the initial respawn point. Without a Respawn Position module the function BIS_fnc_addRespawnPosition doesn't seem to work as intended, so it's better to use the module instead of a marker named respawn_west in this case.

Next, create a marker and give it a name. In this example I use respawnMrk. You can set this marker to whatever you want. I'd suggest leaving it as an Empty icon so that way the default respawn position marker is placed without being hidden under an unnecessary marker.

Now create a trigger and set it up like this:

Type: None
Activation: None
Repeatedly
Condition: (sectorA getVariable "owner") == west
On Act: respawnA = [west, "respawnMrk"] call BIS_fnc_addRespawnPosition;

Create another trigger. Inside that one set it up like this:

Type: None
Activation: None
Repeatedly
Condition: (sectorA getVariable "owner") != west
On Act: respawnA call BIS_fnc_removeRespawnPosition;

Each time sectorA changes sides the trigger kicks in and adds or removes the respawn point as required. You should be able to write something in the Expression field of the Sector module, but I haven't tried doing anything with that one yet.

Hope this helps!

Thanks Nutlink was looking for a solution and his example worked perfectly
fOOx 3 JUL 2017 a las 8:25 a. m. 
Publicado originalmente por (SKWOD) SurgicalTalents:
I actually found another way to do it. So I put this code in the sector module expression field "sectorRespawn call BIS_fnc_removeRespawnPosition;
sectorRespawn = [(_this select 1), (_this select 0)] call BIS_fnc_addRespawnPosition;" and it works! The only difference is that the unit will respawn on the position of the sector module. Thank you. Would never have found this one (kylanlia was the person who found this) without this post.

good job thanks for sharing

Thanks to all for the help. I've been doing my own battle for cectors with AI for some time. :)


Última edición por fOOx; 3 JUL 2017 a las 8:32 a. m.
Mr. Groove 4 FEB 2018 a las 12:44 a. m. 
@(SKOWD) SugricalTalents :

I tried to put ur code into the init field from the secotr Module but then i get this message:

"Init: Local varaible in Local space"

So this doens't work for me. What am I doing wrong?

Thanks in advance,

Mr. Groove
Moedus 4 FEB 2018 a las 12:26 p. m. 
Publicado originalmente por Mr. Groove:
@(SKOWD) SugricalTalents :

I tried to put ur code into the init field from the secotr Module but then i get this message:

"Init: Local varaible in Local space"

So this doens't work for me. What am I doing wrong?

Thanks in advance,

Mr. Groove
if you look on this page a comment made by the name of "tovarish" fixed the issue and it should work
Mr. Groove 5 FEB 2018 a las 3:03 p. m. 
Publicado originalmente por Tovarish:
Hey Surgical. I tried using your script but the problem with it was that once you capture a new sector the old respawn was removed. After a long hair pulling day I finally figured out how to make previous spawns persist and remove the spawn for the enemy. Here's the code:

[_this select 1, _this select 0] call BIS_fnc_addRespawnPosition;
[_this select 2, 1] call BIS_fnc_removeRespawnPosition;

Additionally, you can custom name the spawn point using the following command:

[_this select 1, _this select 0, "CHARLIE"] call BIS_fnc_addRespawnPosition;
[_this select 2, 1] call BIS_fnc_removeRespawnPosition;

Some explanation:
_this select 0 = Sector Control module (where respawn is generated)
_this select 1 = Side that owns the sector
_this select 2 = side that previously owned the sector

the add Respawn Position function is formatted like this:
[target i.e side,position i.e location,"name is optional"] call BIS_fnc_addRespawnPosition;

Relevant Wiki:
https://community.bistudio.com/wiki/BIS_fnc_addRespawnPosition
https://community.bistudio.com/wiki/BIS_fnc_removeRespawnPosition

Hi Tovarish, Thanks for your input. But I am a bit confused now...

I was searching for a way to create a spawnpoint for the team that has taken ownership of a sector.
So if a team takes over a sector, that particular team should inherit a spawnpoint for that sector. When the sector is taken over again by another team the new sector owner should get that particular sector spawnpoint.

The script you mentioned above didn't work out for me, but i guess I must be doing something wrong.

Would you be so kind to create a "from point A to point Z" description for me? There is too much text involved now, can't figure it out anymore.

Thanks,

Mr. Groove
Última edición por Mr. Groove; 5 FEB 2018 a las 3:04 p. m.
Tragedia 23 MAY 2018 a las 2:43 a. m. 
do anyone know how to achieve this exact thing but for individual players instead of the BLOFURS? I need to grant a player a new respawn point once they have reached a checkpoint.
IM SORRY BUFFALO 23 MAY 2018 a las 11:22 a. m. 
Publicado originalmente por Gilles:
do anyone know how to achieve this exact thing but for individual players instead of the BLOFURS? I need to grant a player a new respawn point once they have reached a checkpoint.

this will create a marker locally(only on the client in the checkpoint) in a random location inside of the trigger/checkpoint

create a trigger for the area of your checkpoint and give it a name(using trigger_1 for example), set it to any player present, in the condition box put
this && player in thisList

in the activation put this
null = [trigger_1] execVM "checkPointReached.sqf";

inside checkPointReached.sqf
_trigger = (_this select 0); _clientID = owner player; addSpawns = [_trigger, _clientID]; publicVariableServer "addSpawns";

and this can be anywhere on the server as long as it has ran when the mission is loaded(such as initServer.sqf).
"addSpawns" addPublicVariableEventHandler { private ["_data"]; _data = (_this select 1); _trigger = (_data select 0); _clientID = (_data select 1); _trigArea = triggerArea _trigger; _location = [_trigger, _trigArea] call BIS_fnc_randomPosTrigger;//dumb name setRespawnPoint = _location; _clientID publicVariableClient "setRespawnPoint"; };

then somewhere on the client(again this has to run once once the player joins such as initPlayerLocal.sqf)
"setRespawnPoint" addPublicVariableEventHandler { _location = (_this select 1); _mrk = createMarkerLocal ["new_marker_name", [_location select 0, _location select 1]]; };

just figure out however you want to add the new marker as a respawn point, BIS_fnc_addRespawnPosition wont work as it runs globally and this is running between a specific client and the server
< >
Mostrando 16-30 de 33 comentarios
Por página: 1530 50

Publicado el: 22 ENE 2016 a las 10:19 a. m.
Mensajes: 33