Home   Help Search Login Register  

Author Topic: Error Dialogs  (Read 542 times)

0 Members and 1 Guest are viewing this topic.

Unnamed

  • Guest
Error Dialogs
« on: 08 Sep 2003, 18:26:26 »
If you call a bogus script from an Init field in the editor, something like ([] exec "NeverFound").

And preview the mission, you get an error message dialog, a grey box with an OK button.

Anyone know if it's possible to call this yourself from a script?

I looked at the dialog tutorial, but I've had no luck trying to call a user defined dialog from with an addon. Which is what I want to do.

Cheers

Offline Spinor

  • Members
  • *
  • I'm a llama!
    • The chain of command
Re:Error Dialogs
« Reply #1 on: 08 Sep 2003, 19:53:24 »
The error dialog must be defined in the ressources.bin (like all original OFP interface stuff)
file of OFP. Try to dePBO it and make a search for "Error" or something.
Once you have its class name you should be able to call it normally
from a script. The appropriate TEXT control (where the error message is
displayed) might even have a proper ID, so you can display your own
error message. Well, I guess thats what you are after, anyway ;D.

You can define dialogs within an addon, say in a file "dialogs.h", but
this file must be included in a mission's description.ext with
#include<AddonName\dialogs.h>

You can thus not fully encapsulate dialogs within an addon (to my knowledge).

Spinor

Unnamed

  • Guest
Re:Error Dialogs
« Reply #2 on: 09 Sep 2003, 08:46:11 »
Hi,

Thats exactly what I am after ;D ;D I wanted to keep it down to just one pbo file if possible.

I've just taken a look at the resource.bin, I found the class I'm interested in :) but I cant display it  :'(

Looks like you can call the Display calsses without any problem, things like RscDisplayArcadeWaypoint and RscDisplayDebug.

But the Message dialog RscMsgBox is only partialy defined, I guess it's because they change the size at runtime depending on what text has to go in there.

Although it was worth taking a look in resource.bin, just to see what there is.

Cheers

Offline benreeper

  • Members
  • *
  • I'm a llama!
Re:Error Dialogs
« Reply #3 on: 16 Sep 2003, 06:51:41 »
you mean you can call the waypoint graphic within the game and have it show a location?  If you can, how?

Ben :D

Unnamed

  • Guest
Re:Error Dialogs
« Reply #4 on: 16 Sep 2003, 08:05:33 »
Sorry Ben, it's just the dialog they use in the editor when your adding waypoints. Altough I'd take a look anyway, there is all kinds of stuff in there.

I'll solve this thread, I realised as a work around I could just call my error message like a script:

Code: [Select]
[] Exec "Error Creating Variables"
It comes out as "Script Error Creating Variables Not Found", but at least it's a proper error message.