dim3 Forum

Full Version: dim3 v2.5 b9 (Render Test)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How about this change for messages -- it will keep code compatibility but give you the extra data you need. The numbers are really there to route, but I can have something like:

Code:
...event.setMessageData("abc","def",.... variable number);
...event.sendMessageToPlayer(); // same routine as before
....
....
  // event has come in
     var str=xxx.event.getMessageData(0); // str = "abc"

You can use the same code as always, but you can send extra data along. It will be two calls instead of one, though.

For the meshes in Editor, I'll add something like:

(x) send message on entry id: 0 data: abc

[>] Brian
Genius! Much thanks. What is "abc" and "def" if variable number is the variable to be assigned?
teh1ghool Wrote:Genius! Much thanks. What is "abc" and "def" if variable number is the variable to be assigned?

What I'm thinking is they could be any javascript value, a number, a string, or even an array if you wanted it to be. Haven't finalized, but something like:

......(new Array("abc","def"),1,82,0.2,"ghi")

etc.

[>] Brian
ccccc has sent me a perplexing crash that I just tracked down. He's got a script that re-enters the same event multiple times; this causes all sorts of havok in the scripting engine. I'm going to have to setup a way to deal with this. ccccc, I'll have more for you later.

(For the curious, what's going on is an object gets a damage event, the damage event launches a melee, which damages nearby objects, which spawn their own melee, which sends another damage event to the object already damaged Smile First off, there's some places where I could put catches to make sure this round-robin doesn't happen. Secondly, though, this could happen in other places and I need to be ready for it.)

[>] Brian
ggadwa Wrote:ccccc has sent me a perplexing crash that I just tracked down. He's got a script that re-enters the same event multiple times; this causes all sorts of havok in the scripting engine. I'm going to have to setup a way to deal with this. ccccc, I'll have more for you later.

(For the curious, what's going on is an object gets a damage event, the damage event launches a melee, which damages nearby objects, which spawn their own melee, which sends another damage event to the object already damaged Smile First off, there's some places where I could put catches to make sure this round-robin doesn't happen. Secondly, though, this could happen in other places and I need to be ready for it.)

[>] Brian

So...basically a chain-reaction of explosions crashes the engine? That's a problem. Smile
What I am asking is why are there two fields before the variable number field? or were you listing possibilities? If so wouldn't it be better to do the following? Keep it organized? Otherwise, looking at it how a scripting engine would parse it, it makes absolutely no sense. xD

x.event.setMessageData(("foo", "bar", etc), variable_number);
er... I think it's not the variable number, but a variable number. Any number.
So it would look like:
Code:
x.event.setMessageData("lol",134,12,0.2,"This is a string.");
x.event.sendMessageToPlayer();
//bla bla bla
var str = x.event.getMessageData(0); // "lol"
var str = x.event.getMessageData(1); // 134
var str = x.event.getMessageData(4); // "This is a string."
Maybe I'm wrong though.
Bink Wrote:er... I think it's not the variable number, but a variable number. Any number.
So it would look like:
Code:
x.event.setMessageData("lol",134,12,0.2,"This is a string.");
x.event.sendMessageToPlayer();
//bla bla bla
var str = x.event.getMessageData(0); // "lol"
var str = x.event.getMessageData(1); // 134
var str = x.event.getMessageData(4); // "This is a string."
Maybe I'm wrong though.

Exactly.

[>] Brian
Okay, cool. Looks good to me. Make sure that sending it again would overwrite?
Brian---thanks for explaining the problem, I can easily fix it now. Smile
Reference URL's