Author Topic: how do i apply updates to addons with out restarting BL?  (Read 2469 times)

Title says it all, if theres a way to do that I can save countless hours trying to pan and set dimensions for models.

As you're changing the model. Pretty sure that exec("Add-Ons"/My_File/server.cs"); transmiteDataBlocks(); should work if it's on Single Player.

As you're changing the model. Pretty sure that exec("Add-Ons"/My_File/server.cs"); transmiteDataBlocks(); should work if it's on Single Player.

just type that in the console? or in chat?

As you're changing the model. Pretty sure that exec("Add-Ons"/My_File/server.cs"); transmiteDataBlocks(); should work if it's on Single Player.
exec("Add-Ons/My_File/server.cs"); transmitDataBlocks();
Fixed

just type that in the console? or in chat?
Console


e(Addon_Name); is much faster, by the way. Also, I've never needed to use transmitDataBlocks(); - what exactly is it supposed to do?

e(Addon_Name); is much faster, by the way. Also, I've never needed to use transmitDataBlocks(); - what exactly is it supposed to do?
The problem with e() is that it's only defined in the server scripts; you won't be able to use it if you're making a client-side add-on
If I'm making something large that requires constant reexecing, I just define an e<addon abbreviation> function which saves even more typing
« Last Edit: August 18, 2014, 12:08:47 PM by Headcrab Zombie »

The problem with e() is that it's only defined in the server scripts; you won't be able to use it if you're making a client-side add-on
If I'm making something large that requires constant reexecing, I just define an e<addon abbreviation> function which saves even more typing
Mmm, didn't know that was server-exclusive. That could explain some issues I've had in the past.

Not tested so it may not work, but the idea is that you can just put ex("Server_Test"); or ex("Add-Ons/Server_Test/server.cs"); and they would both work. It will also execute any client.cs files in case of doing something like RTB where it contains both.

Code: [Select]
function ex(%p)
{
setmodpaths(getmodpaths());
if(substr(%p, 0, 6) $= "Add-Ons")
exec(%p);
else {
%np = "Add-Ons/" @ %p @ "/server.cs";
if(isFile(%np))
exec(%np);
%nnp = "Add-Ons/" @ %p @ "/client.cs";
if(isFile(%nnp))
exec(%nnp);
}
transmitDatablocks();
}

Not tested so it may not work, but the idea is that you can just put ex("Server_Test"); or ex("Add-Ons/Server_Test/server.cs"); and they would both work. It will also execute any client.cs files in case of doing something like RTB where it contains both.

Code: [Select]
function ex(%p)
{
setmodpaths(getmodpaths());
if(substr(%p, 0, 6) $= "Add-Ons")
exec(%p);
else {
%np = "Add-Ons/" @ %p @ "/server.cs";
if(isFile(%np))
exec(%np);
%nnp = "Add-Ons/" @ %p @ "/client.cs";
if(isFile(%nnp))
exec(%nnp);
}
transmitDatablocks();
}
Nope. That won't work.
1. You're thinking of getSubStr, not subStr, which does not exist.
2. The usage for getSubStr is getSubStr(string str, int start, intNumChars); so getSubStr(%string, 0, 6); would return the first six characters. "Add-Ons" is 7 characters long.
3. Just because %p starts with "Add-Ons", you can't assume that the rest is good. What if I just did ex("Add-Ons"); or ex("Add-Ons/Pie/Cake/Cookie"); ? You're also not checking if the file exists if the first if statement is true.

Nope. That won't work.
1. You're thinking of getSubStr, not subStr, which does not exist.
2. The usage for getSubStr is getSubStr(string str, int start, intNumChars); so getSubStr(%string, 0, 6); would return the first six characters. "Add-Ons" is 7 characters long.
3. Just because %p starts with "Add-Ons", you can't assume that the rest is good. What if I just did ex("Add-Ons"); or ex("Add-Ons/Pie/Cake/Cookie"); ? You're also not checking if the file exists if the first if statement is true.

Not tested so it may not work
I wrote it in a few minutes. You literally threw a fit over this.

1. Used to other programming languages. I don't spend all day programming for Blockland.
2. My bad
3. Exec function checks if it exists. If not, just gives you an error. This wouldn't be put in the hands of normal users. What makes you think I would put in if statements that only check for stupidity?

I wrote it in a few minutes. You literally threw a fit over this.

1. Used to other programming languages. I don't spend all day programming for Blockland.
2. My bad
3. Exec function checks if it exists. If not, just gives you an error. This wouldn't be put in the hands of normal users. What makes you think I would put in if statements that only check for stupidity?
Just because he corrected you doesn't mean you need an excuse. Own up to your mistakes and take his advice.

Just because he corrected you doesn't mean you need an excuse. Own up to your mistakes and take his advice.
I could write something close to that and I bet it would work fine.

I wrote it in a few minutes. You literally threw a fit over this.
Wow. Try to help someone and they insult you.