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 - Doan Sephim

Pages: 1 ... 34 35 [36] 37 38 ... 43
526
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 07, 2007, 09:30:15 PM »
Would you be willing to show me which code? I've been messing with it for a while now and I still can't figure it out. Not with the selector landing on the button you click, anyway.

Are you saying you want to click on the button, have the selector animate on the button for a split second and then move on to whatever the actual button does? If so, I would create something like this:
Code: [Select]
(instance buttonPress of Script
    (properties)
    (method (changeState newState)
        = state newState
        (switch (state)
            (case 2 = cycles 3
                  (code where the selector animates on the given button)
            (case 3
                  (code that does what the button says)
            )
         )
     )
)

To get this instance to work you have to do a couple things:
(1) on any one of your views that you have initialized, you need to add "setScript(buttonPress)" like:
Code: [Select]
(theThrone:init()setScript(buttonPress))This will make it so the instance is recognized.

(2)Then, wherever you have the click code you put in this: (buttonPress:changeState(2)), which will tell the script to run that code, send you to 3 cycles of the selector landing on the particular button, and then going on to run whatever that button does.

If you do this, you will have to do some re-working on your code. You should be able to figure it out though.

Quote
My title screen is just about finished now. I just need to get that double-click issue sorted out. One last thing. I have these sparkles animating on the title. Right now they're only animating forwards and looping. How do I get it to loop forwards then backwards and loop that way?

easiest way I think is to just make the view to shimmer out and back in again. But if you want it to shimmer out and in, and then wait a moment, you would have to do something like what I just showed you in creating another changeState instance that controls them...you should be able to find out how that works from what I described...but if you have questions, I will try to answer them.

527
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 07, 2007, 08:07:21 PM »
Don't worry about it saying "Joystick" it will work just the same.

You do have to double-click...I did that merely for my game, you don't have to do that for yours. In fact, it would be less coding for single-click...you would just have to take out some code.

You wouldn't need to have a global variable and then go to initrooms, you could simply tell the game, when clicked on credits to go to that particular room:
Code: [Select]
(send gRoom:newRoom(900)) or whatever number room it would be.

I have no idea what
Code: [Select]
(send pEvent:claimed(TRUE)) really does, I just have it there because I borrowed some of this code from Cloudee1 and it was in his...sorry


528
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 07, 2007, 06:07:51 PM »
The script I posted allows for the arrows to select. All the code is there for the up and down arrows. You have put in code for left and right, so I am guessing that is what you are looking for. It's not very involved at all really...you just need a visual representation of which button is selected.

Troflip: thanks for the lesson in coding...I have no idea where I learned that really?! I am not a scripter (SCI was my first and only coding experience) and I did that from day one! oops!

529
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 07, 2007, 05:52:45 PM »
I PMed you with a redone script. I added an (if(sMenuStart) and I think I changed a few of the brackets...let me know if it works!

EDIT: OOPS!! I sent you the script prematurely. I was going over it again and found a problem. The way the code is the enter button will not do anything until sMenuStart is TRUE...you can replace the code with this slightly modified version:

Code: [Select]
(if (==(send pEvent:type)evKEYBOARD)
           
            (if(==(send pEvent:message)KEY_RETURN)
(if(sMenuStart)
            (if(sBegin)
                   (send gTheMusic:fade())
                   (send gRoom:newRoom(INITROOMS_SCRIPT))
                )(else
                    (if(sCont)
                        (send gGame:restore())
                    )(else
                       (if(sIntro)
                           = gIntro 1
                           (send gTheMusic:fade())
                           (send gRoom:newRoom(INITROOMS_SCRIPT))
                       )(else
                           (if(sCred)
                                = gCred 1
                               (send gTheMusic:fade())
                               (send gRoom:newRoom(INITROOMS_SCRIPT))
                           )
                       )
                    )
)
)(else
                (RoomScript:cue())
)
            )
)

530
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 07, 2007, 05:33:15 PM »
I'm working through the code, but I think I may have found a problem, and I will post the redone code as soon as I get it reworked. I think there is an (else floating around with no (if and it may be causing problems.

531
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 07, 2007, 04:12:26 PM »
can you email me (or post, or PM) your script? That would help me alot to be able to pinpoint any potential problems.
doansephim@yahoo.com

532
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 07, 2007, 02:30:46 PM »
Put this in the else part:

(RoomScript:cue()) // this will send the state to the next one

533
SCI Development Tools / Re: I'm the latest newb here
« on: June 06, 2007, 11:27:12 PM »
Welcome Jedispy!

You are right, that link is not functional at this point. We should change that!

For the studios and other resources go here: http://scicommunity.com/sciforums/index.php?topic=33.0

and for some tutorials: http://scicommunity.com/sciforums/index.php?topic=4.0

Good to hear from you! If you have any other questions, feel free to ask!
Doan

534
SCI Syntax Help / Re: Bit of help with 3 Things
« on: June 06, 2007, 05:03:02 PM »
Third: I want to make a selector for buttons a la KQ1SCI's title menu and cause either a mouse click or using the arrow keys and pressing enter to select and activate each button.

Here is the Script from my title screen: it has the ability to select "new game", "restore", "play demo" and "quit" based on mouse clicks or selecting with the arrow keys and enter. I hope this is what you're looking for.
Code: [Select]

(include "sci.sh")
(include "game.sh")

(script TITLESCREEN_SCRIPT)

(use "main")
(use "game")
(use "menubar")
(use "obj")
(use "cycle")
(use "user")
(use "controls")
(use "feature")

//Variables to determine what the "selector" View is highlighting
(local
   sNewGame = 1 // default selector on New Game
   sRestore = 0
   sPlayDemo = 0
   sQuitGame = 0
)

(instance public TitleScreen of Rm
(properties picture scriptNumber)
(method (init)
        // Set up the title screen
ProgramControl()
= gProgramControl FALSE
(send gGame:setSpeed(3))
(SL:disable())
(TheMenuBar:hide())

(super:init())
(self:setScript(RoomScript))

(send gEgo:init()hide())

        Display(
"Copyright < 2007"
dsCOORD 150 177
dsCOLOUR 1 // dark blue
dsBACKGROUND clTRANSPARENT
)
        (profile:init()loop(1))
        (games:init()setCycle(Fwd)cycleSpeed(2))
        (newGame:init())
        (restore:init()loop(1))
        (quitGame:init()loop(2))
        (playDemo:init()loop(3))
        (selector:init()loop(4))

        )
)

(instance RoomScript of Script
(properties)
    (method (changeState newState)
        = state newState
        (switch(state)
            (case 0 = cycles 40
            )(case 1 = cycles 40
                Display(
                    "Presents:"
                    dsCOORD 110 70
                    dsCOLOUR clBLUE
                    dsBACKGROUND clTRANSPARENT
                )
            )(case 2 = cycles 7
                (line:init()setCycle(End))
            )(case 3 = cycles 10
                (line:loop(1)posn(208 140)cel(0)setCycle(End)cycleSpeed(1))

            )(case 4 = cycles 15
                (BA:init()loop(1))
            )
        )

    )
(method (handleEvent pEvent)
        (super:handleEvent(pEvent))
        (if(==(send pEvent:type) evJOYSTICK)
            (if(==(send pEvent:message) 1)  // UP
                (selectorCheckUp)
            )
        )
        (if(==(send pEvent:type) evJOYSTICK)
            (if(==(send pEvent:message) 5)  // Down
                (selectorCheckDown)
            )
        )
        (if (==(send pEvent:type)evKEYBOARD)
            (if(==(send pEvent:message)KEY_RETURN)
                (if(sNewGame)
                    (send gRoom:newRoom(INITROOMS_SCRIPT))
                )(else
                    (if(sRestore)
                        (send gGame:restore())
                    )(else
                        (if(sPlayDemo)
                            = gDemo 1
                            (send gRoom:newRoom(INITROOMS_SCRIPT))
                        )(else
                            (if(sQuitGame)
                                = gQuitGame 1
                            )
                        )
                    )
                )
            )
        )
        (if(==(send pEvent:type())evMOUSEBUTTON)
            (if((> (send pEvent:x) (newGame:nsLeft))and
                (< (send pEvent:x) (newGame:nsRight))and
                (> (send pEvent:y) (newGame:nsTop))and
                (< (send pEvent:y) (newGame:nsBottom)))
                (if(sNewGame)
                    (send gRoom:newRoom(INITROOMS_SCRIPT))
                )(else
                    (selectorZero)
                    = sNewGame 1
                    (selector:posn(44 61))
                    (send pEvent:claimed(TRUE))
                )
            )(else
                (if((> (send pEvent:x) (restore:nsLeft))and
                    (< (send pEvent:x) (restore:nsRight))and
                    (> (send pEvent:y) (restore:nsTop))and
                    (< (send pEvent:y) (restore:nsBottom)))
                    (if(sRestore)
                        (send gGame:restore())
                    )(else
                        (selectorZero)
                        = sRestore 1
                        (selector:posn(44 94))
                        (send pEvent:claimed(TRUE))
                    )
                )(else
                    (if((> (send pEvent:x) (playDemo:nsLeft))and
                        (< (send pEvent:x) (playDemo:nsRight))and
                        (> (send pEvent:y) (playDemo:nsTop))and
                        (< (send pEvent:y) (playDemo:nsBottom)))
                        (if(sPlayDemo)
                            = gDemo 1
                            (send gRoom:newRoom(INITROOMS_SCRIPT))
                        )(else
                            (selectorZero)
                            = sPlayDemo 1
                            (selector:posn(44 127))
                            (send pEvent:claimed(TRUE))
                        )
                    )(else
                        (if((> (send pEvent:x) (quitGame:nsLeft))and
                            (< (send pEvent:x) (quitGame:nsRight))and
                            (> (send pEvent:y) (quitGame:nsTop))and
                            (< (send pEvent:y) (quitGame:nsBottom)))
                            (if(sQuitGame)
                                = gQuitGame 1
                            )(else
                                (selectorZero)
                                = sQuitGame 1
                                (selector:posn(44 160))
                                (send pEvent:claimed(TRUE))
                            )
                        )
                    )
                )
    )
)
)//end method
)
//Procedures for the Title Menu
(procedure (selectorCheckUp)
    (if(sNewGame)
        (selectorZero)
        = sQuitGame 1
        (selector:posn(44 160))
    )(else
        (if(sRestore)
            (selectorZero)
            = sNewGame 1
            (selector:posn(44 61))
        )(else
            (if(sPlayDemo)
                (selectorZero)
                = sRestore 1
                (selector:posn(44 94))
            )(else
                (if(sQuitGame)
                    (selectorZero)
                    =sPlayDemo 1
                    (selector:posn(44 127))
                )
            )
        )
    )
)

(procedure (selectorCheckDown)
    (if(sNewGame)
        (selectorZero)
        = sRestore 1
        (selector:posn(44 94))
    )(else
        (if(sRestore)
            (selectorZero)
            = sPlayDemo 1
            (selector:posn(44 127))
        )(else
            (if(sPlayDemo)
                (selectorZero)
                = sQuitGame 1
                (selector:posn(44 160))
            )(else
                (if(sQuitGame)
                    (selectorZero)
                    = sNewGame 1
                    (selector:posn(44 61))
                )
            )
        )
    )
)

(procedure (selectorZero)
= sNewGame 0
= sRestore 0
= sPlayDemo 0
= sQuitGame 0
)

(instance BA of Prop
    (properties
        y 128
        x 206
        view 995
    )
)
(instance games of Prop
    (properties
        y 50
        x 210
        view 999
    )
)
(instance profile of Prop
    (properties
        y 35
        x 180
        view 999
    )
)
(instance newGame of Prop
    (properties
        y 57
        x 44
        view 998
    )
)
(instance restore of Prop
    (properties
        y 90
        x 44
        view 998
    )
)
(instance playDemo of Prop
    (properties
        y 123
        x 44
        view 998
    )
)
(instance quitGame of Prop
    (properties
        y 156
        x 44
        view 998
    )
)
(instance selector of Prop
    (properties
        y 61
        x 44
        view 998
    )
)
(instance line of Prop
    (properties
        y 112
        x 208
        view 997
    )
)

535
SCI Syntax Help / Re: Hide "Display"s?
« on: June 06, 2007, 01:12:47 PM »
I'n not really familiar with using @title.

Instead of using
Code: [Select]
(= title1 "SCI Pre-Alpha Version 1.0")why not just put the "SCI Pre-Alpha Version 1.0" as a text resource?

Then to get it to display
Code: [Select]
= title1 Display( 800 0 // 800 is the title screen number and 0 is the first text resource
                    dsCOORD 57 130
                    dsALIGN alCENTER
                    dsCOLOUR clCYAN
                    dsBACKGROUND clBLACK
                    dsWIDTH 200
                    dsSAVEPIXELS // saves the pixels the text overwrites
             )

Or, if you don't want to use text resources:
Code: [Select]
= title1 Display( "SCI Pre-Alpha Version 1.0"
                    dsCOORD 57 130
                    dsALIGN alCENTER
                    dsCOLOUR clCYAN
                    dsBACKGROUND clBLACK
                    dsWIDTH 200
                    dsSAVEPIXELS // saves the pixels the text overwrites
            )

And for the disappearing act:
Code: [Select]
= title1 Display( "" dsRESTOREPIXELS htext)
I know I am not really working with what you are doing with your code, but I'n not really familiar with it, and I know the way I have it set up works.

536
SCI Syntax Help / Re: Hide "Display"s?
« on: June 06, 2007, 12:37:08 PM »
I tend to put the local variables here:
Code: [Select]
(include "sci.sh")
(include "game.sh")

(script 900)

(use "controls")
(use "cycle")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")

(local

htext = 0
stateSwitch = 0

)

537
SCI Syntax Help / Re: Display text over View
« on: June 05, 2007, 06:07:55 PM »
I tried to change the priority settings of the view, but that didn't seem to have any effect. I also looked through the kernal reference help file on "Display" but it didn't have any parameters that looked like it would do anything to print over views.

I dunno! If you want it over the view, can you just draw it on the view?

538
SCI Syntax Help / Re: Hide "Display"s?
« on: June 05, 2007, 04:22:10 PM »
First, you need to make a local variable (like, "htext")

Then, in the changeState method

Code: [Select]
(case 1 = seconds 1 // or cycles x
           = htext Display( 900 0 // text resource
                    dsCOORD 57 130
                    dsALIGN alCENTER
                    dsCOLOUR clCYAN
                    dsBACKGROUND clBLACK
                    dsWIDTH 200
                    dsSAVEPIXELS // saves the pixels the text overwrites
           )
)(case 2 = seconds 1 // or cycles x
           Display(
                    ""
                    dsRESTOREPIXELS htext // re-displays those pixels
           )
)

I think that should work. There is also an exaple of this in my march competition entry if you need more reference.

I'm not as sure about the cursor though...I'm sure there's a way, but I don't know it.

539
Everything-Else / Re: New member!
« on: May 29, 2007, 02:37:56 PM »
Welcome! Hope to hear about some stuff your working on!

540
Community Competitions / Re: March Community Competition (2007)
« on: May 24, 2007, 06:49:20 PM »
Yeah...the last one didn't seem to get anyone's attention...maybe it was a busy time of the year?


Pages: 1 ... 34 35 [36] 37 38 ... 43

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

Page created in 0.045 seconds with 20 queries.