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.


Topics - Cloudee1

Pages: 1 [2] 3 4 ... 11
16
Everything-Else / Windows 10... anybody made the plunge yet
« on: August 03, 2015, 09:42:50 PM »
So a couple of weeks ago, I went ahead and put 8.1 on the laptop. So between the tablet and the laptop, I am getting pretty used to it and overall I really don't have any major complaints about windows 8.1. I put in my reservation to upgrade to 10 but I have heard some minor complaints, most of them seem to focus on the new browser Edge though. Not a really big concern there as I primarily use chrome anyway. Just wondering if anyone else has updated though and what they thought of 10 so far.

17
So here at work, we have about 300 crystal reports that are used on a daily basis and many many more that get used sporadically. The powers that be have decided to upgrade to a new version of our accounting software. The accounting software company has told them that they are steering away from Crystal reports and are instead pushing SSRS (SQL Server Reporting Services). The bosses are now hell bent on getting all of the crystal reports converted over to be run via SSRS by the go live date.

Ughh, I have tried to explain that this conversion on top of the migration shouldn't be this high of a priority, the crystal reports will all still work. The database nor the data give a shit which database reporting tools connect to it. They all connect. There is sure to be some table structure change, but from what I have read, most of the crystal reports will be unaffected.

18
SCI Syntax Help / SCI1.1: Adding to the score and Btest
« on: June 22, 2015, 01:18:10 PM »
In need of a little guidance here. The AddToScore  procedure in the main script takes a value to be passed through Btest before changing the score. What is this doing... and does that mean that each AddToScore call needs to have a unique Btest value to be passed, since it is setting it as part of the change score process?

Code: [Select]
(procedure public (AddToScore param1 param2)
    (if (not Btest(param1))
        = gScore (+ gScore param2)
        (sq5StatusLineCode:doit())
        Bset(param1)
        (rm0Sound:
            priority(15)
            number(1000)
            loop(1)
            flags(1)
            play()
        )
    )
)

19
I added this code into a post somewhere, but it is getting kind of hard to find now so I figured I would stick it in this board. If you are using dosbox and the mouse is not locked inside your game window, it can be kind of a pain sometimes to get your ego close enough to the edge of the screen to trigger the room change. This will add a gutter around the edge, so that really you only have to get close now. How close is entirely up to you.

First in the main script, let's go ahead and add a new global variable. It is this variable which will let you set how far from the edge should trigger the new room.

Code: [Select]
  gEdgeDistance = 10

Now in the ego script. We are going to change the doit method of the ego actor. In this, I use the gEdgeDistance literally for the x dimensions, but that number seems a bit big when talking in the y. So I make it look at half that distance for the y's.

Code: [Select]
    (method (doit)
        (super:doit())
        = edgeHit
            (if (<= x (+ 0 gEdgeDistance))
            4
            )
            (else
                (if (>= x (- 320 gEdgeDistance))
                2
                )
                (else
                    (if (>= y (- 190 (/ gEdgeDistance 2)))
                    3
                    )
                    (else
                        (if (<= y (+ (send gRoom:horizon) (/ gEdgeDistance 2)))
                        1
                        )
                        (else
                        0
                        )
                    )
                )
            )
    )

And there you go, much easier now to travel between rooms.

20
SCI Syntax Help / SCI1.1: Missing something with inventory items
« on: June 21, 2015, 05:05:04 PM »
Ok, so I have started adding an item or two to the game and I seem to be missing something. I can't get the look item message to display. As well, the item icons seem to overlap a bit as well... Here is what I have done so far.

First in the messages, I added a new noun N_TOILETPAPER. Then I went in and added a message for V_LOOK, N_TOILETPAPER. I also added a verb, V_TEEPEE but that is irrelevant for now until I am ready to use the item in some way.

Next in the sq5invitem script, I added in the instance for the item.

Code: [Select]
(instance ToiletPaper of Sq5InvItem
    (properties
        view 901
        loop 1
        cursor 901
        message V_TEEPEE
        signal $0002
        noun N_TOILETPAPER
    )
)

