Jump to content

add "onResourceFinishedStarting" Event.


Hyunsu

Recommended Posts

"A" is big resource.

"B" is 1kb resource.

i want to start "B" after starting "A".

but i can't.

-- script in "A" resource.

function startingB()

startResource(getResourceFromName("B"));

end

addEventHandler("onResourceStart", getResourceRootElement(), startingB);

-- at Console , (i typed "start A")

starting "A"

starting "B"

start: Resource "B" stated

start: Resource "A" stated

i want to add "FinishedStarting".

Edited by Guest
Link to comment
"A" is big resource.

"B" is 1kb resource.

i want to start "B" after starting "A".

but i can't.

-- script in "A" resource.

function startingB()

startResource(getResourceFromName("B"));

end

addEventHandler("onResourceStart", getResourceRootElement(), startingB);

-- at Console , (i typed "start A")

starting "A"

starting "B"

start: Resource "B" stated

start: Resource "A" stated

i want to add "onResourceStarted".

or

add return of getResourceState a "started".

onResourceStart and onResourceStarted...

IS NOT THAT THE SAME THING!?!??

Link to comment
You want to run B after start up the server?

If so, try using a timer. I have the same problem and I solved it using a timer 50ms :)

yes, it's my wanting.

but, that's not safe. we don't know when resource finished starting.

Edited by Guest
Link to comment
I'm not sure of what are you trying to say, but getResourceState includes many states, such as: loaded, starting.

So i don't really get what do you mean.

sorry, my bad english.

i already did getResourceState.

"when resource start" and "when resource finished starting" were always "running". not changed.

Edited by Guest
Link to comment

What do you exactly want to do, with that event? Maybe you could do a script for that, instead of using that event:

addEventHandler ( "onResourceStart", getRootElement ( ),  
       function ( )  
            setTimer ( triggerEvent, 500, 1, "onResourceStarted", getResourceRootElement ( ) )  
       end ) 

Or something like that, I don't know hehe :)

Link to comment
You want to run B after start up the server?

If so, try using a timer. I have the same problem and I solved it using a timer 50ms :)

yes, it's my wanting.

but, that's not safe. we don't know when resource finished starting.

Try to scale the file-size with timers.

If file-size is 10 kb, use setTimer 500, if its 1 mb, try to use 1000.

If the resource is 1 kb, use just 50.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...