Jump to content



Photo

Switching solenoid relays


Best Answer BilboX , 05 May 2014 - 03:21 PM

Hi. I have a hotfix: use a custom callback.

 

First add you behaviour in AddGi for example, even if these will not be rom driven.

 

Then, add this function:

void CustomGIStringSolenoidCB(int slot, bool b)
{
  if(slot == 11)
  {
     // Copy this line for each of your gi
     GameObject.Find("<my gi lamp name>").GetComponent<BxBasicLamp>().SetState(b); // normal
     //GameObject.Find("<my gi lamp name>").GetComponent<BxBasicLamp>().SetState(!b); // inverted behaviour
  }
}

At the end of your Init function, add:

AddSolenoidCallBack(11,CustomGIStringSolenoidCB);

Let me know if this did the trick...

Go to the full post


  • Please log in to reply
4 replies to this topic

#1 chepas

chepas

    t.me/horsepin

  • Members
  • PipPipPipPip
  • 1,966 posts

  • Flag: ---------

  • Favorite Pinball: BSD, Tr0n, SW:Stern

Posted 02 May 2014 - 06:14 PM

Grand Lizard has one GI relay but it seems the "switch" is the wrong way around. The GI should come on while ball in play but it does the opposite.

                 AddSolenoid("gi1", 11, "BxBasicLamp");
		 AddSolenoid("gi2", 11, "BxBasicLamp");
		 AddSolenoid("gi3", 11, "BxBasicLamp");
		 AddSolenoid("gi4", 11, "BxBasicLamp");

Edited by chepas, 02 May 2014 - 06:15 PM.

Bump maps are the new auto-tune :BDH:
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000


#2 BilboX

BilboX

    Enthusiast

  • Unit3D Pinball Team
  • 433 posts
  • Location:French Polynesia

  • Flag: France

  • Favorite Pinball: Metallica, Addams Familly, Scared Stiff, White Water

Posted 03 May 2014 - 08:48 AM

Do you have to trigger it by a solenoid relay or does the GI striong beeing simulated by the rom? (check with slot explorer please).

If GI tsring has the right behaviour, please add using "AddGI" instead...

 

If not, then we have a new topic in todo list => invert flag...

 

Let us know!


UP2


#3 chepas

chepas

    t.me/horsepin

  • Members
  • PipPipPipPip
  • 1,966 posts

  • Flag: ---------

  • Favorite Pinball: BSD, Tr0n, SW:Stern

Posted 03 May 2014 - 11:31 AM

I think first of all I went and added into InitGIsObjects but would fail each time for some reason on this game. Even testing just one random bulb number.

 

It is just one solenoid yes that does the whole playfield, not simulated.

 

 

If not, then we have a new topic in todo list => invert flag...

Cool, thanks


Bump maps are the new auto-tune :BDH:
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000


#4 BilboX

BilboX

    Enthusiast

  • Unit3D Pinball Team
  • 433 posts
  • Location:French Polynesia

  • Flag: France

  • Favorite Pinball: Metallica, Addams Familly, Scared Stiff, White Water

Posted 05 May 2014 - 03:21 PM   Best Answer

Hi. I have a hotfix: use a custom callback.

 

First add you behaviour in AddGi for example, even if these will not be rom driven.

 

Then, add this function:

void CustomGIStringSolenoidCB(int slot, bool b)
{
  if(slot == 11)
  {
     // Copy this line for each of your gi
     GameObject.Find("<my gi lamp name>").GetComponent<BxBasicLamp>().SetState(b); // normal
     //GameObject.Find("<my gi lamp name>").GetComponent<BxBasicLamp>().SetState(!b); // inverted behaviour
  }
}

At the end of your Init function, add:

AddSolenoidCallBack(11,CustomGIStringSolenoidCB);

Let me know if this did the trick...


UP2


#5 chepas

chepas

    t.me/horsepin

  • Members
  • PipPipPipPip
  • 1,966 posts

  • Flag: ---------

  • Favorite Pinball: BSD, Tr0n, SW:Stern

Posted 05 May 2014 - 04:04 PM

Thanks, all good :killwithfire:


I think first of all I went and added into InitGIsObjects but would fail each time for some reason on this game. Even testing just one random bulb number.

 

 

This was because I didn't add enough gi slots to the start up array. ;)


Bump maps are the new auto-tune :BDH:
VPX - RSS Updates ---- blog.flippingflips.xyz/en/ -- Visual Pinball No.1 (2021) . Est.2000