Author Topic: Dying  (Read 5465 times)

0 Members and 1 Guest are viewing this topic.

Offline Krusher

Dying
« on: June 23, 2004, 02:52:22 PM »
I was messing around with the tutorial and was trying to figure out how to make the ego die if he touches a certain person walking randomly around.   Does anyone know how to do this?



Offline Cloudee1

Re:Dying
« Reply #1 on: June 23, 2004, 08:30:24 PM »
Follow the tutorial and instead of putting the dying stuff in the handleevent method, put it under the doit method and then to activate it add something to check the distance to the other actor, similar to talking to them.

If this doesn't help, let me know and I'll post some code to illustrate what I mean.  ;)
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Krusher

Re:Dying
« Reply #2 on: June 23, 2004, 08:49:47 PM »
Sorry I'm so dumb, but I'm new to this.  I would appreciate it if you could illustrate it with some code.

Offline Cloudee1

Re:Dying
« Reply #3 on: June 24, 2004, 01:42:32 AM »
here you go:
Code: [Select]
(instance RoomScript of Script(properties)
  (method(doit)      // constantly checks
  (var dyingScript)  // add variable
  (super:doit())
    (if(<(send gEgo:distanceTo(badMan))20) //if closer than 20
    (send gEgo:view(822)setCycle(Fwd))      //an ego dying view
    = dyingScript ScriptID(DYING_SCRIPT)
    (send dyingScript:caller(832)
    register("You would do better to avoid that bad man! "))
    (send gGame:setScript(dyingScript))
    ) // ends if
  )  // ends method
)   // ends instance
;)
« Last Edit: June 24, 2004, 01:47:27 AM by cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Krusher

Re:Dying
« Reply #4 on: June 24, 2004, 07:18:27 AM »
thanks, cloudee!  I got it to work.


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

Page created in 0.035 seconds with 17 queries.