Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - WD-40

Pages: 1 [2] 3
16
SCI Syntax Help / Re: Automatic Ego Motion Problem (SCI0)
« on: September 14, 2018, 03:10:46 PM »
WOW this is really helpful. This will speed things up about 4X+. The only down side is now I should go back and rewrite everything I have done so far.  :'(

The decompiled code doesn't really match the syntax I've been using, but its not hard to translate. Example != instead of <>, missing brackets, and different ways of passing parameters, etc.

Thanks for the help.

17
SCI Syntax Help / Re: Automatic Ego Motion Problem (SCI0)
« on: September 14, 2018, 11:45:00 AM »
You know there's a proper decompiler now that produces actual script code, right?

I didn't. Where do i get it? and can I put the decompiled scripts right into SCICompanion and run the game without any problems?

18
SCI Syntax Help / Re: Automatic Ego Motion Problem (SCI0)
« on: September 14, 2018, 12:43:29 AM »
I know it kind of renders your whole exercise redundant and unnecessary (though I understand the allure and importance of it), but you could just decompile the SQ3 scripts and see how Sierra did it.

I have been looking at the assembly scripts for clues and I also use the built in debug system for help too. I got my problem figured out, it's not super pretty but it works. Roger is driving his garbage grabber beautifully, even if the code is ugly :)

(class driveGrabber of Script

   (method (handleEvent pEvent)
      (super:handleEvent(pEvent))
      // handle Said's, etc...
         
      (switch((send pEvent:type))
         (case evJOYSTICK
            MapKeyToDir(pEvent)   
               
            (if (== (send pEvent:message) JOY_RIGHT)  // right key pressed
               
               (if (==(send gEgo: loop) 0) // ego pointing forward
                  (if (send gEgo: isStopped()) // grabber machine is stopped?
                     (send gEgo: setStep(3 1)) // start the grabber machine
                     (send gTheMusic:prevSignal(0) stop() number(52) loop(-1) play()) // grabber machine humming
                  )
                  (else // grabber machine is moving
                     (send gEgo: setStep(0 0) setMotion(NULL)) // stop the grabber machine
                     (send gTheMusic: prevSignal(0) stop()) // turn off the humming sound
                  )
               )
               (else // ego pointing backwards
                  (send gEgo: setLoop(0) setStep(3 1)) // look forward
                  (send gTheMusic:prevSignal(0) stop() number(52) loop(-1) play()) // start the grabber machine humming sound
               )   
             )
            
            (if (== (send pEvent:message) JOY_LEFT)  // left key pressed
               
               (if (==(send gEgo: loop) 1) // ego looking backwards
                  (if (send gEgo: isStopped()) // grabber machine is stopped?
                     (send gEgo: setStep(3 1)) // start the grabber machine
                     (send gTheMusic:prevSignal(0) stop() number(53) loop(-1) play()) // backing up warning sound
                  )
                  (else // ego is moving
                     (send gEgo: setStep(0 0) setMotion(NULL)) // stop the grabber machine
                     (send gTheMusic: prevSignal(0) stop()) // turn off the humming sound
                  )
               )
               (else // ego looking forwards
                  (send gEgo: setLoop(1) setStep(3 1)) // look backwards
                  (send gTheMusic:prevSignal(0) stop() number(53) loop(-1) play()) // start the backing up warning sound
               )
             )         
         )
      )
   )   
)

 

19
SCI Syntax Help / Re: Automatic Ego Motion Problem (SCI0)
« on: September 13, 2018, 06:56:37 PM »
I guess this hard to explain. I'm not trying to do a static script where the ego moves to an exact location and then control is given back to the user. I want the user to have full control at all times even when the moveTo is in effect.  After playing with the setMotion method I realize now its doing exactly what it should be doing, just not what I want it to be doing :)

Thank you anyways for your help.






20
SCI Syntax Help / Re: Automatic Ego Motion Problem (SCI0)
« on: September 13, 2018, 05:16:19 PM »
I definitely want the user to take control at anytime. Take the following scene in Space Quest 3 for example:



The ego upon entering this room automatically walks all the way across the tunnel without stopping. The user can take control at anytime by pressing the left or right key.

My problem is that when I press the key to stop the ego, the game thinks I'm pressing a key to make the ego start walking. The effect is that the first key press appears to be ignored because the ego just keeps on walking.

If anyone wants to try this bug out, put the following line of code in the init method of your room: "(send gEgo: setMotion(MoveTo 319 150))". Notice when you try to stop the ego it will ignore your first attempt. Adjust the coordinates as necessary.

21
SCI Syntax Help / Automatic Ego Motion Problem (SCI0)
« on: September 13, 2018, 04:25:38 PM »
I'm working on a few rooms that require the ego to automatically start walking/driving upon entering a new room, WITHOUT the user pressing any keys. This is not hard to do using SetMotion within the room init code. My problem is that the game doesn't seem to truly understand the ego is moving. Example:

