fibanocci on 22/9/2014 at 10:02
So I wanted to get rid of the weapons for a while and I put this script on a marker.
After the timing expires, I got my weapons back. But I also get armed with a sword and a healing potion right away. That's not what I want. How to prevent this?
Le MAlin 76 on 22/9/2014 at 10:44
It will be good if one of script programmers use the new services:
Quote:
Script Service Updates
----------------------
A couple of new script services have been added, and a few additions to existing ones (new marked with *):
Camera, DarkGame, DarkOverlay(*), Debug, Engine(*), Object, Physics, ShockOverlay(*), Version(*)
See "script_services.txt" and other script related documentation for details.
New Script Messages
-------------------
"CameraAttach"
Message data:
<none>
Description:
Sent to the object the camera was just attached to. Will not get sent to player during init when camera is
initially attached to player during setup.
"CameraDetach"
Message data:
<none>
Description:
Sent to the object from which the camera was just detached from. This message is sent prior to any
subsequent "CameraAttach" message.
I think that these news things can help...
fibanocci on 22/9/2014 at 11:42
I don't get it :confused:
Le MAlin 76 on 22/9/2014 at 12:38
I don't know what you want to do exactly, but if you want too to hide UI elements with disarming player there is new Qvar:
Quote:
New QVar: "HIDE_UI_ELEMENTS" (T2)
---------------------------------
This quest var is a bit mask to hide UI elements during gameplay. For example when switching the camera over to
another entity and not wanting the player's UI elements to be visible. It only affects the visibility of the
elements and not input interaction/control, so use with care when hiding current item and weapon. Do NOT use this
as a user option to disable UI. There are config vars that are appropriate for that.
When the qvar doesn't exist or is 0, all UI items are visible as normal. Following bits are used:
Bit Element
--- -------
0 Light gem
1 Health bar
2 Air bar
3 Current weapon
4 Current item
16 Script based HUD elements by IDarkOverlayHandler::DrawOverlay (only set if you know what you're doing)
17 Script based HUD elements by IDarkOverlayHandler::DrawTOverlay (only set if you know what you're doing)
For example if "HIDE_UI_ELEMENTS" has a decimal value of 31, bits 0 to 4 will be set to 1 which means all regular
UI elements will hidden. A value of 1 would only hide the light gem. A value of 6 would hide only the health and
air bars.
When wanting to hide all regular player related UI elements it's recommended to set the qvar value to 255. This
would make the mission a bit more future proof in the hypothetical case that any additional UI elements get added.
[with 1.22 version only not in 1.21, 1.20 and 1.19]
fibanocci on 22/9/2014 at 12:55
I don't want to hide the weapons, I want to get rid of it for a while (not contained in the inventory any more). That's what TrapDisarmPlayer or LinkTemplate does.
After getting the weapons back, I don't want to have them equipped automatically. That's all.
LarryG on 22/9/2014 at 13:21
ref. (
http://www.ttlg.com/forums/showthread.php?t=144441) How to Force Clearing of the 'current item'
But try it with either the
clear_weapon or
clear_weapon_and_item command (depending on what you want) on a marker that you trigger. And of course you would trigger the CommandControl script marker any way you want. In your case that may or may not be an NVRelayTrap.
fibanocci on 22/9/2014 at 15:08
Let me explain: The marker with that TrapDisarmPlayer-script is triggered. Timing is 20000. After that, the sword gets selected. It should be deselected right after it got selected doing that command control thingy?
I couldn't even make it work without that delay.
I actually don't want to have that sword selected at all.
LarryG on 22/9/2014 at 16:51
Did you try CommandControl after the TrapDisarmPlayer completes? You need to look for whatever message TrapDisarmPlayer generates on completion and use that to trigger the CommandControl script. You may need to issue the clear_weapon command twice in order to get the desired action, or it may only need it once. You'll have to experiment. But timing is key. You can't clear the weapon before it gets activated. You have to watch the messages and determine which one indicates that.
fibanocci on 22/9/2014 at 17:04
It's working without TrapDisarmPlayer
This is the design note
NVRelayTrapOn="FrobToolEnd"; NVRelayTrapOff="Null"; NVRelayTrapTDest="[sworder]"; NVRelayTrapOnDelay=20500; on="clear_weapon";
Looks like the delay doesn't work. Whatever I set as NVRelayTrapOnDelay=xxxx, it's just ignored.
First, I set it to 20500 for testing, since the TrapDisarmPlayer is set to 20000 ms.
Edit: Okay, the problem is solved. Since the NVRelayTrapOnDelay in that Design Note was ignored, I've put another marker between the trap and the trigger. Design Note: NVRelayTrapOnDelay=20200
The Design Note for the 2nd disarm-marker looks like that
on="clear_weapon;clear_item";
So it goes like that:
1. A item in the inventory (script: triginvfrob and some more scripts which are not important in this case) is triggering
2. a marker (script: TrapDisarmPlayer, Timing: 20000). That's for clearing the inventory the first time. This item is also triggering
3. another marker (script: NVRelayTrap, Timing 20000, Design Note: NVRelayTrapOnDelay=20200). That marker is triggering the
4. last marker (scripts: CommandControl, Design Note: on="clear_weapon;clear_item"). That's the 2nd clearing
Thanks for your help.