Author Topic: Car door vs. house door  (Read 3012 times)

0 Members and 1 Guest are viewing this topic.

Offline Jim C

Car door vs. house door
« on: November 17, 2003, 09:52:26 AM »
Hi, I just started on my own game using SCI Studio 3 a few days ago. I've put a lot of hours into it, and I figured out a lot of my problems on my own, but there's a couple of issues I can't figure out:

1) I can't get the game to distinguish between a car door and a house door. I read the "said handling" section of the tutorial, but nothing I try works. What I want is to be able to say "open house door" and "open car door" and have it know the difference. Just saying "open door" should result in a "be more specific" reply.

2) I want to trigger an event after a prop animation is complete. I have something like:
(animation:setCycle(End))
(send gRoom:newRoom(3))
but the new room opens before the animation starts. How can I tell it to wait for the end?

Thanks very much for any help you can give me. Brian, this is a great program. I'm having so much fun!



Offline Doan Sephim

Re:Car door vs. house door
« Reply #1 on: November 17, 2003, 10:32:05 AM »
hey jim,
well, im just a beginner too and there might be a better way to do this, but here is what i would do:
i would put in a said command like
(if(Said('open/door'))
 = button Print("which one would you like to open?"
 #title "Which?"
 #button "The car door" 1
 #button "The house door" 0
 )
 (...)
)
and set up the two buttons with their appropriate endings.
as for your other question, i dont know but i bet that it has something to do with which of the two the computer can do faster...but again, i leave that to someone smarter than me, but dont worry cuz there are plenty of them out there ;)
doan
« Last Edit: November 17, 2003, 10:34:03 AM by doan sephim »
Artificial Intelligence Competition

Offline Jim C

Re:Car door vs. house door
« Reply #2 on: November 17, 2003, 11:00:33 AM »
Thanks for the tip, doan! I'd prefer to stick with regular text input in this instance, but I think I will use that button trick in another part of my game.

Offline Cloudee1

Re:Car door vs. house door
« Reply #3 on: November 17, 2003, 11:35:07 AM »
The easiest and less confusing for the player would be to set up two different control colors (red, lime lets say)
make these two colors around the area where you want either of the doors. then

(if(Said("open/door"))
 (if(== (send gEgo:onControl()) ctlRED)(carDoor:open())
  (else(if(== (send gEgo:onControl()) ctlLIME)(houseDoor:open())
   (else Print("Stand closer to the door you want to open!"))
  )
 )
)

I just punched this code in, it might not be 100% but it's pretty close.

it's easier than wrestling with the syntax (trust me!)
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Eigen

Re:Car door vs. house door
« Reply #4 on: November 17, 2003, 11:39:37 AM »
For the triggering the and event

First add another instance:

Code: [Select]
(instance GoToRoom of Script
 (properties)
 (method(changeState newState)
= newState 0
 = state newState
 (switch(state)
 (case 0
(send gRoom: newRoom(3))
)
)
)

and then use

Code: [Select]
(animation:setCycle(End GoToRoom))


-Eigen
« Last Edit: November 17, 2003, 11:40:20 AM by Eigen »
Artificial Intelligence Competition

Offline Jim C

Re:Car door vs. house door
« Reply #5 on: November 17, 2003, 12:10:55 PM »
Great, thanks guys! I guess that answers both of my questions. I hadn't figured out how to use states yet, but that code helps a lot. Thanks again.

Offline Brian Provinciano

Re:Car door vs. house door
« Reply #6 on: November 17, 2003, 05:42:55 PM »
Hi! Nice to see you enjoying SCI Studio. Picture controls are the easiest and most efficient way to do things. When drawing your picture in the picture editor, switch to the control screen and car draw a region around the door in one colour, and around the other door in another colour. Then simply check them in the script like cloudee mentioned.

The tutorial show how to do this in detail as well. Good luck!


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

Page created in 0.046 seconds with 21 queries.