And in the same script, up towards the top in the sq5Inv instance of scrollableinventory, I added my instance name to the add list.

Code: [Select]
            add(Money ToiletPaper) // TODO: addmore inventory items

Next I drew the necessary views, in 901 as defined in the instance of the item, and finally in the title screen script I threw in a send gEgo get statement so that I had the item at game start.

Now for the most part everything seems to be working, The item is there in my inventory, I can click on it with the arrow and the cursor changes to it. However, when I click to look at the item, the look item message is not triggered. As well, if you look at the screen shot, when the item is highlighted, it seems to overlap the money item icon a bit. Any ideas why the look item message isn't triggering... and whats up with the overlap?


21
Everything-Else / See you guys in about a week
« on: June 07, 2015, 03:58:03 PM »
Work has me headed down to our facility in Mexico. Flying out bright and early in the morning and won't be back until Friday at the earliest. Not quite sure what kind of access to anything that I will have between now and then.

The worst part is that I am not bringing my laptop and I sent the surface pro 2's screen back to china so I won't have that to bring with me either. Looks like I am going to have to go cold turkey on any new sci exploration.

22
I am trying to get the click on control colors thing down using the sci1.1 template. I think I have it all figured out but there is one piece that I don't know what it is... and it isn't quite working.

So in the message file, we add a new Noun. In this case N_PLATFORM and save it (in this case noun 3)

Then we go down to the Message details and select our noun, select the verb and enter the message text and hit commit. All other values condition, sequence, talker are left at their default.

Next we go to our room script. It looks like we need to use the cueobj script so that is done.

We need to create an instance of feature, and set a few values
Code: [Select]
(instance platform of Feature
    (properties
        x 140
        y 156
        noun N_PLATFORM
        onMeCheck $0002
    )
)
The x and y values give a point of reference, so if Ego isn't facing the looked at area, then he will turn. The noun is defined as our messages noun and the control color is set to Navy.

Now, all that is left is basically to init the platform instance.
Code: [Select]
(platform:init()setOnMeCheck(1 2)) // KQ6 init's the instances a bit differently, but that syntax causes an oops error. 
//(platform:init()setOnMeCheck(1 $0002))

Now looking at the feature class in the cueobj script, the first parameter is used by the setonmecheck method. It looks like $6789, 2, 1 are the available option. Everything I have seen in SQ5 source so far is showing param1 as 1 so that is what I used. But I don't really understand I guess what param2 does in all of this... and it makes me wonder if whatever it is I am missing is what is keeping this from working like it should

Code: [Select]
// From cueobj.sc
    (method (setOnMeCheck theOnMeCheck theOnMeCheck_2)
        (var temp0)
        (switch (theOnMeCheck)
            (case $6789
                = onMeCheck theOnMeCheck
                = state (& state $fffb)
            )
            (case 2
                = onMeCheck theOnMeCheck_2[0]
                = state (& state $fffb)
            )
            (case 1
                = temp0 (= onMeCheck 0)
                (while (< temp0 (- paramTotal 1))
                    = onMeCheck (| onMeCheck theOnMeCheck_2[temp0])
                    ++temp0
                )
                = state (| state $0004)
            )
        )
    )


23
SCI Community How To's & Tutorials / SCI1.1 Scaling the Ego
« on: June 04, 2015, 11:41:53 AM »
There seem to be two major scripts that are used for scaling: Scaler.sc and ScaleTo.sc.

Scaler appears to be the script that we will want to make use of in order to scale the ego (and presumably other actors as well) depending on where they are along the y axis. So that is the one we are going to focus on for now.

As with most functionality, to make use of it, you will need to use the scaler script in your room. So like always, up at the top where the other uses are defined add in:
Code: [Select]
(use "scaler")

And now assuming that you are going to want the ego to scale, we need to add the setScale to the ego. Presumably from the point of initialising the room, even though really it could be applied at any point. The syntax is really pretty simple. The paramaters that are sent accross represent the Front size, the Back size, the Front Y and the Back Y.

