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 ... 24 25 [26] 27 28 ... 33
376
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

377
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

378
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
    )
)

379
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.

380
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

)

381
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?

382
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.

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

384
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?


385
SCI Syntax Help / Re: Ideas for the best way to add an animation
« on: May 24, 2007, 06:43:39 PM »
There are probably a few ways to do this, but here is what I would do:

set up in the main script a variable like:
Code: [Select]
gInBoat = 0Then, in the handleEvent method for the room with the boat,
Code: [Select]
(if(Said('get/in'))
  Print("OK")
  = gInBoat 1
  (send gEgo:view(8))
)
Then, in all the rooms where you may be in the boat, you can set up in the init(method) code like this:
Code: [Select]
(if(gInBoat)
  (send gEgo:init()view(8))
)(else
  (send gEgo:init()view(0))
)
That's pretty barebones, but I think it should work...let me know if you need more help with this.

386
Yeah! Great to hear from you Vonster!

387
SCI Development Tools / Re: Bitmap-SCI0 Converter Example
« on: May 19, 2007, 02:43:03 PM »
wow! That does look rather nice! Perhaps I could achieve similar success in using hand-drawn images then converted for Betrayed Alliance.


388
SCI Syntax Help / Re: Something is eating my heap!!
« on: May 12, 2007, 11:53:42 PM »
Hey thanks! That works perfect! This kinda stuff always happens when I don't REALLY know how something works and I just copy and paste!

Thanks for clarifying what exactly I was doing! I feel stupid when I post questions and there is only ONE small snippet of code that solves all the problems...lol.

BTW...thanks a ton Troflip for those more advanced tutorials! They have served me quite well lately! I never EVER would've figured out quite how to use regions without those tutorials.

389
SCI Syntax Help / Something is eating my heap!!
« on: May 12, 2007, 10:42:16 PM »
I actually know exactly what is "eating" my heap...and when I say "eating" I mean that the game is losing heap space every game cycle and when I switch rooms the heap does not reset as it should. Some heap is simply MIA!! Restarting the game restores the heap, but that would probably be expected.

Here is what I am doing. I have a region that I am accessing. In the region's doit method I have this:
Code: [Select]
(= myEvent Event:new(evNULL))The above code is what is "eating" the heap.
I am then using the "myEvent" x and y values to have certain actions happen when the cursor is simply in a certain area, so there are two probable ways to solve my problem...either determine why the code is leaking heap or use a different way to achieve the same goal...either way I would be happy with ;)

However the myEvent code (which I found in Cloudee1's aquarius game) for some reason munches away on heap space. I assume it wasn't a problem in Cloudee1's game as I never had the heap space run out...might it have something to do with my using it in a region??

390
More work is being done on this title and it's getting exciting. More puzzle elements are being hammered out, and story-line solidified.

Most recent work:
(1) new fully-operational puzzle board
(2) 1/2 programmed fighting system with integrated character stats
(3) full overview map drawn (though not yet "ingame" map)
(4) more character Sprites complete

If anyone is interested in offering a hand, I am looking for help coding Print commands that are more "interactive".

Also, in an effort to speed things more along, I am looking for someone willing to collaborate on drawing pics.

PM me if you think you might have something to offer on either front or if you want more info.

Pages: 1 ... 24 25 [26] 27 28 ... 33

SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.283 seconds with 20 queries.