Jump to content

[1.4.1] Snap Building PRO


Recommended Posts

if you are using different folder structure, make sure to adjust new paths in compiles and snap_build files.

default path is custom\snap_pro\

I have already done that but it still will not let me snap buildings together should I do something with the snappoints.hpp?

Link to comment
Share on other sites

Hi Raymix,

 

Any chance you could add some versioning as it is quite hard to reference which release you are currently on (with a couple of bug fix / enhancement releases so far) with people trying to merge with my A Plot for Life builds.

 

Cheers.

That would make sense I guess, I'll do it tomorrow and PM you when ready. 

 

 

I have already done that but it still will not let me snap buildings together should I do something with the snappoints.hpp?

Check the video on update post in previous page. It demonstrates and explains the installation, too (didn't realize music was a bit too loud).

Link to comment
Share on other sites

By the looks of it, people has trouble with anti-grief attempt. Apparently it needs to check if PP is "alive" and check if PP is also friendly/owner. I'm really not a big fan of typing same code/logic in same script multiple times... these checks should be function based tbh.

Link to comment
Share on other sites

By the looks of it, people has trouble with anti-grief attempt. Apparently it needs to check if PP is "alive" and check if PP is also friendly/owner. I'm really not a big fan of typing same code/logic in same script multiple times... these checks should be function based tbh.

 

I spent a day working on doing just that and found that the plot pole owner check is slightly different in the different scripts.

 

Playerbuild checks for the most things (are you building another plot pole or just a modular item - affects find nearest distance), remove.sqf just checks not owner or not friendly and needs to return the _limit (animation cycles to remove), upgrade and downgrade scripts are more or less the same for the plot pole check.  

 

By the time I had stopped banging my head on the table I had removed around 100 lines from those 4 scripts but the function had grown to 80 lines, what with the overhead of defining the variables, giving initial values and the logic to take in to account all requirements)...  Made me think the underlying process would need rewriting for better gains from functionising that block of code.

 

I would expect the animation and check for space interrupt may be a better opportunity ;)

Link to comment
Share on other sites

@RayMix,

 

Just as an informational / bug report:

if(_location1 distance _objectHelperPos > 10) exitWith {
_isOk >
  Error position: <_objectHelperPos > 10) exitWith {
_isOk >
  Error Undefined variable in expression: _objecthelperpos
File mpmissions\__CUR_MP.Tavi\custom\snap_pro\player_build.sqf, line 451
Error in expression <tHelper;
};
};


if(_location1 distance _objectHelperPos > 10) exitWith {
_isOk >
  Error position: <_objectHelperPos > 10) exitWith {
_isOk >
  Error Undefined variable in expression: _objecthelperpos
File mpmissions\__CUR_MP.Tavi\custom\snap_pro\player_build.sqf, line 451

is being spammed hard in the client RPT with the Steam Patch (Sorry with GTX Gaming so had to upgrade) So server / client version is: 1.63.125548 - latest snap_pro

 

Regards,

 

Pry

Link to comment
Share on other sites

@PryMary: Yeah that bug was reported 2 pages ago. It was just an attempt to fix tiny griefing problem that's already in a game, but since it was not a popular one, guess I'll just remove it for time being until I come up with something better.

 

@RimBlock: Guess if we convert it to be function based, it would make sense to convert few local vars into global and use them to check state of player_build from outside of script. This way scripters could adapt their scripts to build system without changing the original and still retain ability to control it remotely.

Unless you know of a better way to detect if function is running? Figured out a better way to do it.

 

edit: working on function based player_build now. Gonna post my results later today, see what you guys think of it.

Link to comment
Share on other sites

Not sure if this is a bug or not, but if a player tries to snap to a old building after server restart or death the snapping points disappear for the old building and it wont snap.

it could be a bug due to base grief addition that I removed. Could you please download latest version and check again?

Link to comment
Share on other sites

@PryMary: Yeah that bug was reported 2 pages ago. It was just an attempt to fix tiny griefing problem that's already in a game, but since it was not a popular one, guess I'll just remove it for time being until I come up with something better.

 

@RimBlock: Guess if we convert it to be function based, it would make sense to convert few local vars into global and use them to check state of player_build from outside of script. This way scripters could adapt their scripts to build system without changing the original and still retain ability to control it remotely.

Unless you know of a better way to detect if function is running? Figured out a better way to do it.

 

edit: working on function based player_build now. Gonna post my results later today, see what you guys think of it.

 

I was calling the checkplot function passing an array [calling script, classname, distance, limit] IIRC and populating the functions variables based on the calling script, working the logic flow based on calling script and then outputing an array variables [canbuild, isplot, distance, limit] which the calling script then puts in to its local variables depending on which ones it needs.

 

The bits that added extra code were check if the class is a plot pole (required by player_build), set the distance to search for a plot pole in (usually 30 unless it is a plot pole then 45 - stored in a global variable), check not owner and not friendly (required fro remove.sqf), check if owner or is friendly (required for most apart from remove.sqf).

 

Thinking about it, if _canbuild = false then .... would sort out the remove.sqf requirement after the owner & friendlies check...

 

I presonally prefer not to use global variables as they could be changed anywhere by anything and if a mod creates a situation with two scripts running both trying to check ownership (i.e. one spawned from another so they run in parallel) then it could result in quite a mess and be a P.I.T.A to debug ;) .

 

WHat way are you now looking to use for passing parameters ?.

Link to comment
Share on other sites

it could be a bug due to base grief addition that I removed. Could you please download latest version and check again?