So as long as the ego is between the front and back y it will take on a size between the front and back size, relative to where it is between the y's. In the public instance of your room, where the ego is inited go ahead and change that line to:
Code: [Select]
(send gEgo:init()setScale(Scaler 110 85 190 72)) //  theFrontSize theBackSize theFrontY theBackY

And there you have it, the ego will now scale as you move up and down the screen. You can play around with the values to get the ego to fit the room scale making the scaling more dramatic or subtle as you see fit or changing it up as the ego moves down the screen he gets smaller instead of larger. The code above is not a really huge change, an example of it's result can be seen in this screenshot


24
SCI Community How To's & Tutorials / SCI1.1: The joy of Polygons
« on: June 02, 2015, 10:54:41 PM »
So I have started playing with the template a bit and I have found that out of the box, white control lines do not block the ego. Instead, polygon areas must be generated. Now I admit that I have only just begun playing with this, so this first example is going to be be very rudimentary. I will add more examples as I have played with it some more, but this should at least get you started.

To begin, we need to use the polygon script. So up towards the top of the script where the other use statements are made, add in:
Code: [Select]
(use "Polygon")

Also for my first successful attempts at using it, I gave my polygon definitions some names. So I created some local variables to represent the polygon areas. Just after the uses, I define my local polygon names.
Code: [Select]
(local
    walkwayTopBoundary
    walkwayBottomBoundary
)

So far so good, the only thing left to do is actually define and init the polygon areas. In the init method of the public room instance I actually defined my polygons. The syntax is really pretty simple.
Code: [Select]
= walkwayBottomBoundary
                        (send (Polygon:new()):
                                              type(2)             // not sure exactly how many types there are
                                              init(
                                                0 157      // x y point of polygon
                                                319 157
                                                319 189
                                                0 189
                                              )
                                              yourself()
                       )           
                      (self:addObstacle(walkwayBottomBoundary))

Basicly the above bit creates a large rectangular area the whole width of the screen and from 157 to the bottom of the screen high. The next bit, creates a second rectangular area of the same width from the top of the screen down to 133.
Code: [Select]
                      = walkwayTopBoundary
                        (send (Polygon:new()):
                          type(2)
                          init(0 0 319 0 319 133 0 133)
                          yourself()
                        )
                      (self:addObstacle(walkwayTopBoundary))

With both of those polygons set up and added, it creates a simple allowable walkway from one edge of the screen to the other.

25
 :P

So someone handed off a Surface Pro 2 to me because of a busted screen, an i5 with 8gb ram. After ordering a couple of screens before I got one that would do from China ... and even it lacks the support for the stylus as the connector for it on the back arrived broken, but I don't want to wait for a package to go both ways... and getting Microsoft's fancy little docking station all set up I have the tablet up and running and the docking station wired into the tv in the bedroom and sitting on the bed with a wireless mouse and keyboard.

Windows 8 took about 15 minutes to get used to. I wouldn't say that I have it all mastered quite yet, but I'm certainly not so scared of it anymore  ;). Got office 2013 installed and the adobe creative suite installed and everything seems to be up and running fine on those ends.  Next came sciCompanion followed by the other miscellaneous programs needed, soundbox, anvil studio, dosbox. All of them seem to be up and running fine as well.

Time to backup the site and everything that I absolutely need will have been moved over.

Only real drawback I can see so far. Undocked, the sp2 only has one usb port, and I will almost guaranteed have the wireless mouse dongle plugged into it. Oh, and If there is anything I want to install from a disc, I will have to share the drive from one of the other computers laying around the house or work.

It really kind of bugs me about not being able to use the stylus though. I was really looking forward to seeing how it worked with drawing views and whatnot in companion. I initiated a return, but I also went ahead and installed the screen... talk about being split on a decision. Hopefully they won't want the broken one back and will just send a replacement. My luck I'm going to shatter this thing trying to get the screen back out.

26
First type in "backstage pass" or "pump shark" and hit enter, then type in "qa"... this only works in room 2. Following the intro.

Typing "tp" after typing in backstage pass will let you teleport anytime however.


