Author Topic: Mission works perfectly but I still get an error  (Read 1723 times)

0 Members and 1 Guest are viewing this topic.

Offline Arpit

  • 27
Mission works perfectly but I still get an error
Ok so don't shoot me for this, but I was FREDding a mission to get acquainted with string variables. It works perfectly in gameplay but both the FRED and FS2 engine spit out this error:

Invalid ship name.

In sexpression: ( when
   ( not
      ( destroyed-or-departed-delay
         0
         "Cargo 1"
      )
   )
   ( ship-create
      1[]
      "GTSG Alastor"
      ( get-object-x
         "Cargo 1"
         "<none>"
         0
         0
         -40
      )
      ( get-object-y
         "Cargo 1"
         "<none>"
         0
         0
         -40
      )
      ( get-object-z
         "Cargo 1"
         "<none>"
         0
         0
         -40
[...]
(Error appears to be: turret01a)
KERNELBASE.dll! WaitForSingleObjectEx + 152 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_7_0_RC2.exe! <no symbol>
fs2_open_3_7_0_RC2.exe! <no symbol>

I have attached the mission below. You just require mediavps for it.

As for what's in the mission, here's a description:

I wanted to place a cluster of sentries (approx. more than 50.  :p) around an Arcadia. This was tedious even with using the arguments list so I decided to use string variables and appropriate SEXPs.
Note: I used string variables to name those ships and configure them. (for creating them I used ship-create SEXP).

The error says that turret01a is an invalid turret name. (Actually I used change-turret-weapon SEXP to change the weapons of Alastor to Prometheus S). HOWEVER IT WORKS PERFECTLY IN-GAME.

So I wanted to ask if that event does not give any error when using the arguments way then why does it give using the string way.
Is using string variables a mistake?

Hmm... words don't explain this properly. So playing the mission to troubleshoot it is more helpful. There are not many events just one event in the mission which has to be troubleshooted.
Also sorry for being 'lazy' in FRED.  :p

[attachment deleted by ninja]

 

Offline Axem

  • 211
Re: Mission works perfectly but I still get an error
The thing about string variables and using them to refer to specific ships is that FRED's error checking looks at the default value for the variable.

So in your event, as FRED checks for errors, it happens upon your change-turret-weapon sexp. "Ship ' ' with turret01a? That's not there, I better warn the user!"

You can get around this by having a dummy sentry gun that has the initial variable value as its name. The dummy doesn't even need to be present in the mission, you could just set its arrival cue to false and FRED is none the wiser about it.

Also kudos for getting involved in the fun world of dynamic ship creation!  :yes:

 
Re: Mission works perfectly but I still get an error
Also kudos for getting involved in the fun world of dynamic ship creation!  :yes:
Second that. Kinda headache inducing at times though.

  

Offline Arpit

  • 27
Re: Mission works perfectly but I still get an error
The thing about string variables and using them to refer to specific ships is that FRED's error checking looks at the default value for the variable.

So in your event, as FRED checks for errors, it happens upon your change-turret-weapon sexp. "Ship ' ' with turret01a? That's not there, I better warn the user!"

You can get around this by having a dummy sentry gun that has the initial variable value as its name. The dummy doesn't even need to be present in the mission, you could just set its arrival cue to false and FRED is none the wiser about it.

Also kudos for getting involved in the fun world of dynamic ship creation!  :yes:

Thanks! It worked. So it was FRED's error checking.....
FRED is so evil.  :D

Also kudos for getting involved in the fun world of dynamic ship creation!  :yes:
Second that. Kinda headache inducing at times though.
It's not really hard. For example I had used it in the previous screencap contest to create the screenshot with buildings, gas refineries, a landscape and Axem's Skybox model from JAD 2.2 OVA.  :p