Jump to content
Sign in to follow this  
heldenhammer

Switch off Light on streetlamp

Recommended Posts

Hi folks, 

hope you are able to provide some editing support to a newbie. 

Just need to switch off the light on a streetlamp, therefore I placed a game logic next to the object and tried the following but desperately failed. 

lamp1= [0,0,0] nearestObject 156352; lamp1 setHit ["light_1_hitpoint", 0.97];

also tried 

(object 156352) switchLight "OFF";

And yes, object 156352 is the correct id for the streetlamp, tried it with getneaerestobject setdamage 1 instruction and *magic* the lamp was destroyed

Thanks for advice

 

Share this post


Link to post
Share on other sites

Hi killzone_kid. 

Indeed, for me unfortunately it does not help at all. 

What I did, for testing purpose, I placed a game logic next to the lamp objet, placed also a player next to it, then I put in init line the following command with no result, the lihgt is still burning. 

lamp = nearestObject [player, "Lamps_base_F"]; 
lamp setHit ["light_1_hitpoint", 0.97];

Share this post


Link to post
Share on other sites

 

Hi killzone_kid. 

Indeed, for me unfortunately it does not help at all. 

What I did, for testing purpose, I placed a game logic next to the lamp objet, placed also a player next to it, then I put in init line the following command with no result, the lihgt is still burning. 

lamp = nearestObject [player, "Lamps_base_F"]; 
lamp setHit ["light_1_hitpoint", 0.97];

Do 

 

copytoclipboard str getAllHitpointsDamage lamp

and paste here the results

Share this post


Link to post
Share on other sites

Sorry for the delayed response but real life kept me really busy. It was not before today that I had some quite minutes to continue working on the mission.

[["HitBulb",""],["",""],[0,0]]

This is the result I received after adding your command to the init line of my game logic. Does it helh in troube fixing?

Can't deal with the command Hitbulb, even tried to search it in BI wiki but found no result. Any advice and explanation, please :-/

Share this post


Link to post
Share on other sites

The command getallhitpointsdamage returns only the hitpoint "HitBulb"

 

change

lamp setHit ["light_1_hitpoint", 0.97];

to

lamp setHit ["HitBulb", 0.97];

Share this post


Link to post
Share on other sites

Sorry for the delayed response but real life kept me really busy. It was not before today that I had some quite minutes to continue working on the mission.

[["HitBulb",""],["",""],[0,0]]

This is the result I received after adding your command to the init line of my game logic. Does it helh in troube fixing?

Can't deal with the command Hitbulb, even tried to search it in BI wiki but found no result. Any advice and explanation, please :-/

 

You can try

 


lamp = nearestObject [player, "Lamps_base_F"];
lamp seHitpointDamage ["HitBulb", 0.97];

Share this post


Link to post
Share on other sites

Hi thanks for your support but it is getting ridiculous. This strange streetlamp is still burning even by trying both proposed solutions. Could it be that the expression Lamps_base_F is not the right identifier for that lamp object on map Celle2.

Is there a ay to get the object name of map objects by only knowing the object id?

Share this post


Link to post
Share on other sites

Hi thanks for your support but it is getting ridiculous. This strange streetlamp is still burning even by trying both proposed solutions. Could it be that the expression Lamps_base_F is not the right identifier for that lamp object on map Celle2.

Is there a ay to get the object name of map objects by only knowing the object id?

try to kill the bulb by passing 1 instead of 0.97

Share this post


Link to post
Share on other sites

Not working :-(

[["HitBulb",""],["",""],[0,0]]

Any other ideas? 

 

 

what happens if you

 

lamp setHitIndex [0,1];
lamp setHitIndex [1,1];
hint str getAllHitpointsDamage lamp;

Share this post


Link to post
Share on other sites

Thanks killzone_kid it is working fine.

Hint is showing following line.

[["HitBulb",""],["",""],[1,1]]

For a better understanding, could you shortly explain to me what is happening on coding side?

 

My final solution looks like this, 

lamp1 = [0,0,0] nearestObject 156353;
lamp1 setHitIndex [0,1];
lamp1 setHitIndex [1,1];

Now I have an enemy occupied, dark village. This will be a nice surprise for the attacking forces :-)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×