Jump to content

Scripting something to be interactive?


Zeealex

Recommended Posts

basically i want to make phlookian's suitcase nuke object from his placeable objects resource, interactive, so that when you press the space bar you are "diffusing" the nuke, how would i go about doing that? or doing something similar.

PLUS how would i go about setting a timer display on screen so there is a specified time limit to find the nuke codes and diffuse the nuke? and any "wrong diffusal" (diffusal attempt without the codes) jumps the timer by a minute?

thanks if you can help me out on this :thumbsup:

Link to comment
Share on other sites

Great new sig, Zee. :thumbsup:

Unfortunately, the suitcase nuke is not interactive but you could make a prox trigger if you wanted. A few cases and the laptop can be used as interactives though. Here is how you would set up an interactive script.

First, go into Phlook's manual and find the door tag for the object that you are using. Copy the tag to your clipboard, or just keep it handy.

Now go into your mission and place the object.

Make a new script block that has DoorOpened for the trigger.

In the parameter box, type or paste the object's door name.

For the resposne, either have it complete the objective or set a timer for however long you want.

For a timer display, I would suggest using a DisplayMessageAll response, not DisplayMessageBoxAll. Box displays a big blue box like the one that says when you complete an objective, and the latter just shows yellow text at the top left of the screen. To make an active timer that can be viewed, do the following:

In your door opened response or the proximity block, add a counter set response.

Set the counter to however long the timer should last until it is defused.

Now have it QueueCall to a group called TimerGroup or whatever you call it. Make sure you do a GroupDisable response in your startup block and disable the TimerGroup.

Make a new script block that is inside the Timer Group.

For the response, put these:

BlockPreserve

ContinueIf

Set the ContinueIf to CompareIntegers and set it to Continue if the value of your timer counter is greater than 0.

DisplayMessageAll

Go to QueryEdit, and select ConvertIntegerToString. Set the parameter to GetCounter.

It should say this:

Allow this block to be reactivated.

Continue executing responses if (The value of Timer Counter is greater than 0)

Display "(The value of (Timer Counter) as text))

Here is an example script:

Group: <Default>

Comment:

01: startup

Trigger Event:

The simulation is starting.

Responses:

Set Platoon AL - Players to (The player-controlled platoon).

Disable the Timer script blocks.

Set Counter - Diffusion Timer to 100000.

Group: <Default>

Comment:

case diffused

Trigger Event:

"<n><door>case4door0.0.vcl" has opened.

Responses:

Set Counter - Diffusion Timer to 60.

Call Timer after this block.

Group: <Default>

Comment:

obj 1 complete

Trigger Event:

1 second(s) elapsed.

Responses:

Allow this block to be reactivated.

Continue executing responses if ((The value of Counter - Diffusion Timer) is less than or equal to 0).

Mark 1. defuse the bomb complete in the objective list.

Increment Counter - Objectives Down.

Prevent this block from being reactivated.

Group: Timer

Comment:

timer

Trigger Event:

1 second(s) elapsed.

Responses:

Allow this block to be reactivated.

Decrement Counter - Diffusion Timer.

Continue executing responses if ((The value of Counter - Diffusion Timer) is greater than 0).

Display ((The value of Counter - Diffusion Timer) as text) to all players.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...