Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Scripts / Just an entity's texture, by 'using' another entity

Author
Message
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 8th Apr 2012 04:01
In one of my levels, I have monitor and keyboard entities placed on a desk entity.

With this setup, I have a short sequence where the player 'uses' a keyboard entity to bring up a memo hud on the player's screen (the player uses it a 2nd time to hide the memo again).

That same memo hud is also part of the alt-texture for the monitor entity's screen.

Before the player 'uses' the keyboard, the monitor entity has its normal texture.

What I'd like to happen, is that when the player 'uses' the keyboard, as well as the hud showing up on the player's screen, the monitor's texture also changes to its alt-texture.

I've been playing around with this for a while now trying to get it to work. So far, I've got the monitor's texture to change to the alt-texture when I 'use' the keyboard entity the 1st time, but when I 'use' it the 2nd time, while the memo disappears from the player's screen as it should, the monitor entity's texture doesn't change back to its normal texture.

In fact, it only changes back to the normal texture when I 'use' the keyboard a 3rd time (and the memo re-appears on the player's screen!).

Here's the script for the keyboard (the monitor is named in the keyboard's 'if used' field);



And here's the monitor's script;



I suspect it's the way the 'activateifused' part of the keyboard's script, interacts with the 'activated' part of the monitor's script, but I can't figure out how to correct the problem.

Can someone help please!

bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 8th Apr 2012 05:57
Nevermind, after continuing to play around with it, I finally managed to get it working!

All I did was to change the monitor entity's script from this;



To this;



Ross tra damus
3D Media Maker
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Looking to Escape London
Posted: 8th Apr 2012 15:58
bruce3371

Cool script and thanks for sharing it with us all.

Cheers
bruce3371
14
Years of Service
User Offline
Joined: 4th Aug 2010
Location: Englishland
Posted: 8th Apr 2012 18:10 Edited at: 8th Apr 2012 18:10
BTW, the title should have said 'Change an entity's texture, by 'using' another entity'!

The scripts would also be perfect for something like a computer console changing the textures on a big screen on the wall in some kind of control room. You could edit out the part of the keyboard script that brings up the memo hud, so you only change the screen's texture, like this;



Login to post a reply

Server time is: 2024-11-23 23:45:20
Your offset time is: 2024-11-23 23:45:20