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 Product Chat / Destroy a decal with action

Author
Message
unfamillia
15
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 10th Nov 2011 23:38
Hello,

I am trying to discover a method in which i can destroy a decal once an action has occurred.

For example;

There is a big animated arrow floating above a weapon to indicate to the player that the weapon is there. Once the player picks up the weapon, the arrow should REALLY disappear, as it's not needed anymore.

Example two;

There is an arrow pointing to an electrical box. This box is set up with a destroy and activate script. Once the box is destroyed, the arrow is no longer needed; so, should disappear.

Does anyone have any clues as to how to achieve this. I have searched and came across how to destroy a decal when using a trigger zone, But, it also looks like the trigger zone would need to activate it!? Not what i need

Any help is greatly appreciated

Unfamillia


BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 11th Nov 2011 00:22
I have a SciFi development that uses an arrow to point to certain things the player needs to "activate" or "move to". Once they get there, the arrow disappears. However, my arrow is not a decal, but an actual entity.

Using the switch for example and an entity named arrow, the arrow appears (can be activated via trigger when player passed through) and points to the switch. When the player moves up to the switch and activates it, the switch main script then sets the target to the arrow and activates that target with the following commands:

settargetname=arrow,activatetarget=1

The arrow script once spawned runs the main script and is sitting at the state to check and see if it was activated- if it was, it runs the destroy script; if not it loops back to check. That's where you use the "activated=1" or "activated=0" command for the arrow main script.

The same also would work for your second example. However, if the electrical box uses an alternate texture when it is destroyed, you can then script it to switch to the alternate texture, then activate the arrow and destroy it.

An easier method is to set a trigger to spawn your arrow. Set the Spawn Life to the number of seconds before it will destroy, or use the etimer to run the arrow's destroy script. There are other methods, but using one trigger and the arrow and scripting the arrow and the switch/electrical box is all that you need to do.


Twitter: @NFoxMedia
unfamillia
15
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 11th Nov 2011 09:38 Edited at: 11th Nov 2011 09:44
@BlackFox

Thank you for such a detailed description! That was genuinely a great help. I used decals as i can easily make them animated. I think i will use decals for showing the player things that don't need the arrow to disappear (showing them the way, telling them to jump down shafts, etc)

I didn't think of using an entity! I think i was worried about it appearing and then just falling to the floor! But, i have just realised that i can set the physics to off and it should hang in the air as though weightless.

Thank you again.

I think i will use the trigger zone with a timed destroy script. The other method confuses me at the moment.

Unfamillia


EDIT: Just thought as well, would it be easy to script, so that when the player enters the trigger zone to activate the arrow, they are made to look at the entity? That would be cool. I know there is a command for this, just can't think of what it is at the moment. Probably something like plrlookat=x (x being the entity)


BlackFox
FPSC Master
18
Years of Service
User Offline
Joined: 5th May 2008
Location: Knight to Queens Bishop 3
Posted: 11th Nov 2011 16:18
Quote: "I didn't think of using an entity! I think i was worried about it appearing and then just falling to the floor! But, i have just realised that i can set the physics to off and it should hang in the air as though weightless. "


Actually, just place the arrow entity anywhere and set IsImmobile to Yes. That will keep it right where you want it.

Quote: "would it be easy to script, so that when the player enters the trigger zone to activate the arrow, they are made to look at the entity? That would be cool. I know there is a command for this, just can't think of what it is at the moment."


There might be. In my development, the arrows appear in hallways so I never had to worry about forcing the player to see them. Check the Community Guide(s), it should be in there.


Twitter: @NFoxMedia
unfamillia
15
Years of Service
User Offline
Joined: 26th Jul 2010
Location: Preston, Lancashire
Posted: 12th Nov 2011 15:30
@BlackFox

Thanks for the advice.

I have created an arrow and have textured it. But, i haveing trouble with the illumination map. I have created both _D2.dds and _I.dds textures, but, it doesn't appear to 'glow'. As soon as the ambient light is turned down, you can no longer see the arrow.

any suggestions?

Unfamillia


Captain Coder
FPSC Reloaded TGC Backer
14
Years of Service
User Offline
Joined: 6th Jul 2011
Playing: Elite: Dangerous
Posted: 19th Nov 2011 00:51
What about an animated arrow like the one in Alpha Project?

I didn't play the game (too much language ), but I've seen the videos and I greatly admire the story, level design and other in-game niceties he had. It would be nice to know how to destroy a decal!

Thanks,

Captain Coder

One of the most humbling days in your life will be the day you discover you AREN'T the best at what you love to do.
- Me
loler
16
Years of Service
User Offline
Joined: 27th Jul 2009
Location:
Posted: 19th Nov 2011 01:05 Edited at: 19th Nov 2011 01:08
in a project from me i took a arrow wich was an entity and gave it a pickup script so when you walk other it it disappears

its not a bug its a feature
rolfy
20
Years of Service
User Offline
Joined: 23rd Jun 2006
Location:
Posted: 19th Nov 2011 01:35 Edited at: 19th Nov 2011 01:37
To destroy your decal include the action in whatever entity script you want to destroy it, if your already using a trigger with =1 to start the decal use =2 to destroy it.

Set a condition (plrdistwithin= plrdistfurther= or whatever)
Followed by action:
activateifused=2
You can include this in the trigger script (if your using a trigger to activate the decal).
Put decal name in ifused field of trigger.

Somewhere in your decal main script.
:state=0,activated=2:destroy

Of course it depends on how many states your decal script is using but you should get the gist from this.

Login to post a reply

Server time is: 2026-07-03 08:22:30
Your offset time is: 2026-07-03 08:22:30