Make examining mirror call look at player script (SOLVED)

NecroDeath
03 Jul 2018, 14:20

Hi,

I have a mirror in my game, when the player examines it or 'look into' it, I want to call the examine self response. I thing I need to call objects script but I can't get the syntax right.

Thanks,
ND


XanMag
03 Jul 2018, 14:40

I am definitely no code guru and the syntax is likely wrong but could you try:

Do(player, “look at”)

In the script for looking into the mirror?

I’d try it but I’m not by my PC.

Someone help that awful code!! :)


The Pixie
03 Jul 2018, 14:58

Nearly XanMag:

do(player, "look")

... assuming it is a script.


NecroDeath
03 Jul 2018, 15:20

Thanks Pixie but that returns error ‘object reference not set to an instance of an object’ when I examine the mirror


XanMag
03 Jul 2018, 15:22

Did you rename your player object by chance?


mrangel
03 Jul 2018, 15:26

There's a recent post asking how to make a script that calls a verb/command on some object. Here's a link.

If the player's description is plain text, I think you would want:

msg (GetString (game.pov, "look"))

If it's a script, you'd want:

do (game.pov, "look")

If you're not sure which (because you have multiple possible player objects?); or if you want to include the game's checks for darkness (or whatever) first, you would use the "lookat" command:

params = NewDictionary()
dictionary add (params, "object", game.pov)
do (lookat, "script", params)

NecroDeath
03 Jul 2018, 15:42

Thanks! Got it working now.


hegemonkhan
03 Jul 2018, 19:59

while already solved, just a reminder:

there's also the possibility of:

'look' (when NOT currently controlling the Player Object)
vs
'pov_look' (when CURRENTLY CONTROLLING the Player Object)

so, make sure you're using the right ('look' vs 'pov_look') description Script/String