Blockland Forums > Modification Help
Event: onPlayerFirstSpawn not working
<< < (4/6) > >>
phflack:
just suggesting a way so the code actualy works, instead of telling him not to do it at all
xXBeibsFan119Xx:

--- Quote from: phflack on May 06, 2012, 12:59:09 PM ---just suggesting a way so the code actualy works, instead of telling him not to do it at all

--- End quote ---

That's what I did.
Kalphiter:
You also need to return onClientEnterGame or else you will get occasional crashes
Mordius:

--- Quote from: Greek2me on May 06, 2012, 09:27:08 AM ---Do what xXBeibsFan119Xx (Jookia) said and simply make a tab-delimited list of every brick containing the event, then loop through that list and call the event on each of the bricks in it.

--- End quote ---

Okay, that makes sense, but I have a few questions. First, what does the term "tab-delimited list" mean? Is this referring to an array of tab-seperated object handles, and if so, how would I initialize such a list? Next, how do I find the bricks containing this event so that I can add them to the list?
xXBeibsFan119Xx:

--- Quote from: Mordius on May 07, 2012, 05:37:57 PM ---Okay, that makes sense, but I have a few questions. First, what does the term "tab-delimited list" mean? Is this referring to an array of tab-seperated object handles, and if so, how would I initialize such a list? Next, how do I find the bricks containing this event so that I can add them to the list?

--- End quote ---

A tab-delimited list is just a list of thing, separated by items. Torque just refers to items by IDs, so you can put those in a long string seperated by something, then use getWord (or getField in cases you want multiple words, just separate with tabs) and getWordCount to traverse the string, and use each word as a brick, no typecasting is needed.

Finding the bricks containing the event can be done two ways: Looping through the hundreds of thousands of bricks in the world, or just hooking in to when events are added and removed and modifying to the list, and then traversing the list on the connection.
Navigation
Message Index
Next page
Previous page

Go to full version