Ego enters a new room and automatically starts walking to the right. Pressing the Right key should stop the ego, however the game doesnt recognize the ego is moving and processes the key press as if the user wants the ego to start walking. After the first key press the ego responds normally, stopping and starting as it should.

The only solution I can think of is to scrap the SetMotion and somehow manually generate a keypress or mouse event for the desired direction of motion. Surely there is a better way?


22
SCI Syntax Help / Re: SCI0 sound problem
« on: September 12, 2018, 06:32:45 PM »
Different patches, possibly. They kinda define the game's sound, what each instrument is supposed to sound like.

That did it! Importing the SQ3 patch files into my project fixed the sound issues. Thanks a bunch.

23
SCI Syntax Help / SCI0 sound problem
« on: September 12, 2018, 12:33:44 PM »
I'm working on a project to re-code Space Quest III. I have imported all the resources from the game into my project and I'm writing scripts to recreate the games functionality. Everything has been going great except for sound/music. I have noticed that when I play sounds in my project they sound different than in the original game. The sounds in my project are either "harsh" sounding or don't play at all. For example, the grabber machine that goes around and around on the rail system has a pleasant low humming sound in the original game. When I play the same sound it's like an annoying car horn going off.

The sound driver used in my project is ADL.DRV as is the driver in the original game as indicated inside RESORUCE.CFG. At first I thought I had the drivers mixed up, but they are the same. I even tried copying the original 1989 driver from the original game into my project, but it had no affect.

Is there maybe properties to "tweak" sound effects with the scripts?

This is how I play the sound effects in the game:

(send gTheSoundFX:prevSignal(0) stop() number(53) loop(1) play()) // grabber backing up warning sound

I appreciate any help the community can provide.

24
SCI Syntax Help / Re: SCI0 DPath Heap Trouble
« on: July 25, 2015, 02:14:37 AM »
What happens if you add DPATH_SCRIPT to the DisposeLoad call in startRoom in main.sc?

Some more info here:
http://sierrahelp.com/SCI/Tutorials/Tutorial3/Chapter07.html

That fixed it, thanks!

Nice tutorial too

25
SCI Syntax Help / SCI0 DPath Heap Trouble
« on: July 25, 2015, 12:44:20 AM »
I'm using DPath to move my actors around the room like so:

(prisoner1: setMotion(DPath 79 139 77 67 0 67))

Everything works great until I move the ego to another room. In the new room when I check the heap size it's almost completely used up. Something about DPath is preventing objects from disposing and is eating all my heap. I'm positive DPath is the culprit because when I comment out all the DPath motions then my heap size is fresh in the next room. Also, using a series of MoveTo's doesn't cause this problem either, but it's pretty ugly in comparison.

Anyone ever had this problem? kinda frustrating because this is like my last problem to solve before I can really get developing my game :)

Thanks

26
SCI Syntax Help / Re: SCI0 newRoom transition effects bugged?
« on: July 24, 2015, 06:34:15 PM »
I didn't say "change it in init" though. I quite clearly showed it set in the room's properties block. ???

Right again (I missed that). I like your way much better now :)

I guess my way of doing it could work better for dynamic transitions. Like say if you wanted a checkerboard effect the first time a room loaded, but something more standard every time after that.  not super useful though.

27
SCI Syntax Help / Re: SCI0 newRoom transition effects bugged?
« on: July 24, 2015, 06:07:53 PM »
I checked it twice to make sure. Style property is the way to go.

You're right, I took another whack at the style property and it works, so long as it's done above "(super:init())". I guess I have two methods of doing it now ;D

28
SCI Syntax Help / Re: SCI0 newRoom transition effects bugged?
« on: July 24, 2015, 06:05:09 PM »
I'm using SCICompanion v2.1.0.5. It runs fine, I couldn't get V3 to run at all.

That's odd. What OS are you running? It's possible I've made some changes that prevent it from running on old OS's (XP, etc..), I'm not sure.

Windows XP... I guess it's time to upgrade :P

29
SCI Syntax Help / Re: SCI0 newRoom transition effects bugged?
« on: July 24, 2015, 05:35:00 PM »
Neither template is a Windows program to begin with.

Seriously, for either template, if you want a particular room to have a particular transition, just use the style property.

Changing the style property is the first thing I tried, but it had no effect. I'm guessing it only works for SC1.1 games. 

I'm using SCICompanion v2.1.0.5. It runs fine, I couldn't get V3 to run at all.

30
SCI Syntax Help / Re: SCI0 newRoom transition effects bugged?
« on: July 24, 2015, 05:27:00 PM »
Looking at LSL3 right now, it has random transitions.

Yes, it's supposed to be random unless a second parameter is provided with a transition id. This bug ignores the second parameter and just makes transitions random no matter what. Not really annoying at all unless you want the checkerboard fade to work.

Regarding SCI1.1, I tried downloading/running the Alpha version but Windows says the executable is "not a valid Win32 executable".  :(

Pages: 1 [2] 3

SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.019 seconds with 19 queries.