Jump to content

Home

[K1] Fade in problem


sekan

Recommended Posts

Hi,

 

I have made a dialog and attached a script that in the end will destroy 3 npcs and put a fade out during that process. Before the script worked fine in some ways. Than i changed something to get rid of a bug. It seems that i have get rid of that but know i get a bigger bug. It's fade out but it never fade in. The screen remains black.

 

This is the script

 

void main() {  

object oNPC1=GetObjectByTag("lrwooli");
object oNPC2=GetObjectByTag("wookie_sekan02");
object oNPC3=GetObjectByTag("wookie_sekan01");
ActionDoCommand(SetCommandable(TRUE,oNPC1)); 
ActionDoCommand(SetCommandable(TRUE,oNPC2)); 
ActionDoCommand(SetCommandable(TRUE,oNPC3));
ActionPauseConversation(); 
NoClicksFor(5.0);
SetGlobalFadeOut(1.5, 0.5);
AssignCommand (oNPC1,ActionDoCommand(DestroyObject(oNPC1))); 
AssignCommand (oNPC2,ActionDoCommand(DestroyObject(oNPC2))); 
AssignCommand (oNPC3,ActionDoCommand(DestroyObject(oNPC3))); 
DelayCommand(1.0,SetGlobalFadeIn(2.5,0.5));
ActionResumeConversation();
}

 

Anybody that can find a error?

Link to comment
Share on other sites

void main() {
object oNPC1=GetObjectByTag("lrwooli");
object oNPC2=GetObjectByTag("wookie_sekan02");
object oNPC3=GetObjectByTag("wookie_sekan01");

ActionDoCommand(SetCommandable(TRUE,oNPC1)); 
ActionDoCommand(SetCommandable(TRUE,oNPC2)); 
ActionDoCommand(SetCommandable(TRUE,oNPC3));
ActionPauseConversation(); 

NoClicksFor(5.0);

SetGlobalFadeOut(1.5, 0.5);
AssignCommand (oNPC1,ActionDoCommand(DestroyObject(oNPC1))); 
AssignCommand (oNPC2,ActionDoCommand(DestroyObject(oNPC2))); 
AssignCommand (oNPC3,ActionDoCommand(DestroyObject(oNPC3))); 
SetGlobalFadeIn([color=red]2.5[/color],0.5);
ActionResumeConversation();
}

 

Since this parameter is the delay for the fade in I assume that you intentionally set this to 2.5 and so you could just add another second on.

 

The script looks fine so I think its just because your using the DelayCommand function with it and it has a delay parameter already.

 

Hope that works ;)

Link to comment
Share on other sites

void main() {
object oNPC1=GetObjectByTag("lrwooli");
object oNPC2=GetObjectByTag("wookie_sekan02");
object oNPC3=GetObjectByTag("wookie_sekan01");

ActionDoCommand(SetCommandable(TRUE,oNPC1)); 
ActionDoCommand(SetCommandable(TRUE,oNPC2)); 
ActionDoCommand(SetCommandable(TRUE,oNPC3));
ActionPauseConversation(); 

NoClicksFor(5.0);

SetGlobalFadeOut(1.5, 0.5);
AssignCommand (oNPC1,ActionDoCommand(DestroyObject(oNPC1))); 
AssignCommand (oNPC2,ActionDoCommand(DestroyObject(oNPC2))); 
AssignCommand (oNPC3,ActionDoCommand(DestroyObject(oNPC3))); 
SetGlobalFadeIn([color=red]2.5[/color],0.5);
ActionResumeConversation();
}

 

Since this parameter is the delay for the fade in I assume that you intentionally set this to 2.5 and so you could just add another second on.

 

The script looks fine so I think its just because your using the DelayCommand function with it and it has a delay parameter already.

 

Hope that works ;)

 

Thanks it works now :D

Link to comment
Share on other sites

I have made a dialog and attached a script that in the end will destroy 3 npcs and put a fade out during that process. Before the script worked fine in some ways. Than i changed something to get rid of a bug. It seems that i have get rid of that but know i get a bigger bug. It's fade out but it never fade in. The screen remains black.

 

Try this variant and see how it works. You seem to be doing a lot of assigning for no apparent gain, and your ResumeConversation will be queued immediately, not after 5 seconds. Presumably you want to resume after the fade in/out has completed?

void main() {
   ActionPauseConversation(); 

   object oNPC1 = GetObjectByTag("lrwooli");
   object oNPC2 = GetObjectByTag("wookie_sekan02");
   object oNPC3 = GetObjectByTag("wookie_sekan01");

   NoClicksFor(5.0);
   SetGlobalFadeOut(1.5, 0.5);
   SetGlobalFadeIn(3.5, 0.5);

   SetCommandable(TRUE, oNPC1); 
   SetCommandable(TRUE, oNPC2); 
   SetCommandable(TRUE, oNPC3);

   DelayCommand(2.5, DestroyObject(oNPC1)); 
   DelayCommand(2.5, DestroyObject(oNPC2)); 
   DelayCommand(2.5, DestroyObject(oNPC3)); 

   DelayCommand(5.0, ActionResumeConversation());
}

 

Generally using the action queue is unreliable if you want to do things in a timed sequence, in my experience. It's handy though when you want to do a series of things one after the other and don't care about the timing. :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...