Jump to content

Deconstruct Buildables


Snowmobil

Recommended Posts

Yes, use this as your remove.sqf

 

Ok. I'll try that out. I just came here to ask a question and maybe that version will fix it.

 

I installed this with the files from the first post and it worked. I died, changed my plot pole's characterID in the server database and it worked. Then, it stopped working so hopefully that new remove.sqf fixes this issue.

Link to comment
Share on other sites

 

I appreciate the help, but I'm getting this error when I submit this query in Navicat.

[Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 9

 

There's a "//" missing near the bottom. This works:

 

DELIMITER ;
DROP TRIGGER IF EXISTS epoch.`update_owner`;
DELIMITER //
CREATE TRIGGER epoch.`update_owner`
AFTER INSERT ON epoch.character_data
FOR EACH ROW
BEGIN
UPDATE epoch.object_data SET CharacterID= NEW.CharacterID WHERE CharacterID IN
(SELECT CharacterID FROM player_login WHERE PlayerUID= NEW.PlayerUID)
AND (Classname = 'WoodSmallWall_DZ' OR Classname = 'WoodSmallWallThird_DZ' OR Classname = 'WoodLargeWall_DZ' OR Classname = 'Land_DZE_GarageWoodDoor' OR Classname = 'WoodLargeWallDoor_DZ' OR Classname = 'WoodSmallWallDoor_DZ' OR Classname = 'WoodStairs_DZ' OR Classname = 'WoodStairsSans_DZ' OR Classname = 'WoodSmallWallWin_DZ' OR Classname = 'WoodLargeWallWin_DZ' OR Classname = 'WoodShack_DZ' OR Classname = 'WoodRamp_DZ' OR Classname = 'WoodLadder_DZ' OR Classname = 'WoodFloor_DZ' OR Classname = 'WoodFloorQuarter_DZ' OR Classname = 'WoodFloorHalf_DZ' OR Classname = 'Wooden_shed_DZ' OR Classname ='Land_DZE_WoodDoor' OR Classname = 'Land_DZE_LargeWoodDoor' OR Classname = 'Land_DZE_GarageWoodDoor' OR Classname = 'CinderWall_DZ' OR Classname = 'CinderWallHalf_DZ' OR Classname = 'CinderWallDoorway_DZ' OR Classname = 'CinderWallDoor_DZ' OR Classname = 'CinderWallSmallDoorway_DZ' OR Classname = 'CinderWallDoorSmall_DZ' OR Classname = 'Plastic_Pole_EP1_DZ' OR Classname = 'TentStorage' OR Classname = 'TentStorageDomed' OR Classname = 'TentStorageDomed2' OR Classname = 'LightPole_DZ' OR Classname ='SandNest_DZ' OR Classname = 'MetalFloor_DZ' OR Classname = 'Hedgehog_DZ' OR Classname = 'Sandbag1_DZ' OR Classname = 'WoodGate_DZ' OR Classname = 'Land_HBarrier1_DZ' OR Classname = 'Land_HBarrier3_DZ' OR Classname = 'Fence_corrugated_DZ' OR Classname = 'M240Nest_DZ' OR Classname = 'CanvasHut_DZ' OR Classname = 'ParkBench_DZ' OR Classname = 'MetalGate_DZ' OR Classname = 'OutHouse_DZ' OR Classname = 'WoodShack_DZ' OR Classname = 'StorageShed_DZ' OR Classname = 'StickFence_DZ' OR Classname = 'DesertCamoNet_DZ' OR Classname = 'ForestCamoNet_DZ' OR Classname = 'DesertLargeCamoNet_DZ' OR Classname = 'ForestLargeCamoNet_DZ' OR Classname = 'DeerStand_DZ' OR Classname = 'MetalPanel_DZ' OR Classname = 'WorkBench_DZ' );
END//
DELIMITER ;
Link to comment
Share on other sites

 

There's a "//" missing near the bottom. This works:

DELIMITER ;
DROP TRIGGER IF EXISTS epoch.`update_owner`;
DELIMITER //
CREATE TRIGGER epoch.`update_owner`
AFTER INSERT ON epoch.character_data
FOR EACH ROW
BEGIN
UPDATE epoch.object_data SET CharacterID= NEW.CharacterID WHERE CharacterID IN
(SELECT CharacterID FROM player_login WHERE PlayerUID= NEW.PlayerUID)
AND (Classname = 'WoodSmallWall_DZ' OR Classname = 'WoodSmallWallThird_DZ' OR Classname = 'WoodLargeWall_DZ' OR Classname = 'Land_DZE_GarageWoodDoor' OR Classname = 'WoodLargeWallDoor_DZ' OR Classname = 'WoodSmallWallDoor_DZ' OR Classname = 'WoodStairs_DZ' OR Classname = 'WoodStairsSans_DZ' OR Classname = 'WoodSmallWallWin_DZ' OR Classname = 'WoodLargeWallWin_DZ' OR Classname = 'WoodShack_DZ' OR Classname = 'WoodRamp_DZ' OR Classname = 'WoodLadder_DZ' OR Classname = 'WoodFloor_DZ' OR Classname = 'WoodFloorQuarter_DZ' OR Classname = 'WoodFloorHalf_DZ' OR Classname = 'Wooden_shed_DZ' OR Classname ='Land_DZE_WoodDoor' OR Classname = 'Land_DZE_LargeWoodDoor' OR Classname = 'Land_DZE_GarageWoodDoor' OR Classname = 'CinderWall_DZ' OR Classname = 'CinderWallHalf_DZ' OR Classname = 'CinderWallDoorway_DZ' OR Classname = 'CinderWallDoor_DZ' OR Classname = 'CinderWallSmallDoorway_DZ' OR Classname = 'CinderWallDoorSmall_DZ' OR Classname = 'Plastic_Pole_EP1_DZ' OR Classname = 'TentStorage' OR Classname = 'TentStorageDomed' OR Classname = 'TentStorageDomed2' OR Classname = 'LightPole_DZ' OR Classname ='SandNest_DZ' OR Classname = 'MetalFloor_DZ' OR Classname = 'Hedgehog_DZ' OR Classname = 'Sandbag1_DZ' OR Classname = 'WoodGate_DZ' OR Classname = 'Land_HBarrier1_DZ' OR Classname = 'Land_HBarrier3_DZ' OR Classname = 'Fence_corrugated_DZ' OR Classname = 'M240Nest_DZ' OR Classname = 'CanvasHut_DZ' OR Classname = 'ParkBench_DZ' OR Classname = 'MetalGate_DZ' OR Classname = 'OutHouse_DZ' OR Classname = 'WoodShack_DZ' OR Classname = 'StorageShed_DZ' OR Classname = 'StickFence_DZ' OR Classname = 'DesertCamoNet_DZ' OR Classname = 'ForestCamoNet_DZ' OR Classname = 'DesertLargeCamoNet_DZ' OR Classname = 'ForestLargeCamoNet_DZ' OR Classname = 'DeerStand_DZ' OR Classname = 'MetalPanel_DZ' OR Classname = 'WorkBench_DZ' );
END//
DELIMITER ;

 

Perfect! Thanks.

Link to comment
Share on other sites

Ok. I'll try that out. I just came here to ask a question and maybe that version will fix it.

 

I installed this with the files from the first post and it worked. I died, changed my plot pole's characterID in the server database and it worked. Then, it stopped working so hopefully that new remove.sqf fixes this issue.

 

I'm using the above solution to change PlayerID's automatically, so if you have SQL access I would try that. I don't know if it works yet, but I'll be sure to post back.

Link to comment
Share on other sites

  • 3 weeks later...

 

BOOM

DELIMITER ;
DROP TRIGGER IF EXISTS dayz_epoch.`update_owner`;
DELIMITER //
CREATE TRIGGER dayz_epoch.`update_owner`
AFTER INSERT ON dayz_epoch.character_data
FOR EACH ROW
BEGIN
    UPDATE dayz_epoch.object_data SET CharacterID = NEW.CharacterID WHERE CharacterID IN
           (SELECT CharacterID FROM character_data WHERE PlayerUID = NEW.PlayerUID);
END//
DELIMITER ;

 

Can I use this with epoch 1.0.3.1 and above so players are able to remove their buildable objects after each restart? If so, how often should I run this?

Link to comment
Share on other sites

 

There's a "//" missing near the bottom. This works:

DELIMITER ;
DROP TRIGGER IF EXISTS epoch.`update_owner`;
DELIMITER //
CREATE TRIGGER epoch.`update_owner`
AFTER INSERT ON epoch.character_data
FOR EACH ROW
BEGIN
UPDATE epoch.object_data SET CharacterID= NEW.CharacterID WHERE CharacterID IN
(SELECT CharacterID FROM player_login WHERE PlayerUID= NEW.PlayerUID)
AND (Classname = 'WoodSmallWall_DZ' OR Classname = 'WoodSmallWallThird_DZ' OR Classname = 'WoodLargeWall_DZ' OR Classname = 'Land_DZE_GarageWoodDoor' OR Classname = 'WoodLargeWallDoor_DZ' OR Classname = 'WoodSmallWallDoor_DZ' OR Classname = 'WoodStairs_DZ' OR Classname = 'WoodStairsSans_DZ' OR Classname = 'WoodSmallWallWin_DZ' OR Classname = 'WoodLargeWallWin_DZ' OR Classname = 'WoodShack_DZ' OR Classname = 'WoodRamp_DZ' OR Classname = 'WoodLadder_DZ' OR Classname = 'WoodFloor_DZ' OR Classname = 'WoodFloorQuarter_DZ' OR Classname = 'WoodFloorHalf_DZ' OR Classname = 'Wooden_shed_DZ' OR Classname ='Land_DZE_WoodDoor' OR Classname = 'Land_DZE_LargeWoodDoor' OR Classname = 'Land_DZE_GarageWoodDoor' OR Classname = 'CinderWall_DZ' OR Classname = 'CinderWallHalf_DZ' OR Classname = 'CinderWallDoorway_DZ' OR Classname = 'CinderWallDoor_DZ' OR Classname = 'CinderWallSmallDoorway_DZ' OR Classname = 'CinderWallDoorSmall_DZ' OR Classname = 'Plastic_Pole_EP1_DZ' OR Classname = 'TentStorage' OR Classname = 'TentStorageDomed' OR Classname = 'TentStorageDomed2' OR Classname = 'LightPole_DZ' OR Classname ='SandNest_DZ' OR Classname = 'MetalFloor_DZ' OR Classname = 'Hedgehog_DZ' OR Classname = 'Sandbag1_DZ' OR Classname = 'WoodGate_DZ' OR Classname = 'Land_HBarrier1_DZ' OR Classname = 'Land_HBarrier3_DZ' OR Classname = 'Fence_corrugated_DZ' OR Classname = 'M240Nest_DZ' OR Classname = 'CanvasHut_DZ' OR Classname = 'ParkBench_DZ' OR Classname = 'MetalGate_DZ' OR Classname = 'OutHouse_DZ' OR Classname = 'WoodShack_DZ' OR Classname = 'StorageShed_DZ' OR Classname = 'StickFence_DZ' OR Classname = 'DesertCamoNet_DZ' OR Classname = 'ForestCamoNet_DZ' OR Classname = 'DesertLargeCamoNet_DZ' OR Classname = 'ForestLargeCamoNet_DZ' OR Classname = 'DeerStand_DZ' OR Classname = 'MetalPanel_DZ' OR Classname = 'WorkBench_DZ' );
END//
DELIMITER ;

 

so if i run this as a query in my database, when people die there buildables will updated to there new player id and there is no more replacing plot pole when they die?

Link to comment
Share on other sites

so if i run this as a query in my database, when people die there buildables will updated to there new player id and there is no more replacing plot pole when they die?

 

Yup. The ownership transfer only happens after server restart though, it's not immediate.

Link to comment
Share on other sites

so if i run this as a query in my database, when people die there buildables will updated to there new player id and there is no more replacing plot pole when they die?

 

 Close. When they respawn their buildables will be updated with the players new character ID.

Link to comment
Share on other sites

Pretty sure a respawn alone won't do it..

 

I'm not an SQL expert by any means, but following the logic of that trigger, when a new entry is made on the character_data table, it runs the trigger to change the plot pole of the previous character ID (if there is one), so in theory, when a player repawns after death, a new entry is made on the character_data table, which should run the trigger. I've added this to my server and asked anyone that dies to check this to see if it works after respawning.

Link to comment
Share on other sites

I'm not an SQL expert by any means, but following the logic of that trigger, when a new entry is made on the character_data table, it runs the trigger to change the plot pole of the previous character ID (if there is one), so in theory, when a player repawns after death, a new entry is made on the character_data table, which should run the trigger. I've added this to my server and asked anyone that dies to check this to see if it works after respawning.

 

Yes but the trigger is really no different from a regular query...it just fires off automatically without manual intervention. It's like when you increase vendor stock with an update statement, which only takes effect following a restart.

Link to comment
Share on other sites

Yes but the trigger is really no different from a regular query...it just fires off automatically without manual intervention. It's like when you increase vendor stock with an update statement, which only takes effect following a restart.

 

The event that updates stock is a scheduled event, which is why it has the line "ON SCHEDULE EVERY 1 DAY", whereas the code posted above is a trigger: "AFTER INSERT ON character_data", which is set off by the action of a line being added to the character_data table. Again, I'm not an expert on SQL and I'm making assumptions here based on the code, so maybe someone that knows SQL better than me can chime in?

Link to comment
Share on other sites

The event that updates stock is a scheduled event, which is why it has the line "ON SCHEDULE EVERY 1 DAY", whereas the code posted above is a trigger: "AFTER INSERT ON character_data", which is set off by the action of a line being added to the character_data table. Again, I'm not an expert on SQL and I'm making assumptions here based on the code, so maybe someone that knows SQL better than me can chime in?

 

UPDATE epoch.object_data SET CharacterID= NEW.CharacterID WHERE CharacterID IN ........ etc

 

This is the part that updates the objects to the new character ID. Updating database entries like this requires a restart to take effect. I've never had any player report that they were able to immediately access their buildables on a respawn, before a server restart. Following a restart, they can access everything just as they could on their previous character.

Link to comment
Share on other sites

UPDATE epoch.object_data SET CharacterID= NEW.CharacterID WHERE CharacterID IN ........ etc

This is the part that updates the objects to the new character ID. Updating database entries like this requires a restart to take effect. I've never had any player report that they were able to immediately access their buildables on a respawn, before a server restart. Following a restart, they can access everything just as they could on their previous character.

 

 

You are correct. I was just looking at the trigger. The characterID is changed immediately by the trigger, but that part of the database isn't loaded until restart. 

Link to comment
Share on other sites

  • 2 weeks later...

I added almost all modular/crafting objects to rocky123xo's version of remove.sqf a little while ago, to return the constructed item upon removal (not the components). Everything works fine in 1.0.3.1 but I must have missed something while updating the 1.0.4.2 version of remove.sqf...couldn't get it to work.

 

Anyhow, if anyone feels like helping, here's what I added: 

 

http://pastebin.com/0YWkr9Wb

 

Thanks

Link to comment
Share on other sites

  • 1 month later...

I added almost all modular/crafting objects to rocky123xo's version of remove.sqf a little while ago, to return the constructed item upon removal (not the components). Everything works fine in 1.0.3.1 but I must have missed something while updating the 1.0.4.2 version of remove.sqf...couldn't get it to work.

 

Anyhow, if anyone feels like helping, here's what I added: 

 

http://pastebin.com/0YWkr9Wb

 

Thanks

Any luck on the newest build getting this to work?

Link to comment
Share on other sites

  • 4 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...