Author Topic: Blatantly stupid FRED2 question...  (Read 2365 times)

0 Members and 1 Guest are viewing this topic.

Offline r0nin

  • 24
    • http://mywebpages.comcast.net/r0nin/
Blatantly stupid FRED2 question...
As embarrasing as it is to ask, I have a ridiculously simple question about SEXPs in FRED2.  Once a sexp has been activated (ie. has returned true) is there anyway to reset the sexp?

I have a function that needs to be called every time a player presses a certain key.  I really don't want to have to code a new key control, and the "key-pressed" sexp would be perfect (as I already have made a cusom sexp to call the function), except for one thing.  I press the key, the function is called, and the sexp becomes true/inactive/erased and cannot be used again.

Any solutions?
"Have code, will travail..."
Member of the Robotech FS2 Mod.
http://www.robotechlan.com/freespace2/

 

Offline vadar_1

  • Mr. Crispy
  • 29
  • .
    • http://dynamic4.gamespy.com/~freespace/hosted/fullcircle/
Blatantly stupid FRED2 question...
key-pressed is usually the only reason to use an event more then once... and looping would be the only way, but key-pressed loops dont work too well.... sorry
"Shockingly, checking Draw Lines Between Marked Icons draws lines between the marked icons. " -Volition quality help files

Projects;
The Full Circle Project (site down - server side problem)
Paradox (site down - server side problem)

 
Blatantly stupid FRED2 question...
What is with all the self-deprecation? :confused:

As for your question, I have no idea, unfortunately. :(
"Vasudans and Shivans don't wear clothes coz they told the serpant to go expletive himself. :D" - an0n

:(:(:(

NotDefault

 

Offline Stunaep

  • Thread Necrotech.... we bring the dead to life!
  • 210
Blatantly stupid FRED2 question...
the only way I could think of doing that is by chained events. That would take a hell of a lot of events though, so that may not be a good idea.
"Post-counts are like digital penises. That's why I don't like Shrike playing with mine." - an0n
Bah. You're an admin, you've had practice at this spanking business. - Odyssey

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Blatantly stupid FRED2 question...
I had a play around in FRED and I couldn`t get it to work either. What are you trying to do anyway? There might be a better way than key-pressed loops.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

  

Offline r0nin

  • 24
    • http://mywebpages.comcast.net/r0nin/
Blatantly stupid FRED2 question...
Quote
Originally posted by karajorma
I had a play around in FRED and I couldn`t get it to work either. What are you trying to do anyway? There might be a better way than key-pressed loops.


Well, I was trying to help out the guys at the Robotech mod.  They have one mode of the transformable ship drawn in the pof for the turret01 subsystem as it normally is, and one mode for turret01 destroyed.  I haven't had any problem coding the change between the two modes (triggered by a keypress and sexps), but getting it to operate based on keypresses would have been easier than coding a new control.  Looks like I'll have to try that...
"Have code, will travail..."
Member of the Robotech FS2 Mod.
http://www.robotechlan.com/freespace2/

 

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Blatantly stupid FRED2 question...
make a chained event that has a chain delay of 5 or so, and change do-nothing to key-reset. then you can change TRUE in the chained part to not- then something so they can't use it after something has happened...
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline r0nin

  • 24
    • http://mywebpages.comcast.net/r0nin/
Blatantly stupid FRED2 question...
Quote
Originally posted by Hippo
make a chained event that has a chain delay of 5 or so, and change do-nothing to key-reset. then you can change TRUE in the chained part to not- then something so they can't use it after something has happened...


Maybe I misunderstand what you are telling me to do, but this didn't work for me.

I chain a key-reset event to the original transform event, and after transforming once, I can't do it again.  Exactly what should your key-reset event be chained to?
"Have code, will travail..."
Member of the Robotech FS2 Mod.
http://www.robotechlan.com/freespace2/

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Blatantly stupid FRED2 question...
Hippo I`m having real trouble figuring out what you`re on about but if you`re suggesting something like this

Event 1 (repeat 900 times, 2 second interval)
-When
--Key-Pressed
----1
--Do-Something


Event 2 (chained to 1, repeat 900 times, 1 second interval)
-When
--True
--Reset-Key
---1

I tried that already. What happens is that the game endlessly repeats the Do-Something. I did get it once to stop endless repeating but the second you hit 1 again it starts again. What's really strange is that I`ve never been able to replicate this again!
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Blatantly stupid FRED2 question...
oh well, it works for me...
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Blatantly stupid FRED2 question...
Obviously this is like the whole

Has-Arrived
-Ship
--0

thing. Maybe it works for some people but not for others. If that's the case you can`t use it in a campaign.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Stunaep

  • Thread Necrotech.... we bring the dead to life!
  • 210
Blatantly stupid FRED2 question...
Perhaps removing the 900 repeat count??? on event 1.
"Post-counts are like digital penises. That's why I don't like Shrike playing with mine." - an0n
Bah. You're an admin, you've had practice at this spanking business. - Odyssey

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Blatantly stupid FRED2 question...
If I remove the repeat count on event 1 it would work. ONCE! :)

Since the desired result is for the player to be able to transform at will that wouldn`t be much use at all.

Hippo. If you`ve got it to work could you make it available for download? I'd like to see if you`ve done something different from me.

Edit: Freespace is very weird when it comes to looped events. Here's an example that I came across once.


Make a mission with two events like this

Event 1 (repeat 100 times, delay 1 second)
When
-True
-Modify Variable
--VariableName
--Rand
---1
---3

Event 2 (Repeat 100 times, delay 1 second)
When
- =
--VariableName
--1
-Send Message

You would think that would result in a message being sent an average of every 3 seconds at random intervals. In fact 2/3 of the time you run the mission nothing happens. The other 1/3 of restarts results in the message being sent 100 times. The random function is only calculated once. In each further loop the number just stays the same as it was in the last loop.

 Probably something similar is hapening here.
« Last Edit: June 04, 2002, 10:37:13 am by 340 »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Hippo

  • Darth water-horse
  • 211
  • Grazing.
    • All Hands to War
Blatantly stupid FRED2 question...
I'll find it and e-mail it, who would like it?
VBB Survivor -- 387 Posts -- July 3 2001 - April 12 2002
VWBB Survivor -- 100 Posts -- July 10 2002 - July 10 2004

AHTW

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Blatantly stupid FRED2 question...
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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