Author Topic: Getting When A Player Touches A Brick [Solved]  (Read 1462 times)

How can I detect when a player touches a brick wether it has events or no?
« Last Edit: October 03, 2012, 12:39:28 PM by jes00 »

The events are called on the brick irregardless of there being events, right?

Otherwise, ask Darren/Nerrad

The events are called on the brick irregardless of there being events, right?
No. I don't believe so.

fxDtsBrick::onPlayerTouch is always called, regardless of if the event is there.

fxDtsBrick::onPlayerTouch is always called, regardless of if the event is there.
i knew it

fxDtsBrick::onPlayerTouch is always called, regardless of if the event is there.
i knew it
Tested it. It did not work until I had added an event to the brick. It also worked when I did %brick.enableTouch = true;

I used a stuff method and forgeted up the eventing all together. I'd have used fxDtsBrick::OnPlayerTouch but I gave up on the Crumbling Stage project so I never got around to doing it.

Tested it. It did not work until I had added an event to the brick. It also worked when I did %brick.enableTouch = true;
Let me just rip this from my Crumbling Stage script;
Code: [Select]
   function fxDTSBrick::onLoadPlant(%this)
   {
      parent::onLoadPlant(%this);

      %this.enableTouch = true;
      %this.enableFakeTouch = true;

      %enabled     = 1;
      %delay       = 1;
      %inputEvent  = "OnPlayerTouch";
      %target      = "client";
      %outputEvent = "PlaySound";
      %par1        = Beep_Popup_Sound.getID();

      %this.addEvent(%enabled,%delay,%inputEvent,%target,%outputEvent,%par1);
   }
If I also recall correctly, this ruined usage of other onPlayerTouch events as you edit the fxDTSBrick::onPlayerTouch function, unless you return the parent, I don't know. I haven't coded in weeks.
« Last Edit: October 02, 2012, 01:01:21 PM by nerraD »

Why the hell do you want every brick to beep
.enabletuch is enough

I'll just set a global var when the correct save is loaded and than onLoadPlant; if the global var is true do %brick.enableTouch = true; and than when the save is done being loaded I'll just set the global var to false.

Why the hell do you want every brick to beep
.enabletuch is enough
You cannot simply use an event and not finish %par1 off, I think it automatically wipes the event out if a parameter is not valid or something. Also the beep never worked considering if you read my post, it broke the whole onPlayerTouch input event.

The code you posted does only edit onLoadPlant function

The code you posted does only edit onLoadPlant function
And your point here is?


That it doesn't break stuff
but editing the fxDTSBrick::OnPlayerTouch field does.

If I also recall correctly, this ruined usage of other onPlayerTouch events as you edit the fxDTSBrick::onPlayerTouch function, unless you return the parent, I don't know. I haven't coded in weeks.
Please read posts better in the future. You always go too quick with things.