Jump to content
  • 0

(SOLVED) all scripts using sleep2 shown debug in console.. How to fix this?


rakuzas

Question


  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

Hello,

I just notice this and all scripts using sleep2 got error.. 

And mining script I use also not working properly and got too many debug message.. 

erro2.png.f2740012076fcbd190eacf350e2e9d68.png

erro23.png.cc71845a54dd25da70fa25132c61781d.png

 

How can I fix this? 

In script_commands.txt 

*sleep {<milliseconds>};
*sleep2 {<milliseconds>};
*awake "<NPC name>";

These commands are used to control the pause of a NPC.
sleep and sleep2 will pause the script for the given amount of milliseconds.
Awake is used to cancel a sleep. When awake is called on a NPC it will run as
if the sleep timer ran out, and thus making the script continue. Sleep and sleep2
basically do the same, but the main difference is that sleep will not keep the rid,
while sleep2 does. Also sleep2 will stop the script if there is no unit attached.

Examples:
	sleep 10000; //pause the script for 10 seconds and ditch the RID (so no player is attached anymore)
	sleep2 5000; //pause the script for 5 seconds, and continue with the RID attached.
	awake "NPC"; //Cancels any running sleep timers on the NPC 'NPC'.

EDIT : SOLVED!

Edited by rakuzas
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 1

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1677
  • Reputation:   703
  • Joined:  12/21/14
  • Last Seen:  

sleep for npc

sleep2 for players

i see here at the last of the script

OnInit:
goto Lwalk;
end;
Lwalk:
sleep2 1000;
npcwalkto rand(107,39),rand(60,99);
goto Lwalk;
end;

OnInit = no player so use sleep not sleep2

check the script for more errors like that

edit:

as i see this would fix all the errors

Edited by sader1992
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  152
  • Topics Per Day:  0.04
  • Content Count:  459
  • Reputation:   6
  • Joined:  06/29/12
  • Last Seen:  

9 minutes ago, sader1992 said:

sleep for npc

sleep2 for players

i see here at the last of the script

OnInit:
goto Lwalk;
end;
Lwalk:
sleep2 1000;
npcwalkto rand(107,39),rand(60,99);
goto Lwalk;
end;

OnInit = no player so use sleep not sleep2

check the script for more errors like that

edit:

as i see this would fix all the errors

Ahhh.. It does fix it.. Why I not test it before.. /sry 

Now it all works.. Thanks a lot.. /no1

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.01
  • Content Count:  21
  • Reputation:   0
  • Joined:  05/15/21
  • Last Seen:  

On 10/9/2017 at 6:37 PM, rakuzas said:

Hello,

I just notice this and all scripts using sleep2 got error.. 

And mining script I use also not working properly and got too many debug message.. 

erro2.png.f2740012076fcbd190eacf350e2e9d68.png

erro23.png.cc71845a54dd25da70fa25132c61781d.png

 

How can I fix this? 

In script_commands.txt 


*sleep {<milliseconds>};
*sleep2 {<milliseconds>};
*awake "<NPC name>";

These commands are used to control the pause of a NPC.
sleep and sleep2 will pause the script for the given amount of milliseconds.
Awake is used to cancel a sleep. When awake is called on a NPC it will run as
if the sleep timer ran out, and thus making the script continue. Sleep and sleep2
basically do the same, but the main difference is that sleep will not keep the rid,
while sleep2 does. Also sleep2 will stop the script if there is no unit attached.

Examples:
	sleep 10000; //pause the script for 10 seconds and ditch the RID (so no player is attached anymore)
	sleep2 5000; //pause the script for 5 seconds, and continue with the RID attached.
	awake "NPC"; //Cancels any running sleep timers on the NPC 'NPC'.

EDIT : SOLVED!

Can you tell me how did you solve this error?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...