27
So here is another new Class thanks to Phil's work on his decompiler. Having an actor... it may also work with views too I didn't try it because I doubt it, but maybe... orbit around an actor, view, or prop.

First off you will need to add the script to your game. In my case, I have been doing a bit of rearranging so I had script number 982 open. You will want to number your own script accordingly.
Code: [Select]
/******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 982)
/******************************************************************************/
(use "Main")
(use "Cycle")
(use "Obj")
/******************************************************************************/
(class Orbit of Motion
    (properties
        client 0
        caller 0
        x 0
        y 0
        dx 0
        dy 0
        {b-moveCnt} 0
        {b-i1} 0
        {b-i2} 0
        {b-di} 0
        {b-xAxis} 0
        {b-incr} 0
        completed 0
        xLast 0
        yLast 0
        centerObj 0
        radius 50
        xTilt 0
        yTilt 0
        angleStep 10
        winding 1
        curAngle 0
    )

    (method (init theClient theCenterObj theRadius theXTilt theYTilt theAngleStep theWinding theCurAngle)
        (var centerObjX, centerObjY, temp2, temp3)
        (if (>= paramTotal 1)
            = client theClient
            (if (>= paramTotal 2)
                = centerObj theCenterObj
                (if (>= paramTotal 3)
                    = radius theRadius
                    (if (>= paramTotal 4)
                        = xTilt theXTilt
                        (if (>= paramTotal 5)
                            = yTilt theYTilt
                            (if (>= paramTotal 6)
                                = angleStep theAngleStep
                                (if (>= paramTotal 7)
                                    = winding theWinding
                                    (if (>= paramTotal 8)
                                        = curAngle theCurAngle
                                    )
                                )
                            )
                        )
                    )
                )
            )
        )
        (if (centerObj)
            = centerObjX (send centerObj:x)
            = centerObjY (send centerObj:y)
        )(else
            = centerObjX 160
            = centerObjY 100
        )
        = temp2 SinMult(curAngle radius)
        = temp3 CosMult((+ yTilt global51) CosMult(curAngle radius))
        (if (xTilt)
            = temp2 CosMult(xTilt temp2)
            = temp3 (+ temp3 SinMult(xTilt temp2))
        )
        = x (+ centerObjX temp2)
        = y (- centerObjY temp3)
        = curAngle proc999_1((+ curAngle (* winding angleStep)) 360)
        (super:init(client x y))
    )


    (method (moveDone)
        (self:init())
    )

)

I had to include global51 in the Main script. I am not quite sure yet if that particular global variable has the equivalent already in there.

Also, I already had it in the obj script, but you will probably also need to add in proc_999_1. Just scroll all the way down to the bottom and toss it in there.
Code: [Select]

(procedure public (proc999_1 param1 param2)
    = param1 (- param1 (* param2 (/ param1 param2)))
    (if (< param1 0)
        = param1 (+ param1 param2)
    )
    return param1
)

Ok, so now it is in there so you should be able to make use of this new motion class.

So we will need an instance of an actor added to our game.
Code: [Select]
(instance testerMan of Act(properties x 200 y 90 view 20))

and of course we will actually need to init it. For my test, I just went ahead and had a view 20 orbit around the ego. One thing to note, the orbitting doesn't seem to take place until the actor is basically at the 12:00 position. I started off just placing my testerMan anywhere and he made a straight line to that posn straight north of the orbitee before the orbitting took place. So may as well just init it into that spot.

Code: [Select]
(testerMan:init()
                   posn((send gEgo:x) (- (send gEgo:y) 50))
                   setPri(15)
                   ignoreActors()
                   ignoreControl(ctlWHITE)
                   setCycle(Walk)
                   setMotion(Orbit gEgo)
)

Now looking at the class, there are alot more parameters that can be passed, this was just the bare minimum to get it going...

 theCenterObj // In this case gEgo
 theRadius  // distance from center the points of orbit fall
 theXTilt
 theYTilt
 theAngleStep // number of degrees between points of orbit... setting to 120, orbit forms a triangle. 90 a square
 theWinding  // TRUE or FALSE, setting to 0 the orbiter remains a constant distance, but doesn't circle
 theCurAngle

