Jump to content

gor3Splatter

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About gor3Splatter

  • Rank
    Rookie
  1. Moved to Feedback Tracker. That seems more appropriate.
  2. Well, it doesn't work in initPlayerLocal.sqf either. I did, however, work in the console. See this minimal Stratis map. The server log (no mods) is included in the ZIP file.
  3. With 2.14, the newly introduced HashMapObject functionality seems broken. I observed that `_self` in an object's constructor does not seem to be an actual `HashMap` object. Using 2.14.150957 and the actual example code on the Biki (Example 4 [https://community.bistudio.com/wiki/createHashMapObject]): private _temporaryVehicle = [ ["#create", { params ["_vehicleType", "_vehiclePos", "_lifetimeSeconds"]; // handle constructor arguments private _newVehicle = _vehicleType createVehicle _vehiclePos; _self set ["MyVehicle", _newVehicle ]; // Store the vehicle inside the object for later // because _self is passed as parameter, it will be referenced by the spawned script until it ends. [_lifetimeSeconds, _self] spawn { params ["_lifetimeSeconds", "_self"]; sleep _lifetimeSeconds; }; }], ["#delete", { deleteVehicle (_self get "MyVehicle"); // delete the vehicle when we go away }], ["MyVehicle", objNull] // placeholder, this is not needed ]; // create a temporary RoadCone, at player position, that will delete itself after 5 seconds. createHashMapObject [_temporaryVehicle, ["RoadCone_F", getPos player, 5]]; Results in this error: 22:11:41 Error in expression <leType createVehicle _vehiclePos; _self set ["MyVehicle", _newVehicle ]; [_li> 22:11:41 Error position: <set ["MyVehicle", _newVehicle ]; [_li> 22:11:41 Error Type String, expected Number 22:11:41 File mpmissions\scripting-test.Tanoa\initPlayerLocal.sqf..., line 5 Using `_self` in actual methods, however, seems to work fine.
×