Author Topic: Creature OnPerception, do something when perceiving someone other than PC?  (Read 457 times)

Legacy_pamelahoward

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0


               

How would I do this? The tag is "tag_inaridetylmarande".



               
               

               
            

Legacy_pamelahoward

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Creature OnPerception, do something when perceiving someone other than PC?
« Reply #1 on: December 09, 2014, 01:46:09 pm »


               

This seems like the right general idea but obviously the wrong execution. Any suggestions?



if (GetLastPerceptionSeen() == GetObjectByTag("tag_inaridetylmarande",0)) return;

               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Creature OnPerception, do something when perceiving someone other than PC?
« Reply #2 on: December 09, 2014, 02:24:24 pm »


               

GetLastPerceptionSeen returns an int, and you can't compare an int to an object. It would have to go something like:


 


object oPerceived = GetLastPerceived();


if (GetTag(oPerceived) == "InsertYourTagHere" && GetLastPerceptionSeen()) {


  //Do stuff here


}



               
               

               
            

Legacy_pamelahoward

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
Creature OnPerception, do something when perceiving someone other than PC?
« Reply #3 on: December 09, 2014, 03:11:17 pm »


               


GetLastPerceptionSeen returns an int, and you can't compare an int to an object. It would have to go something like:


 


object oPerceived = GetLastPerceived();


if (GetTag(oPerceived) == "InsertYourTagHere" && GetLastPerceptionSeen()) {


  //Do stuff here


}




Works perfectly, I see exactly what I did wrong. Thank you!