28
SCI Syntax Help / Understanding later SCI code... SQ4
« on: May 07, 2015, 11:10:50 PM »
So it's time to start seriously looking at this coding business and trying to sort it out. The latest decompilation that has been made available has been SQ4, so I am starting there. And not only starting there, but actually starting at the beginning... with the intro script.

I have been doing some tinkering with the code layout and whatnot to actually get it as recognizable to me as possible. I figured I would start throwing out some rudimentary questions as I come across things I am not sure about as well as some clarification just to make sure what I think is happening is actually what is happening. So I guess to start with, I will post the code that I am actually staring at. I commented the hell out of it so it might actually be easier to read if you copy it and paste it into our current version of sciCompanion just for the syntax highlighting.

Code: [Select]
//******************************************************************************
// SQ4 - Space Quest Splash Screen and initial Intro bit
//******************************************************************************
(include "sci.sh")(include "game.sh")                               (script 1)
//*****************************************************************************
(use "Main") // Good old main script, we are used to this one...
(use "SQRoom") // Seems to mainly handle ego motion
(use "n958")// Seems to be a small load / dispose script...
(use "User")// We are used to User
(use "Obj")// We are used to Obj

//*****************************************************************************
(local
    local0 // unused by this script so really could be omitted
    local1
)

//*****************************************************************************
(instance public rm001 of SQRoom
(properties picture 106) // picture 106 is the sierra splash screen...
  (method (init)
  (super:init())
  (self:setScript(RoomScript))
  (self:setRegions(707)) // actually the intro.txt file... holds the handleEvent for the intro screens
  Load(rsPIC 1)// Bah, who needs Load... no one ever uses it... anyway, loads pic 1 into memory
  proc958_0(135 68 69) // found in script 958... the small load / dispose script
  // So if I am halfway right, this will load param1 (resource type) and then
  // loop through the remaining paramaters representing the resource numbers
  // of that type... Loading each one in succession
  // looking at this in viewer, 135 must represent RSFONT, and would therefore load
  // fonts 68 and 69 (there aren't any other resource types which include 68 or 69)
  // so 135 must mean Font... we are used to this (define rsFONT   $87)
  )// end Method init
)// end Instance
//******************************************************
(instance RoomScript of Script
(properties)
  (method (doit)
  (super:doit())
  // So we know do it checks things every cycle...
  // so we are looking every cycle to see if the changestate is at state (or case) 1
  // and the music being played is throwing prevSignal 10... not sure what prevSignal 10
  // means but anyway, when those two conditions are met, then the RoomScript is supposed
  // to cue itself. Which I have never tried it but judging by this, it will bump the
  // changestate method on to the next state (case) as I am not seeing anything else here
  // that does do that.
  (if ((== state 1) and (== (send gLongSong:prevSignal) 10))(self:cue()))
  )// end Method Doit


    (method (changeState newState)
        (var temp0[3]) // unused by this method so really could be omitted
        (switch (= state newState)
            (case 0
                (send gLongSong:loop(-1)playBed()) // Starts the song that doit is keeping an eye on
                = cycles 2 // waits a couple of ticks then moves on to case 1
            )
            (case 1) // just hangs... This threw me until I noticed the cue() in the doit... thats what moves us on
            (case 2
                (send global2:drawPic(1))// Not sure what global2 is... gRoom maybe, we have always just used DrawPic(###) before
// anyway, this throws up the Space Quest Title Screen
                = register 200 // I see register is used in SQRoom.txt but in the context of newRoom... not sure what we are registering here.
// But judging from the next case, it looks like this is going to be used as a quick and dirty timer variable
                = cycles 2 // waits a couple of ticks then moves on to case 3
            )
            (case 3
                Animate((send gCast:elements) 0) // I am not sure what this actually does... do we have a cast?
                (while (--register and (== gTheGNumber gNumber))// so while register > 0 ?? I don't get what kicks us out of the while loop
                    (if (== register 150) // when the register variable is at 150... started in case 2 at 200
                        = local1 proc0_12(" 1991 Sierra On-Line, Inc." 67 1 177 70 316 28 proc0_18(global157 global156) 29 gColor 30 1 33 68)
// ok so not sure why this had to have a name, local1 is one of this scripts local variables defined at the top.
// local1 is set to proc0_12 which is pretty obvious is some sort of display command. as it throws the copyright
// line on to the screen... not sure why there are processes inside this display command though or what all of those parameters
// represent.
                    )
                    (User:doit()) // not sure why this is here....
                    Palette(6 160 191 -1) // or these
                    Palette(6 128 159 -1)
                )// end while
                (send global2:drawPic(803 30)) // Ok so this I can tell you, draws picture 803 on the screen. Again not sure about the send bit with DrawPic
                (if (== gNumber gTheGNumber) // hmm... so apparently if these two match
                    (send global2:newRoom(6))// then it is time to take this intro on to room 6... also, this confirms global2 = gRoom as we knew it previously
// (send gRoom:newRoom(###))
                )
            )
        )// end switch
    )//end method
)// end instance