This is the same problem I've had for the last few days, I've been removing things left right and centre trying to get snap build to work, will also try the latest build. 

 

Really needed a version history to see where we are at and what is the latest version with fixes. 

Link to comment
Share on other sites

Hi raymix,

just one question, because I had issues with not being able to return to the players lobby by pressing ESC after installing Snap Pro. I figured out it was because of the lines of code on line 23 of dayz_spaceInterrupt.sqf.

// Disable ESC after death
/*
if (_dikCode == 0x01 && r_player_dead) then {
    _handled = true;
};

I wonder now, why these lines are in there. Commenting them out did not seem to harm the other parts of your scripts.

 

Thx

Link to comment
Share on other sites

Hi raymix,

just one question, because I had issues with not being able to return to the players lobby by pressing ESC after installing Snap Pro. I figured out it was because of the lines of code on line 23 of dayz_spaceInterrupt.sqf.

// Disable ESC after death
/*
if (_dikCode == 0x01 && r_player_dead) then {
    _handled = true;
};

I wonder now, why these lines are in there. Commenting them out did not seem to harm the other parts of your scripts.

 

Thx

You must be running 1.0.4.2 then. As of 1.0.5 this is part of dayz, and snap pro was designed for 1.0.5.* only. Commenting them out for now is actually a nice fix. I'll add your post to Q&A.

1.0.5 does not let you press ESC, wait 10sec to exit anymore, it kicks players to lobby automatically in 5 seconds.

Link to comment
Share on other sites

Yes, you are right. It's 1.0.4.2.. Was not sure if I should mention it. Thought why could have this been changed between 1.0.4.2 and 1.0.5.1. Something learned. Time for me to finally update my server to 1.0.5.1 I guess. Thx a lot for your fast response.

Link to comment
Share on other sites

it could be a bug due to base grief addition that I removed. Could you please download latest version and check again?

I redownloaded everything and I still get the same issue it wont snap. I am wondering if this is due to PryMary's player_build to get the Plot for Life to work.

Link to comment
Share on other sites

I redownloaded everything and I still get the same issue it wont snap. I am wondering if this is due to PryMary's player_build to get the Plot for Life to work.

 

Are you using the most recent merged file ?.  PryMary has produced another couple linked to from the first post of my A Plot for Life mod (see my sig for the link) .

Link to comment
Share on other sites

Finally figured out the issue. Snapping does work for me, but when a modular item clips into the ground I can no longer snap to it. Any idea what is causing this? I am using the latest build of Snap Pro and PPL all files checked for paths and used diff merge to double check all files but still no luck. 

 

Took me awhile to figure this one out  :rolleyes:

Link to comment
Share on other sites

Finally figured out the issue. Snapping does work for me, but when a modular item clips into the ground I can no longer snap to it. Any idea what is causing this? I am using the latest build of Snap Pro and PPL all files checked for paths and used diff merge to double check all files but still no luck. 

 

Took me awhile to figure this one out  :rolleyes:

 

Hrm, I wonder if that is what I am experiencing as well, will have to try and see. 

Link to comment
Share on other sites

Hi i have gone through the posts, and i am Very sorry if it has been said on how to do this, But maybe im blind through looking to much.

 

I have plot pole for life,

 

I have seen  http://epochmod.com/forum/index.php?/topic/13886-release-snap-building-pro/?p=99915 post on a merged  ( player_build)  Now please.

 

What (player_build) do i replace it with the one from pp for life or build pro one, Do i keep the one i do not replace.

 

And as i already have PP for life in i also have   (call compile preprocessFileLineNumbers "init\compiles.sqf") line in my int file.

 

so my compiles folder already has this line (player_build = compile preprocessFileLineNumbers "custom\PlotForLifev2\player_build.sqf";)

 

But the instructions say to add this ( player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";) 

 

Please forgive my noobness but i do see players saying it work altogether.

 

Many thanks Keith

Link to comment
Share on other sites

Hi i have gone through the posts, and i am Very sorry if it has been said on how to do this, But maybe im blind through looking to much.

 

I have plot pole for life,

 

I have seen  http://epochmod.com/forum/index.php?/topic/13886-release-snap-building-pro/?p=99915 post on a merged  ( player_build)  Now please.

 

What (player_build) do i replace it with the one from pp for life or build pro one, Do i keep the one i do not replace.

 

And as i already have PP for life in i also have   (call compile preprocessFileLineNumbers "init\compiles.sqf") line in my int file.

 

so my compiles folder already has this line (player_build = compile preprocessFileLineNumbers "custom\PlotForLifev2\player_build.sqf";)

 

But the instructions say to add this ( player_build = compile preprocessFileLineNumbers "custom\snap_pro\player_build.sqf";) 

 

Please forgive my noobness but i do see players saying it work altogether.

 

Many thanks Keith

You need to get PryMarys player_build. And call that player_build only from compiles as it has the edits for plot for life and snap build pro. You only need on player_build to be called. I just put it in snap pro's folder and called it from there. 

Link to comment
Share on other sites

Okay, so I am having an odd problem; seemingly randomly when building something (anything) I will not get snap points on any other built objects. I can cancel the current build and from what I have seen thus far is to zoom in on something and then attempt to build again. Sometimes this works, sometimes not. Very odd behavior.

 

I am using with Overpoch, so I am not sure if that has something to do with it or not. Nothing in the RPT to indicate an issue, and currently the only other mod I have installed is Axe Cop's Service Point. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

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