Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - boodals 2

Pages: 1 2 3 4 5 [6] 7 8 9 10 11 ... 66
76
Modification Help / Re: optimize ScriptObject creation?
« on: July 15, 2015, 02:10:10 PM »
Doesn't seem to be anything that could be optimized in the posted code. Instead of trying to optimize that function, try to reduce the amount of times you're calling that function.

77
Modification Help / Re: Item Variable Persistence?
« on: July 10, 2015, 08:04:18 PM »
If you overwrite the function without using a package then existing packages will still work and call your function instead

Oh wow, I didn't know that.. Well, I guess that makes it all a lot easier.

78
Modification Help / Re: Item Variable Persistence?
« on: July 10, 2015, 10:19:53 AM »
This isn't something add-on devs have control over

Sure it is, use this, or just a client.cs which packages the start game function, and executes the specific files before other add-ons (although that method wouldn't work for dedicated).

79
Modification Help / Re: Why is it not echoing %pl.rads
« on: July 10, 2015, 08:56:28 AM »
You should learn to check your own code, a lot of these errors were very simple and easily fixed. Learning how to debug it fully might help. Learn how to use trace to see if functions are being called correctly, and echo at the right places to see what section of the code is messing up.

80
Modification Help / Re: Item Variable Persistence?
« on: July 10, 2015, 08:47:55 AM »
Unfortunately, the only way to find the dropped item that I know of is with a radius search

I believe Item::onAdd(%item) should work (assuming that's a function, might be ItemData::onAdd(%data, %item) )


Can someone who has access to the encrypted .dso files post serverCmdDropTool , he could recreate it to return the dropped item.
Speaking of that, someone needs to make a resource of a bunch of fixed functions such as this, and make it load before other add-ons to keep compatibility.

81
Probably the easiest method is just to generate a random point within the square, then if its within the circle, pick another point and try again..

Code: [Select]
while(1) {
  %x = getRandom() * %s - %s / 2;
  %y = getRandom() * %s - %s / 2;

  if(vectorLen(%x SPC %y) >= %r)
    return %x SPC %y;
}

However, that could take many iterations if the radius is big.

82
this is actually pretty useful to know. this is why you don't lock coding help threads, bow, because stuff like this can pop up and you learn something and it helps the coding community overall

And also because other people could have similar problems, and so they can re-use a topic instead of creating a duplicate.
And also because people may be able to correct false information or give additional information.
And also because people could give you more optimized, or otherwise better, versions of code.

There's literally no advantage to locking topics here.

83
here's a little secret: add-ons don't actually need a namecheck.txt
idk why it's used, maybe someone else knows

I believe it's for when you define a path to a file in your add-on, like if you did shape = "Add-ons/Weapon_Gun/gun.dts"; instead of doing the smart thing and using expandFileName. It stops it from breaking if people rename the add-on.

84
Modification Help / Re: Strings || Bricks
« on: July 06, 2015, 09:19:42 PM »
The reason various raycasts weren't detecting the bricks you planted is that the bricks weren't actually there. Its a weird issue that has caused me many headaches in the past. If a brick fails to plant, for whatever reason (with the exception of floating bricks if you bypass the plant function), then it wont exist in the world according to the server, but it is still rendered and exists normally for clients. Client sided prediction code thinks that it is a perfectly fine brick, but if you walk on it, (after a moments hesitation due to latency) you'll teleport through. There's a few other weird things like this, where clients are desynced from the server.

I recommend you make a reliable function that places a brick, then only use that.

Code: [Select]
%lastBrick = new fxDTSBrick() {
...
};
%plant = %lastBrick.plant();

if(!%lastBrick.isPlanted) {
switch(%plant) {
case 2: //Floating brick, force plant
%lastBrick.isPlanted = 1;
%lastBrick.plant();

default:
%lastBrick.delete();
return 0;
}
}

%lastBrick.setTrusted(1);
%lastBrick.dataBlock.onTrustCheckFinished(%lastBrick);

%brickGroup.add(%lastBrick);
if(isObject(%brickGroup.client))
%brickGroup.client.wrenchBrick = %lastBrick; //Removes some errors with events

That should handle most errors you'll find.

85
Add-Ons / Re: Super Sanic Fast Playertype!
« on: July 06, 2015, 09:16:18 PM »
Its not generally a good idea to post one-line edit add-ons such as this, unless it improves an already existing thing.

86
Modification Help / Re: Strings
« on: July 06, 2015, 12:26:33 PM »
Using a single variable is much less efficient because you have to loop through them all. If you have 200 sticks, then pick up a rock, and a piece of code wants to see if the player has a rock, then you'll have to loop through 200 iterations, using getWord (and probably more functions) each iteration.

Generally, its a bad idea to store data in strings like this. It is sometimes necessary though, if you are returning it.

87
For deletion, %brick.delete(); will delete the brick instantly, possibly creating floating bricks, and %brick.killBrick(); (or was it just .kill() ?) will play the death animation, and cause supported bricks to be killed. If this is a tool that anybody can use, make sure to do trust checks first!


As for detection, use raycast methods. As far as I know, that is how relays work.

88
Yeah but wouldn't that detach from their brickgroup?

You seem to not understand the difference between a group and a set.

An object has to be in exactly one group (simGroup or scriptGroup or a GUI object), but can be in as many sets (simSet) as you like.



I would recommend that you had a separate simSet for each brickgroup, unless you'll never need to get an individuals bricks.

89
You cant actually get the node that the projectile hit, as it hits the collision box, not the model. The paint can projectiles just estimate based on z offset, eg if its less than 0.15, then change the feet colors, etc. You'll have to find these values yourself, or you may be able to call the paint projectiles function which handles this (which is probably the better option).

Run a trace, spray someone, and see what function handles it.

90
edit: I should probably add that autowrench isn't client-sided, so Advanced Bot's is better for using on other servers.

What? Yes it is. It's entirely client sided. All it does is press the send button the moment you wrench a brick.

Pages: 1 2 3 4 5 [6] 7 8 9 10 11 ... 66