Author Topic: send gEgo:onControl()  (Read 3167 times)

0 Members and 1 Guest are viewing this topic.

Offline Wilco

send gEgo:onControl()
« on: March 20, 2003, 01:54:52 AM »
Hey guys I need some help! I've followed the tutorial, and I'm currently scripting my own game but I'm stuck. I can't seem to be able to get the control colour to work so that my character will transport to the next room when he is on the control colour. I've used green as my control colour, and I'm sure there's nothing wrong with my picture. It must be in my script.
Any help muchly appreciated.
Thankees

(instance RoomScript of Script
    (properties)
    (method (doit)
        (if(== (send gEgo:onControl()) ctlGREEN)
            (send gRoom:newRoom(2))
        )
    )

   (method (handleEvent pEvent)
        (super:handleEvent(pEvent))

This is just the first part of my roomscript instance.


__________________
***Cat's Quest***
---Coming (Not So) Soon!---
__________________

Offline Eigen

Re:send gEgo:onControl()
« Reply #1 on: March 20, 2003, 02:06:13 AM »
I tried your code and it works here. Are you sure you draw the green color on the Control screen not Priority screen. And make sure it is dark green not light green.




-Eigen
Artificial Intelligence Competition

Offline Wilco

Re:send gEgo:onControl()
« Reply #2 on: March 20, 2003, 02:10:09 AM »
Yeppers, I used dark green, and I've definitely been drawing on the control screen. Perhaps there is something wrong with another area of my code?
I'm not entirely sure how the:
north
south
east
west
section of the public instance is supposed to fit into the big picture, (but this probably has nothing to do with my code not working right?)
I can't figure out why it won't do anything, I've spent hours on this.  :-\
« Last Edit: March 20, 2003, 02:11:22 AM by Wilco »
__________________
***Cat's Quest***
---Coming (Not So) Soon!---
__________________

Offline Brian Provinciano

Re:send gEgo:onControl()
« Reply #3 on: March 20, 2003, 02:40:22 AM »
Have a look at my Gnome Quest source for examples. You should look in the class reference/help file and check out the methods ignoreControl and observeControl. If you do ignoreControl, it will ignore the control and not return TRUE. observeControl does the opposite.

Offline Wilco

Re:send gEgo:onControl()
« Reply #4 on: March 20, 2003, 03:11:15 AM »
Thanks, I'll read up the examples more thoroughly.  :)
__________________
***Cat's Quest***
---Coming (Not So) Soon!---
__________________

Offline Wilco

Re:send gEgo:onControl()
« Reply #5 on: March 23, 2003, 08:52:17 PM »
Well it's five days later and I'm still having no luck with this gosh-darned command. For some reason, which I really can't figure out why, my control line doesn't seem to have any effect. I've tried importing Brian's ego into my room, I've tried using one of Brian's rooms with my coding (just in case, to narrow down the possiblity of what was going wrong)
- Still it didn't work. I'm thinking there has to be something wrong with my code.
* I know the tutorial like the back of my hand by now
* I've referred to the help file, but it doesn't seem to be in English ;)

Oh yeah, I did the tutorial and my control lines worked then - though as you know in the tutorial there's a door and an entranceTo command, so I'm not sure if this is different.

I'm just trying to get my ego to walk through an empty door (but not touch the edge of the screen) to the next room.
Hmmm, it's probably something small and silly!  :-\
__________________
***Cat's Quest***
---Coming (Not So) Soon!---
__________________

Offline Eigen

Re:send gEgo:onControl()
« Reply #6 on: March 24, 2003, 12:23:03 AM »
Could you send me the whole script/game?


-Eigen
Artificial Intelligence Competition

Offline Wilco

Re:send gEgo:onControl()
« Reply #7 on: March 24, 2003, 12:53:33 AM »
That would be fab Eigen, I'll post tomorrow (not on this computer)  :)
__________________
***Cat's Quest***
---Coming (Not So) Soon!---
__________________

Offline Cloudee1

Re:send gEgo:onControl()
« Reply #8 on: March 25, 2003, 02:00:28 AM »
ok don't leave me hanging i'm having same problem i have scripted two instances; look and control But it only does the script which comes first. Similar problem?  Help me now Please!
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Wilco

Re:send gEgo:onControl()
« Reply #9 on: March 26, 2003, 08:01:57 PM »
Never mind, I've scrapped the whole lot and I'm starting again - it worked in the tutorial so I think I'll just follow the example more closely.
__________________
***Cat's Quest***
---Coming (Not So) Soon!---
__________________


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

Page created in 0.071 seconds with 22 queries.