larryrathbun Posted October 6, 2013 Share Posted October 6, 2013 Hello all, I am working on a basic mod and am making a basic activator script. I have tried many times, looked at tutorials and every time nothing works. It never crashes, it just doesn't do anything. I decided I must be missing something, so inserted some debug message boxes to show me where the script broke. Still nothing, so I deactivate everything except the message boxes, figuring I will rebuild the script one layer at a time until I figure it out. (This is how I learn, very hands on.) Simple right? I go pull the lever and the message boxes display out of order! 1, 2, 4, 5, 3. So I DELETE everything except the message boxes. Same result. Any ideas why?Scriptname AAMuseumSimpleEnableTest extends ObjectReference {Simple Activator Script for Basic Testing. Enables and Disables Objects.} Actor Property PlayerREF Auto ObjectReference Property TestLinkedRef Auto Event OnActivate(ObjectReference akActionRef) Debug.MessageBox("1. Begin the test player next.") Debug.MessageBox("2. You are the player.") Debug.MessageBox("3. Test the wall here.") Debug.MessageBox("4. Outside the disable test if.") Debug.MessageBox("5. About to end.") EndEventThanks in advance... Link to comment Share on other sites More sharing options...
Sjogga Posted October 7, 2013 Share Posted October 7, 2013 You can fix thid by adding a short wait() between all the message boxes, though I recommend you switch to using trace messages instead. Link to comment Share on other sites More sharing options...
larryrathbun Posted October 7, 2013 Author Share Posted October 7, 2013 Sjogga, Thanks for the reply. I wasn't in much of a scripty mood last night so I didn't work on it. I suspected it might not be out of order, but was just messing up on the multiple message boxes. I removed # 3 and then #4 started doing it. I used the message boxes originally because my script was just dropping out and I was trying to determine where, but debug.trace is probably a better way... Thanks again. Link to comment Share on other sites More sharing options...
myztikrice Posted October 8, 2013 Share Posted October 8, 2013 They're coming too fast. By the time you've closed the second debug box the fourth one shows up. They still run in sequence they just don't appear in sequence. Use the waits or his suggestion. Link to comment Share on other sites More sharing options...
larryrathbun Posted October 8, 2013 Author Share Posted October 8, 2013 That was a possibility, thanks for the confirmation. I sat down with it and got it working. Strangely my problem was coming with the line:Actor Property PlayerREF Auto Event OnActivate(ObjectReference akActionRef) if akActionRef == PlayerREF ;this line here was simply not working, never registered trueI finally gave up and triedEvent OnActivate(ObjectReference akActionRef) If akActionRef == Game.GetPlayer() ;using this method worked fineThat was the issue. Was making my head hurt because as far as I know it should work either way and it is amazingly simple. Link to comment Share on other sites More sharing options...
Sjogga Posted October 8, 2013 Share Posted October 8, 2013 Did you forget to fill in the PlayerRef property? Link to comment Share on other sites More sharing options...
larryrathbun Posted October 9, 2013 Author Share Posted October 9, 2013 I did not fill in the property. I got the impression from the tutorials I read that PlayerRef was a hardcoded, always available reference. That it was always the player and couldn't be assigned to anything else... That would explain it. I was right, it was amazingly simple... Link to comment Share on other sites More sharing options...
Recommended Posts