![]() |
|
|
|
#1
|
|||
|
|||
|
@salmo, If you inspecting the actors to try and test for if they exist in the mission, using this I think we may bypass the null points I keep striking in other thread about testing actors for null.
In the add to list, you may need missionnumber aswell for repeats of the same mission where you will get the same actor shortname repeated. Then look for all 3 parameters. btw I've just been working on list handling and found a simple way to find the index number of a line listing, with that you can ask for the item contents or delete the line etc. int indexnm; // declare an int for the index number Then search for bob as actor name in the example following, I havent done it yet, but im sure you could also look for mission,shortname and actor in one line since that is specific in one case only where as you might find several "bob" references. indexnm = list.FindIndex(r => r.shortName.Equals("bob")); Once you have the indexnumber you can report/manupulate the info and any other entry on that line by refering to the indexnumber sendChatMessageTo(-1, "shortName: " + list[indexnm].shortName); |
|
#2
|
|||
|
|||
|
You will get nothing:
Equals compares the complete string, you should use Contains(..). |
|
#3
|
|||
|
|||
|
Oddly, it works
this is an example, but I am pulling and passing a number of things now some declarations Code:
bool timeIO;// = true; //time indicator switch on/off double timevalue; double timeindicator; i then find the data, and parse to game Code:
idxIO = ConfigList.FindIndex(r => r.ConfigName.Equals("timeIO"));
idxTV = ConfigList.FindIndex(s => s.ConfigName.Equals("timevalue"));
double.TryParse(ConfigList[idxTV].ConfigValue, out timevalue);
Im trying to set as realtime update, the only bit not working. at the moment it loads on start and stop of mission. Code:
timeIO = (ConfigList[idxIO].ConfigValue == "ON" ? true : false);
if (timeIO == true)
{
if (Time.current() >= timeindicator)
{
ScreenMsg(-1, "Elapsed Time:Min:" + timeindicator / 60 + " Secs:" + timeindicator + " Ticks:" + timeindicator * 30);
}
}
if (Time.current() >= timeindicator)
{
timeindicator = timeindicator + timevalue;
}
Last edited by Smokeynz; 03-21-2012 at 10:32 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|