Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: karajorma on February 27, 2005, 05:11:43 pm

Title: Key-Reset = A Big Bag of ****e
Post by: karajorma on February 27, 2005, 05:11:43 pm
Okay I just spent the whole day FREDding (It's been far too long since I last  could say that!) and basically getting more and more pissed off with one particular SEXP.

key-reset.

I hate it. Basically I spent nearly an hour troubleshooting my mission, pruning away SEXPs and events in an attempt to figure out what the f**k was wrong with my mission before I remembered that key-reset has a habit of playing at silly buggers. To make it interesting I present the remainder of this rant in the form of a test.

Test Number 1. Here's some code.
Now what would you expect to happen here when you press 1?

(http://homepage.ntlworld.com/karajorma/freespace/FAQ-Images/Fred-Tips/Key-Reset-01.jpg)

Spoiler:
If you said the message appears once and only once after however many seconds you've set as the chain delay regardless of however many times you press 1 before or afterwards then you're correct. Don't believe me? Give it a try. Mission (http://homepage.ntlworld.com/karajorma/freespace/Downloads/Key-Reset-01.fs2).


Test Number 2. This event has a repeat count. What do you think happens when you press 1 here?

(http://homepage.ntlworld.com/karajorma/freespace/FAQ-Images/Fred-Tips/Key-Reset-03.jpg)

Spoiler:
If you guessed press 1 a single time and the event repeats until it hits the repeat count then you're right again. Mission (http://homepage.ntlworld.com/karajorma/freespace/Downloads/Key-Reset-03.fs2).  


Test Number 3. Now lets try this with the SCP involved. What happens now?

(http://homepage.ntlworld.com/karajorma/freespace/FAQ-Images/Fred-Tips/Key-Reset-04.jpg)

Spoiler:
This time you're not correct unless you've said that the message repeats several times (I saw it 9 times. TopAce reported seeing it 5) and then stops. Mission (http://homepage.ntlworld.com/karajorma/freespace/Downloads/Key-Reset-04.fs2).


Test 4. Let's try Chaining it. What now?
 (http://homepage.ntlworld.com/karajorma/freespace/FAQ-Images/Fred-Tips/Key-Reset-05.jpg)

Spoiler:
You get a endless stream of test message 1. Test Message 2 never appears. Mission (http://homepage.ntlworld.com/karajorma/freespace/Downloads/Key-Reset-05.fs2)



Anyway this bug is the main reason I got less FREDding done than I had planned and is also why I didn't do the FA testing I had planned for later on in the day. :hopping: :hopping: :hopping:  [/Rant]

Can we please get this behaviour fixed? I've even included my test missions so that whichever programmer (Let's face it. It's going to be Goober isn't it? :D ) does this can simply use mine rather than having to make his own.
Title: Key-Reset = A Big Bag of ****e
Post by: mrduckman on February 27, 2005, 05:17:17 pm
Wait a sec. Isn't [1-4] used for multi? Would this be the issue?
Title: Key-Reset = A Big Bag of ****e
Post by: karajorma on February 27, 2005, 05:18:58 pm
Don't think so. This was in Single Player.

BTW : I should mention that I don't blame the SCP for this one. Key Reset has been causing this problem since retail.
Title: Key-Reset = A Big Bag of ****e
Post by: Fractux on February 27, 2005, 05:27:05 pm
After all that trouble, you should kick your feet up and have a cold beer. :nod:

When I was testing the standalone server today I wasn't able to connect from my client running on the same machine, until I realized after about an hour that I had forgotten to forward port 7117 in iptables on the NAT... :rolleyes:

Cheers!
Title: Key-Reset = A Big Bag of ****e
Post by: mrduckman on February 27, 2005, 05:21:59 pm
Well, I was thinking that those multi functions were just blocked in single. That would be why it doesn't work.

By the way, I wouldn't take any blames yet as I haven't coded a thing since the day I joined here :D
Title: Key-Reset = A Big Bag of ****e
Post by: mrduckman on February 27, 2005, 05:23:58 pm
(Nelson's voice) hah hah!

Quote
Originally posted by Fractux
After all that trouble, you should kick your feet up and have a cold beer. :nod:

When I was testing the standalone server today I wasn't able to connect from my client running on the same machine, until I realized after about an hour that I had forgotten to forward port 7117 in iptables on the NAT... :rolleyes:

Cheers!
Title: Key-Reset = A Big Bag of ****e
Post by: mrduckman on February 27, 2005, 05:24:37 pm
hmm.. seems this forum has a problem with clocks...
Title: Key-Reset = A Big Bag of ****e
Post by: WMCoolmon on February 27, 2005, 05:28:05 pm
Quote
Originally posted by mrduckman
Wait a sec. Isn't [1-4] used for multi? Would this be the issue?


They are used in multiplayer, for sending messages to different people (all, team, target, hostiles or something like that)
Title: Key-Reset = A Big Bag of ****e
Post by: karajorma on February 27, 2005, 05:29:35 pm
Okay. This is odd. I tried remapping to the T Key. Every-Time seems to work now but repeating When is still borked.

(http://homepage.ntlworld.com/karajorma/freespace/FAQ-Images/Fred-Tips/Key-Reset-03.jpg)

I took this event and changed the 1's into T's. Guess what happened?

Spoiler:
Press T. The message appears. Press T again the message keeps appearing forever.


I choose the 1-4 keys because Deralict used them and if you do an KeyPress-Chain-KeyReset-Chain-KeyPress style thing with it then it works.

The problem is that for the mission I'm making I need 4 keys that prefereably aren't mapped elsewhere to do this with. 1-4 seemed perfect cause single player doesn't use them and Key-Pressed will recognise and accept them.
Title: Key-Reset = A Big Bag of ****e
Post by: Goober5000 on February 27, 2005, 11:13:25 pm
:wtf:

So there's different behavior in retail and SCP?

This is bad news.  It probably has something to do with my hacks into the "when" code to get every-time and when-argument working. :sigh:
Title: Key-Reset = A Big Bag of ****e
Post by: karajorma on February 28, 2005, 03:38:37 am
I don't think there is any difference between SCP and Retail. I saw this kind of behaviour in retail a long time ago (and I tried a couple of similar missions in Tom's Old Build and I got exactly the same kind of nonsense.)

Basically in Retail there is no way to use key-reset with a repeating event as far as I could see. With SCP it appears it can be used with certain keys but not with others.
Title: Key-Reset = A Big Bag of ****e
Post by: TopAce on March 01, 2005, 03:21:17 pm
I also spent several hours trying to make this work. I mainly tried with when with repeat counts, but no positive result. I also tried some variable involvement, but I still had to use they key-rest, so... you can guess.