Welcome, Guest Sunday 20th April 2014, 17:55:54
   Home   Help Search Login Register  

OFPEC Forum

Author Topic: Respawn AI Crew -How to  (Read 2024 times)
0 Members and 1 Guest are viewing this topic.
Günter Severloh
*
Offline Offline



WWW
« Reply #30 on: 17 Nov 2009, 01:25:27 »

heres the result:

http://img692.imageshack.us/img692/92/gd001.jpg

how do you Check RPT file for 4 lines of output?

Logged

Grenadier-Regiment 187
tcp
*
Offline Offline


WWW
« Reply #31 on: 17 Nov 2009, 01:33:59 »

On XP, I:\Documents and Settings\loginname\Local Settings\Application Data\ArmA 2\arma2.rpt

Also, is this being done on a I44 tank?
« Last Edit: 17 Nov 2009, 01:38:14 by tcp » Logged
Günter Severloh
*
Offline Offline



WWW
« Reply #32 on: 17 Nov 2009, 02:41:09 »

this is Arma 1.

havent tried an I44 tank, its being done on an empty m1a1 tank in arma.
as you can see in the pic

I'll try it with an I44 tank.
But I44 is Arma not Arma 2, I44 mod has nothing out for Arma 2 yet.
Logged

Grenadier-Regiment 187
tcp
*
Offline Offline


WWW
« Reply #33 on: 17 Nov 2009, 02:45:16 »

yea, i knew that, it just slipped my mind when i was thinking about the RPT file, it should be in a similar location though, or just search for arma.RPT

XP:
C:\Documents and Settings\username\Local Settings\Application Data\ArmA
Vista/7:
C:\Users\username\AppData\Local\ArmA
Logged
Günter Severloh
*
Offline Offline



WWW
« Reply #34 on: 17 Nov 2009, 02:53:02 »

there is no Arma.Rpt, i did a seach for both my hard drives.
I dont have those folders that you listed, i have an arma CFG file thats the only thing i can think of.

http://img21.imageshack.us/img21/92/gd001.jpg

message from I44 tank
« Last Edit: 17 Nov 2009, 02:55:39 by Günter Severloh » Logged

Grenadier-Regiment 187
tcp
*
Offline Offline


WWW
« Reply #35 on: 17 Nov 2009, 05:31:15 »

You have to have it. It's a hidden folder, requiring you to search hidden files or show hidden files in windows explorer.

Unless the wrong crewman class is defined in the configs, I don't know where the error is coming from.

I've rewritten the script with comments.

Code:
private ["_veh", "_vehtyp", "_cfg", "_sidcfg", "_numSide", "_goodSide", "_posDepot", "_turcfg", "_main", "_sub", "_i", "_mt", "_st", "_driver", "_slots", "_filled", "_needed", "_type", "_group", "_nomen", "_ranks", "_unit", "_rank"];
_veh = _this;
if((local player) && (player in crew _veh)) then {
_vehtyp = typeOf _veh;
//get real side from config (side command will only return occupant's side)
_cfg = configFile >> "CfgVehicles" >> _vehtyp;
_numSide = getNumber(_cfg >> "side");
_goodSide = false;
switch (side player) do {
case west: {
if(_numSide == 1) then {
_goodSide = true;
if((getMarkerType "mrkDepot") == "") then {_posDepot = getMarkerPos "respawn_west"} else {_posDepot = getMarkerPos "mrkDepot"};
} else {player groupChat "You can't request crew for an enemy tank."};
};
case east: {
if(_numSide == 0) then {
_goodSide = true;
if((getMarkerType "mrkDepotR") == "") then {_posDepot = getMarkerPos "respawn_east"} else {_posDepot = getMarkerPos "mrkDepotR"};
} else {player groupChat "You can't request crew for an enemy tank."};
};
case default {
player groupChat "No crew available for your side.";
};
};
if(_goodSide) then {
//count number of turrets including commander and subturrets
_turcfg = _cfg >> "turrets";
_main = count _turcfg;
_sub = 0;
for "_i" from 0 to _main-1 do {
_mt = (_turcfg select _i);
_st = _mt >> "turrets";
_sub = _sub + count _st;
};
//get a total, include driver
_driver = 1;
_slots = _main + _sub + _driver;
//current occupants
_filled = count(crew _veh);
_needed = _slots - _filled;
if(_needed > 0) then {
//get crewman class from config
_type = getText (_cfg >> "crew");
_group = group player;
//only allow enough crew to fill two tanks
if((_type countType units _group) < (_slots * 2)) then {
//get display name i.e. "Crewman"
_nomen = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
player groupChat ("Requesting " + str _needed + " " + _nomen + " from Depot.");
sleep 3;
_ranks = ["PRIVATE","CORPORAL","SERGEANT"];
for "_x" from 1 to _needed do {
_unit = _group createUnit [_type, _posDepot, [], 0, "NONE"];
_unit setSkill (0.6 + random 0.4);
_rank = _ranks select (floor(random(count _ranks)));
_unit setRank _rank;
_unit doMove _posDepot;
};
} else {player groupChat "Crew limit exceeded.";};
} else {player groupChat "You already have a full crew.";};
};
};

Maybe someone who has ArmA1 and the I44 addon, can look at the script, which can be used outside of an addon as well i.e. as a trigger, and troubleshoot further.

As an addon:
http://www.mediafire.com/file/jzjymzk5wey/tcp_tcrew.pbo

However, I think you need to look into alternatives to UserAction. I've learned that it can overwrite other custom user actions (added from other addons). It should probably be called using CBA Extended Eventhandlers.
« Last Edit: 17 Nov 2009, 05:32:57 by tcp » Logged
Günter Severloh
*
Offline Offline



WWW
« Reply #36 on: 17 Nov 2009, 06:52:15 »

i asked a couple of guys about this, sent a pm to them On BIS fourms.

i swear the arma.rpt is nowhere, i did a search of my 2 harddrives and it dotn find anything, i even made the hidden folders viewable and looked based ont eh path, tis no where to be found.
I have windows XP.

Code:
However, I think you need to look into alternatives to UserAction. I've learned that it can overwrite other custom user actions (added from other addons). It should probably be called using CBA Extended Eventhandlers.
i really dont know what would work all this is beyond me, i liked the way it was working but if you know of another then thats cool.
Logged

Grenadier-Regiment 187
h-
Forum
Administrator
*****
Offline Offline


Formerly HateR_Kint


WWW
« Reply #37 on: 17 Nov 2009, 08:21:33 »

Quote
this is Arma 1.
So why is this posted into Arma2 board?
Or am I missing something  Don't Know
Logged

Project MCAR   ---   FWW2 - Finland At War 1939-1945
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.
tcp
*
Offline Offline


WWW
« Reply #38 on: 17 Nov 2009, 18:37:35 »

It was written for ArmA2, but is also being used in ArmA1. The same code works in both, however one mod set (I44) seems to have problems.
« Last Edit: 17 Nov 2009, 18:39:18 by tcp » Logged
Günter Severloh
*
Offline Offline



WWW
« Reply #39 on: 17 Nov 2009, 21:08:21 »

can we just put the orignial script in addon form and then just have it so that the player will have to put the mrkdepot marker,for west, and the mrkdepotr for east.

is there a way to make it so that when you request a crew that the tank or vehicle itself becomes the marker,and the crew would spawn within the perimiter of the tank. that way its a self contained addon, just request a crew and your done.

Your thoughts
« Last Edit: 22 Nov 2009, 00:24:04 by Günter Severloh » Logged

Grenadier-Regiment 187
Pages: 1 2 [3]  All   Go Up
  Send this topicPrint  
 
Jump to: