Author Topic: Need a solution for Key-pressed / key-reset event (Mantis 342 )  (Read 1405 times)

0 Members and 1 Guest are viewing this topic.

Offline Savage

  • 23
    • Startrap The Live Space Adventure
Need a solution for Key-pressed / key-reset event (Mantis 342 )
Hello,

I need the key pressed / rest  operator in an repeating event to switch on / off a generator as often as the player wants. I read about the failure in SEXP with this operator, but as I need it:

Does anybody knew a work around for this problem?

Present behaviour:
If the player switches on the generator the second time it goes on and off all the time, without a change to stop it.

Greetings
Malte

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Need a solution for Key-pressed / key-reset ev
The first thing to do is to stop using a repeating when in your events. Key-Pressed doesn't work well with events using when if any repeatition is required. Switch over to using every-time instead.

Second don't use the 1-4 keys. I know that they seem like the logical choice since nothing uses them in single player but you're asking for trouble if you use them in a repeating event too. I've had some limited success if I instead use one of the keys that actually has a current (but little used) purpose. B works pretty will in a mission with no bombers for instance.

There are some other pitfalls but at the moment mantis is taking an enormously long amount of time to load for me and I can't get to my original bug report to jog my memory. That should hopefully be enough to be getting on with for now.

EDIT  : As soon as I post Mantis suddenly spits out all my bug reports :D. Here's the original thread I made when researching the problem. Unfortunately it looks like all the pictures are gone now.
« Last Edit: December 18, 2005, 02:53:12 pm by karajorma »
Karajorma's Freespace FAQ. It's almost like asking me yourself.

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

 

Offline Savage

  • 23
    • Startrap The Live Space Adventure
Re: Need a solution for Key-pressed / key-reset event (Mantis 342 )
With the every time operator. Everything works perfect now.

Using a Variable (0/1) to proof if the generator is on or off.

Thank you very much indeed!  :)
Malte