Author Topic: Associating Variables With A Ship  (Read 7176 times)

0 Members and 1 Guest are viewing this topic.

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Associating Variables With A Ship
Wouldn't surprise me if it was. The thing is that my mission is pretty heavy in variables and if I have to add them all in notepad then I might as well just write the entire mission there (and I'm certainly not that insane!). :)

Going into notepad for an edit or two is one thing. Trying to do it for 10 different events is a whole other thing.

I'll give it a try though.
« Last Edit: March 15, 2005, 01:19:56 pm by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Associating Variables With A Ship
editing a mission in Notepad is fun, especially when you want to fine-tune the coordinates :D
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline Roanoke

  • 210
Associating Variables With A Ship
I can hardly imagine making a mission with so many events it would be hitting the FRED limits. It'd be fascinating to get a look at one such missson.

 

Offline Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Associating Variables With A Ship
try Project Road Block. :p
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Associating Variables With A Ship
Try CLASSIFIED in Silent Treat: Reborn. ;)

 

Offline Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Associating Variables With A Ship
:lol:

we want ST:R before we rebel. :D
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Associating Variables With A Ship
Quote
Originally posted by Goober5000
That's probably just FRED doing its error-checking.  Fire up Notepad and see what happens. ;)


Okay. Finally got around to checking and it's not just FRED. FS2 crashes out. I suppose I shouldn't be surprised really. My mission only had three events

When
-Key-Pressed
-T
-Add-Goal
--Beta
--Ai-Warpout

When
-Key-Pressed
-V
-Modify Variable
--Ship(Null)
--Beta 1

When
-Has-Departed
--Ship(Null)
--0
-Send-Message
--Beta1 has gone

It's pretty obvious that FS2 would hate that cause as soon as the mission is loaded the code is going to try to check if Null has departed and then fall over when it can't figure out what the f**k Null is. (In fact the mission doesn't even load. It crashes out long before that with this message).

Code: [Select]

Error: Invalid ship/wing name.

In sexpression: ( when
      ( has-departed-delay 0 1[] )
   ( send-message
      "#Command"
      "High"
      "Beta 1 Gone"
   )
)
(Error appears to be: 1)
File:U:\src\cvs\fs2_open.testing\code\Mission\MissionParse.cpp
Line: 4517



I then tried this instead

When
-And-In-Sequence
--Event-True-Delay
---Was V Pressed
--Has-Departed
---Ship(Null)
---0
-Send-Message
--Beta1 has gone

In the hope that it would act like a shortcut  Logical and in Java (i.e ignore the rest of the expression until the first half is true) but it didn't work either.

To be honest I don't think allowing for string variables to be Null or any other value the SEXP isn't expecting is going to work without a hell of a lot of work for you Goober. You're welcome to prove me wrong of course. :D

That means that when I redesign the mission I'm going to have to use those new string variable equivalence testers. Is the code for them in CVS?
« Last Edit: March 16, 2005, 07:27:02 pm by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Cobra

  • 212
  • Snake on a Cain
    • Skype
    • Steam
    • Twitter
Associating Variables With A Ship
this is why i hate variables.
To consider the Earth as the only populated world in infinite space is as absurd as to assert that in an entire field of millet, only one grain will grow. - Metrodorus of Chios
I wept. Mysterious forces beyond my ken had reached into my beautiful mission and energized its pilots with inhuman bomb-firing abilities. I could only imagine the GTVA warriors giving a mighty KIAAIIIIIII shout as they worked their triggers, their biceps bulging with sinew after years of Ivan Drago-esque steroid therapy and weight training. - General Battuta

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Associating Variables With A Ship
Quote
Originally posted by karajorma
To be honest I don't think allowing for string variables to be Null or any other value the SEXP isn't expecting is going to work without a hell of a lot of work for you Goober. You're welcome to prove me wrong of course. :D
Well, you can delay evaluation of sexps via chaining.  Clever sexping might work.
Quote
That means that when I redesign the mission I'm going to have to use those new string variable equivalence testers. Is the code for them in CVS?
Yep, it's in CVS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Associating Variables With A Ship
Quote
Originally posted by Cobra
this is why i hate variables.


I wouldn't take the problems I'm having here as a reason to avoid variables. They're an incredibly powerful tool. I'm running into problems cause I'm trying something right on the bleeding edge of their use. I doubt more than a handful of FREDders have ever used string variables let alone tried to assign them a null value like I'm doing. I'd certainly never given them more than a cursory glance before I tried using them in this mission.

Quote
Originally posted by Goober5000
Well, you can delay evaluation of sexps via chaining.  Clever sexping might work.


I don't think chaining will help. The crash is occuring on mission load not once the mission is running. I'd be surprised if the game checks the syntax of all the events on mission load but stops if it finds a chain.

EDIT : I realised that it would take me let time to check than it did to write that :) Yep. Chaining doesn't help null values can't be assigned to a SEXP. The mission must be able to make sense of the value during mission load. I'll test to see if you can assign a null value while the mission is running in a bit. My bet is that with chaining you can but an unchained mission will cause a spectacular CTD :)

I can see a way around the problem now that I can make equivalence tests though. I'll just assign the initial value of the SEXP to be an invisible far off ship called dummy and check if the variable = dummy before I do anything.

Quote
Originally posted by Goober5000
Yep, it's in CVS.


Thanks a lot for this once again. I'm sure only myself, Sesquipedalian and a small handful of other FREDders will care but I'm sure we'll find this very useful :D
« Last Edit: March 17, 2005, 02:02:23 am by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

  

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
Associating Variables With A Ship
Indeed. :)
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting