Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-06-2010, 08:02 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Making a WNPC wait until Level functions are executed

Is there a way to make a function in a WNPC(say, onPlayerenters()) wait until the same function in the level is called before continuing? For example I have a scripted map that relies on default map being disabled. However on servers like UN with extensive level scripts running all the time and some enabling the default map, depending on circumstance and lag, the level function is called after the WNPC map's, thus reenabling the default map after my script has disabled it.

This is what I tried:
PHP Code:
function onPlayerenters() {
  
disablemap();
  
waitfor(level,"onPlayerEnters",5);
  
player.chat "test";
  
disablemap();

But that doesn't seem to work. Any ideas?
Reply With Quote
  #2  
Old 03-06-2010, 08:34 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Something like this should work fine.

PHP Code:
function onPlayerEnters() {
  
disablemap();
  
this.scheduleevent(0.1"DisableMap""");
}
function 
onDisableMap() {
  
disablemap();

Poor UN and it's endless amount of legacy scripts
__________________
Quote:
Reply With Quote
  #3  
Old 03-06-2010, 09:00 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
I get the feeling that would simply do a .1 delay... that's not really going to work. Depending on lag sometimes even 5 second delays aren't good enough to counter the problem.
Reply With Quote
  #4  
Old 03-07-2010, 12:18 AM
12171217 12171217 is offline
Banned
Join Date: Jan 2009
Posts: 453
12171217 has a spectacular aura about
Ping (triggerserver) the client when he enters the level, then when the server responds (triggerclient), everything should be set to go, that way you circumvent the lag time.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:23 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.