Author Topic: "lock primary weapons" SEXP and Autopilot code  (Read 2305 times)

0 Members and 1 Guest are viewing this topic.

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
"lock primary weapons" SEXP and Autopilot code
I have a question :

I was trying to lock the players weapons so he can't shoot while inside the hangar. Not that it would really border me, but the problem is the other AI-fighters start panic like evasion maneuvers inside the hangar bay when I fire and then they start bumping into evey wall (kinda funny to watch, but still useless for the game :) )

So I locked player weapons, and everything is fine. But the autopilot code does the same, and once I come back into real time and regain control, the weapons are online again (ignoring my first "lock weapons SEXP").

Now, not even that would be bad, I could lock them at every navpoint, but I can't ! Obviously I'm only allowed to use this SEXP once in a mission.

Is this a "feature", or more a problem which results from the combination of the SEXP and the autopilot-code ?
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: "lock primary weapons" SEXP and Autopilot code
I'll take a look. The weapon lock thing was added by me and it should simply be a case of it flipping a flag on or off.

I can't see anything wrong with either the sexp or the autopilot code. You definitely can lock and unlock weapons more than once in a mission. I just double checked that.

Build me a test mission (preferably with FS2 ships) that turns off the weapons, autopilots and then tries to turn them off again and I'll test it. I'd do it myself but I'm not familiar with the autopilot SEXPs and I don't really have the time to learn them today.
« Last Edit: November 16, 2006, 11:27:08 am by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: "lock primary weapons" SEXP and Autopilot code
Hm, don't you have our beta at hand anymore ? Then I would just have to send you the upgraded Mission 01. I can't find my FS-Disks, so it's a little difficult for me to build something else (not impossible though, if everything brakes we can  edit it with notepad)
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: "lock primary weapons" SEXP and Autopilot code
Making a test mission in a case like this is generally worth the 5 minutes worth of work it would be. If the test mission works you know its something wrong with the mission not the code.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: "lock primary weapons" SEXP and Autopilot code
True. I'll make one and reply again, but I won't be able to do it  before Saturday I'm afraid.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Re: "lock primary weapons" SEXP and Autopilot code
i think i know what's going on

he's locking they're weapons
they enter autopilot
they leave autopilot


entering autopilot locks weapons, leaving it unlocks them - it assumes they're unlocked prior to entering, when it needs to restore they're state to the previous level.. file it as a bug and i'll fix it
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: "lock primary weapons" SEXP and Autopilot code
Yes, but once I exited autopilot, I can't lock weapons again using the SEXP, this seems to work only once.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: "lock primary weapons" SEXP and Autopilot code
Exactly. I know that autopilot unlocks the weapons. but you should still be able to lock them again. I can't see any reason why you shouldn't be able to do that.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: "lock primary weapons" SEXP and Autopilot code
Maybe I just made an idiotic error and can't see the forest because of all the trees :)

I'll build that mission on the weekend, then we will see what happens.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: "lock primary weapons" SEXP and Autopilot code
It could be the game is trying to lock at the same time it's deactivating autopilot. Try waiting an extra second before locking, or something similar.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: "lock primary weapons" SEXP and Autopilot code
K, I made a new mission and to my bad, it's working :(  Maybe Ralwood is right and I didn't timed it correctly. At least I hope so, if not I will bang my head against the wall. I like this mission so much, and there is so much work involved, I hope I get this one fixed (if not, I can still end the mission because you fired your weapons unallowed in a training mission, but that should be just the last consequence.
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline Starman01

  • 213
  • Mechwarrior
    • Wing Commander Saga
Re: "lock primary weapons" SEXP and Autopilot code
It could be the game is trying to lock at the same time it's deactivating autopilot. Try waiting an extra second before locking, or something similar.

Cudos, that was the problem. I didn't thought about that. Thanks :)
MECHCOMMANDER OMNITECH

9 out of 10 voices in my head always tell me that I'm not insane. The 10th is only humming the melody of TETRIS.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: "lock primary weapons" SEXP and Autopilot code
No problem.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.