So what do you think, is this something we want to try and sort out together or no... I just figured we would take the game as it comes and look at the code and decipher what it is actually doing on screen.

29
Here's another bit of code which has come about as a result of Troflip's decompilation efforts. This bit will create a "talking icon" which will play through a print icons animations however many times you may like for it to.

First in the DCIcon script, add this class to the bottom of the script. You could make it it's own script and then use it to pull in it's functionality, but I really didn't see any reason to in this case.
Code: [Select]
(class TalkIcon of DCIcon
    (properties
        type 4
        state 0
        nsTop 0
        nsLeft 0
        nsBottom 0
        nsRight 0
        key 0
        said 0
        value 0
        view 0
        loop 0
        cel 0
        cycler 0
        cycleSpeed 6
        signal 0
        iterate -1
        iterCnt 0
        saveBits 0
    )

    (method (init)
    (var offsetIterate)
        (if (== cycler -1)
            = cycler 0
        )(else
            (if (cycler)
                (send (= cycler (send cycler:new())):init(self))
            )(else
                (send (= cycler (Fwd:new())):init(self))
            )
        )
        = iterCnt 0
        // Corrects for number of cels in loop
        (if(> iterate -1)
           = offsetIterate (* iterate NumCels(self))
           = iterate offsetIterate
)
        // Corrects for cycleSpeed
        (if(> cycleSpeed 0)
           = offsetIterate (+ (* iterate cycleSpeed) iterate)
           = iterate offsetIterate
)
    )


    (method (draw)
        (var temp0)
        (if (saveBits)
            Graph(8 saveBits)
            Graph(13 nsTop nsLeft nsBottom nsRight)
        )
        = saveBits Graph(7 nsTop nsLeft nsBottom nsRight 3)
        DrawCel(view loop cel nsLeft nsTop 15)
    )


    (method (cycle)
        (var theCel)
        = theCel cel
        (super:cycle())
       
       
      //  (if (not IsObject(cycler) or (== cel theCel))
      //      0
      //  )(else
            (if ((== iterate -1) or (<= iterCnt iterate))
                ++iterCnt
                //(if ((> NumLoops(self) 1) and (loop or (< Random(1 100) 51)))
                //    = loop (^ loop $0001)
                //)
            )(else
                (if (> iterCnt iterate)
                    (if (IsObject(cycler))
                        (send cycler:dispose())
                    )
                    = loop (= cycler (= cel 0))
                )
            )
        )
  //  )
)

Now in the Roomscript that you would like to use a talking icon. You will need to add an instance, just like you would for an actor or other view. In my case, I used view 950, but you will need to set the view, loop, and cel accordingly.
Code: [Select]
(instance testTalkIcon of TalkIcon(properties view 950 loop 0 cel 0))

While you could probably add an init method to that instance, I have always inited my dcIcons in the roomscript. So in the public instance  of your room (the same place as all of your other init's), add in the code
Code: [Select]
  (testTalkIcon:init())

and finally, all that is left to do is trigger it somehow.
Code: [Select]
(if(Said('hi'))
    (testTalkIcon:iterate(1)cel(4))
    Print("Talk Icon 1" #icon testTalkIcon)
   
    (testTalkIcon:iterate(2)cel(0))
    Print("Talk Icon 2" #icon testTalkIcon)
   
    (testTalkIcon:iterate(4)cycleSpeed(10)loop(1))
    Print("Talk Icon 3" #icon testTalkIcon)
)

This code more or less came out of sq4 decompiled code. I made a few adjustments to it because out of the box the iterate property acted like it represented the number of cycles that the icon would animate for. So if you said iterate(6) and the cycleSpeed was set to 6 then you would only see the view change 1 cel. I added a bit of math to take into account the cyclespeed as well as the number of cels in the loop so that 1 iteration equals 1 time through the loop. One thing to note, this will end on the same cel that it began on.

30
SCI Community How To's & Tutorials / Oscillating a view
« on: May 04, 2015, 08:41:49 PM »
With the decompiled sq5 script available, I have been playing around with some of the new cycle script options.

One such script, Osc... short for oscillation I assume is actually pretty cool. I am not sure when it is that I personally might use it, nevertheless I have been playing around with it so I figured I would share what it is that I have learned about it.

First off, you are going to want to add it to your current game. Here is the script... Of course you can give it any script number that fits your needs.

Code: [Select]
//*****************************************************
// osc
//*****************************************************
(include "sci.sh")(include "game.sh")
//*****************************************************
(script 972)                              (use "Cycle")
//*****************************************************
(class Osc of Cycle
    (properties
        client 0
        caller 0
        cycleDir 1
        cycleCnt 0
        completed 0
        howManyCycles -1
    )

    (method (init param1 theHowManyCycles theCaller)
        (if (>= paramTotal 2)
            = howManyCycles theHowManyCycles
            (if (>= paramTotal 3)
                = caller theCaller
            )
        )
        (super:init(param1))
    )


    (method (doit)
        (var OscNextCel)
        (if ((> (= OscNextCel (self:nextCel())) (send client:lastCel())) or (< OscNextCel 0))
            = cycleDir neg cycleDir
            (self:cycleDone())
        )(else
            (send client:cel(OscNextCel))
        )
    )


    (method (cycleDone)
        (if (howManyCycles)
            (send client:cel((self:nextCel())))
            (if (> howManyCycles 0)
                --howManyCycles
            )
        )(else
            = completed 1
            (self:motionCue())
        )
    )

)// end class
//*****************************************************

Next, you will want to use it in a room, so at the top with all of the other uses, add in the use line... You may need to change the sc and sco file names in the source folder to do it exactly like this.

Code: [Select]
(use "osc")

and finally you will want to apply it to an instance of a view. For my testing, I just created three instances and used the same view for all three of them. A square that grows from a dot outward.

Code: [Select]
(instance testViewOsc0 of Prop(properties view 1 cel 0 loop 0 x 120 y 160))
(instance testViewOsc1 of Prop(properties view 1 cel 0 loop 0 x 160 y 160))
(instance testViewOsc2 of Prop(properties view 1 cel 0 loop 0 x 200 y 160))

Then in the init section I went ahead and told each instance to oscillate with setCycle(Osc). Now actually watching it and counting the oscillations, I am of the opinion that it suffers from being off by 1.

Code: [Select]
        (testViewOsc0:init()setCycle(Osc)) // oscillates infinitely
        (testViewOsc1:init()cycleSpeed(4)setCycle(Osc 3))// out, in, out, in... ending where it began cel 0, so actually 4
        (testViewOsc2:init()setCycle(Osc 6))// o,i,o,i,o,i,o... ending on last cel, so actually 7

I have gone ahead and attached a copy of it in action if you want to take a peak.

*Edit
So I figured out a use for it... I have now applied oscillate to the flashing red warning lights in my pnc remake of space quest 1. I redrew the light a bit for this purpose and I like it.

Pages: 1 [2] 3 4 ... 11

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

Page created in 0.138 seconds with 19 queries.