6743c0921c9c9

Page: « 1 2 [3] 4 »
6743c0921df4a
1 Guest is here.
 

Topic: Move stuff around
Page: « 1 2 [3] 4 »
Read 9886 times  

6743c0921fab8voodoo47

6743c0921fb30
Well tried out again today, and didn't get it to work.
yep, I think it's not going to work - thinking about it some more, I believe a spawned trap would have to be linked to two objects for this to work, and that can't be done, afaik. but pretty sure some alternate setup can be conceived for this particular scenario (moving two world objects in tandem) though - be back in a moment.


//ok, so I've simply chosen to remove physics from the chair, and detailattach it to the table, then apply the standard "move one world object via spawned teleport traps" template onto the table;
Code: [Select]
DML1

//remove physics from chair
-ObjProp 5 "PhysType"
// Link chair with table
+Link 5 7 "DetailAttachement"
{
"rel pos" 0, -6, 0.2
"rel rot" 180.00, 0.00, 0.00
}
//apply the setup to the table
+ObjProp 7 "Scripts"
{
"Script 0" NVRelayTrap
"Script 1" NVCreateAndLink
"Script 2" NVCreateAndLink2
}
+ObjProp 7 "ObjList"
{
"" NVRelayTrapOn="BeginScript"; NVRelayTrapOnDelay=50; NVRelayTrapTCount=1; NVRelayTrapTOn="TurnOn"; NVRelayTrapTDest="&?~SwitchLink"; NVCreateAndLinkOn="BeginScript"; NVCreateAndLinkCount=1; NVCreateAndLinkCreate="Teleport Trap"; NVCreateAndLinkLinkType="~SwitchLink"; NVCreateAndLinkLoc="-25.22, -10.36, -5.94"; NVCreateAndLinkLocObj=0; NVCreateAndLink2On="BeginScript"; NVCreateAndLink2Count=1; NVCreateAndLink2Create="Teleport Trap"; NVCreateAndLink2LinkType="~SwitchLink"; NVCreateAndLink2Loc="-19.87, -10.27, -6.29"; NVCreateAndLink2LocObj=0;
}

the good: works, and this made the dml very simple.
the bad: the chair lost physics, this might be slightly undesirable, but should be ok in this case (you don't need to shoot it, or stand on it). //hold on, this is fixable

so this will work for any couples of world objects, as long as one not having physics is not a problem (a corpse on a bench would be a good example).


also, don't forget to load the allobjs script to the testmap! the teleporters will not work without it.
« Last Edit: 29. March 2017, 13:35:37 by voodoo47 »
6743c0921ffb6
yep, I think it's not going to work - thinking about it some more, I believe a spawned trap would have to be linked to two objects for this to work, and that can't be done, afaik. but pretty sure some alternate way of doing things can be conceived for this particular setup (moving two world objects in tandem) though - will check in a bit later.

Then i will just continue my work with the other decks where this setup is not needed :-) Thanks for your help !
6743c092201c1
lol didn't expect you to come up with a solution that fast ! As for the chair losing physics, it doesn't matter. I only chose a table and a chair, as an example. The things I'm going to move around wont have any physics anyway from what i can i remember.

I will try it out when i get back home.. :-)

One of the things i think I'm going to use this for is to move the art terminals with code pieces on deck 5 around, but replace their original art terminal with another one from else where on the ship, that does not have a code piece in it.

6743c09220381voodoo47

6743c092203eb
that should be easy, just set the terminal with code to scriptparams createandlink a normal terminal at the same location once triggered by the random signal, and then teleport it away.

also, I already have that bit of code that will readd physics to the chair in your test setup, so posting just in case;
Code: [Select]
DML1

//remove physics from chair
-ObjProp 5 "PhysType"
// Link chair with table
+Link 5 7 "DetailAttachement"
{
"rel pos" 0, -6, 1
"rel rot" 180.00, 0.00, 0.00
"Flags" No Auto-Delete
}
//apply the setup to the table
+ObjProp 7 "Scripts"
{
"Script 0" NVRelayTrap
"Script 1" NVCreateAndLink
"Script 2" NVCreateAndLink2
}
+ObjProp 7 "ObjList"
{
"" NVRelayTrapOn="BeginScript"; NVRelayTrapOnDelay=50; NVRelayTrapTCount=1; NVRelayTrapTOn="TurnOn"; NVRelayTrapTDest="&?~SwitchLink"; NVCreateAndLinkOn="BeginScript"; NVCreateAndLinkCount=1; NVCreateAndLinkCreate="Teleport Trap"; NVCreateAndLinkLinkType="~SwitchLink"; NVCreateAndLinkLoc="-25.22, -10.36, -5.94"; NVCreateAndLinkLocObj=0; NVCreateAndLink2On="BeginScript"; NVCreateAndLink2Count=1; NVCreateAndLink2Create="Teleport Trap"; NVCreateAndLink2LinkType="~SwitchLink"; NVCreateAndLink2Loc="-19.87, -10.27, -6.29"; NVCreateAndLink2LocObj=0;
}
//readd physics onto the chair
+ObjProp 5 "Scripts"
{
"Script 0" NVRemovePropertyTrap
"Script 1" NVRelayTrap
"Script 2" NVLinkBuilder
}
+ObjProp 5 "ObjList"
{
"" NVRelayTrapOn="BeginScript"; NVRelayTrapOnDelay=100; NVRelayTrapOnCount=1; NVRelayTrapTOn="UnLink"; NVRelayTrapOff="BeginScript"; NVRelayTrapOffDelay=150; NVRelayTrapOffCount=1; NVRelayTrapTOff="RePhys"; NVRelayTrapTDest="[me]"; NVLinkBuilderOff="UnLink"; NVLinkBuilderLinkType="DetailAttachement"; NVLinkBuilderLinkSource="5"; NVLinkBuilderLinkDest="7"; NVRemovePropertyTrapOn="RePhys"; NVRemovePropertyTrapProp="PhysType"; NVRemovePropertyTrapReAdd=1; NVRemovePropertyTrapCount=1;
}
« Last Edit: 29. March 2017, 13:56:07 by voodoo47 »
6743c092204fc
Im sorry to be such a burdon, but .. Would you care to make an example of how to swap two objects ? :-)

6743c092205ecvoodoo47

6743c09220641
nothing universal comes to mind, I would just try something simple depending on the concrete scenario.

//maybe make a teleport trap from obj1 and switchlink it to obj2, and create a new teleport trap switchlinked to obj1 at place where obj2 is, then fire obj1 which will teleport obj2 to obj1, and relay the signal from obj1 to the new teleport trap which will pull it to where obj2 was, that could work. will try to make an example tomorrow.
« Last Edit: 30. March 2017, 21:00:25 by voodoo47 »
6743c092208d5
nothing universal comes to mind, I would just try something simple depending on the concrete scenario.

I think i might need to get to understand DML a little better tbh. Because even though this should be simple, i dont have any idea how to :P

6743c0922097bvoodoo47

6743c092209cc
dmls are just a means to an end, and that end (a setup that does something) is what you need to understand.

6743c09221389voodoo47

6743c092213ef
ok, here goes (first pic with the code bit at rec1 is geting swapped with a nearby comppad):
Code: [Select]
DML1

//set up the scripts on the comppad
+ObjProp 509 "Scripts"
{
   "Script 0" TrapTeleport
   "Script 1" NVCreateAndLink
   "Script 2" NVRelayTrap
}
+ObjProp 509 "ObjList"
{
   "" NVCreateAndLinkOn="BeginScript"; NVCreateAndLinkCount=1; NVCreateAndLinkCreate="Teleport Trap"; NVCreateAndLinkLinkType="~SwitchLink"; NVCreateAndLinkLoc="12.5, -397, -5"; NVCreateAndLinkRot="0.00, 0.00, 63.50"; NVCreateAndLinkLocObj=0; NVRelayTrapOn="TurnOn"; NVRelayTrapOnDelay=50; NVRelayTrapTCount=1; NVRelayTrapTOn="TurnOn"; NVRelayTrapTDest="&~SwitchLink";
}
//link the pic with the comppad
+Link 509 79 "SwitchLink"
{
}
//link the firer object with the comppad
+Link 212 509 "ScriptParams"
{
}
//and fire the signal upon start
+ObjProp 212 "Scripts"
{
   "Script 0" NVRelayTrap
}
+ObjProp 212 "ObjList"
{
   "" NVRelayTrapOn="BeginScript"; NVRelayTrapOnDelay=50; NVRelayTrapTCount=1; NVRelayTrapTOn="TurnOn"; NVRelayTrapTDest="&?ScriptParams";
}

so basically, this turns 509 (a junk object) into a teleport trap, chair 212 is emulating the randomization signal. 509 creates a teleport trap at the same location where quest obj 79 is upon start and ~switchlinks to it, 212 sends a turnon signal to 509 50 milliseconds after start, once 509 receives the signal from 212, it pulls the quest object 79 to its place, and after 50 milliseconds teleports itself away to the teleport trap created upon start at the place where quest item 79 was.

note: EXTREME care must be taken to ensure the turnon signals flying around the switchlinks won't activate something they shouldn't - you definitely don't want any of the obj 509 scripts and args on any quest object.
6743c092223ca
You're da man voodoo.. ! Now i got something to work with tonight!  8)

6743c09222498voodoo47

6743c092224ed
well yes, I was indeed a man last time I've checked.
Acknowledged by: Da9L
6743c09222632
Got it to work on a second frame, BUT .. I replace the compad in your example with another frame, and its like the images in the frame gets "swapped" so that when there should be static, there's images, and when there should be images, there is static, if that makes sense. but i suppose this is because the scripting interferes with the art terminals own scripts somehow ?

6743c09222a53unn_atropos

6743c09222aa8
You're da man voodoo.. ! Now i got something to work with tonight!  8)
https://www.youtube.com/watch?v=mDqsgbtpDLk

6743c09222cd8voodoo47

6743c09222d2b
this is because the scripting interferes with the art terminals own scripts somehow ?
yep - however this shouldn't be a big deal on a non-quest pic, and it also should be possible to correct it by yet another relaytrap simulating player frob and loading another picture after the swap. the extra relay should just fit in.

//aand nope - not so simple as it may seem. I'll have a second look later.
« Last Edit: 02. April 2017, 12:44:15 by voodoo47 »
6743c09222e3d
Just got done with all the eggs in the rickenbacker .. phew ..  maybe i should do it with the normal eggs too, not sure yet. However all there is left now for quest items is operations, recreation and botm
6743c09222fe7
Alright got back to this today. Still struggling with a few things.

* - Swapping two objects, mainly art terminals.
The method voodoo47 does work, however one of the terminals also seems to swap its own images, so that static is present when it shouldn't be and the actual pictures show when static should be present

* - Moving two objects randomly but in "sets", so that object A and B always move to location 1 and 2 OR 3 and 4 OR 5 and 6 etc.
As i understand this, i need to use the NVRelayTrap, to randomly activate two NVRelayTraps on three other random objects, which will then activate the objects to move in pairs. Question is how do i use NVRelayTrap to activate another NVRelayTrap on another object? The NVRelayTrapTDest property, says it is NOT recommended to use ID numbers as those can randomly change, but what else then?

6743c092230bevoodoo47

6743c0922310d
it's not recommended as the ids can change when building a level. should be very safe to use in a dml mod that is being applied on a finished mission.

would probably need the wip mod to check the rest.

6743c09223228ZylonBane

6743c0922327b
Now that we have Squirrel... this really should be done with Squirrel. It allows so much more direct control over what you're doing.
6743c092234fe
Now that we have Squirrel... this really should be done with Squirrel. It allows so much more direct control over what you're doing.

Is that intended to replace DML ? Do you have any description of how it works or documentation somewhere ? :)

6743c092235d2voodoo47

6743c09223624
dmls apply props to objects, so no. however, squirrel can be used to do all the advanced stuff currently done via NVscript, I think.

there are some squirrel scripting examples in the NewDark doc folder, so check those out, but ye be warned, they probably won't help you much if you don't know how to code.
Acknowledged by: Da9L
6743c092238b3
dmls apply props to objects, so no. however, squirrel can be used to do all the advanced stuff currently done via NVscript, I think.

there are some squirrel scripting examples in the NewDark doc folder, so check those out, but ye be warned, they probably won't help you much if you don't know how to code.

Worst part of all this is that i code on a daily basis, yet i honestly don't like the way DML is working .. Maybe squirrrel might be more apealing to me .. But then again I'm almost done with this only need deck 4 and 5 really, then all quest items will be random

6743c09223a22voodoo47

6743c09223a71
I think you might be confusing dmls (the simple stuff that applies properties on objects) with NVscript (those NVsomething chunks of code in ObjList args that provide the advanced script functions).

I like them a lot - mostly because it's the only thing I know (a bit).

6743c0922520bZylonBane

6743c09225282
Is that intended to replace DML ?
Not even close. Squirrel lets you write your own custom scripts in a JavaScript-like syntax. It's Dark's version of Lua now.

A general purpose object position randomizing script is actually on my to-do list for SCP. Lord knows when I'll get around to it though.
6743c09225606
Not even close. Squirrel lets you write your own custom scripts in a JavaScript-like syntax. It's Dark's version of Lua now.

A general purpose object position randomizing script is actually on my to-do list for SCP. Lord knows when I'll get around to it though.

Is there no documentation anywhere for how to use this Squirrel for SS2 ?
1 Guest is here.
Outlaw Country!
Page: « 1 2 [3] 4 »
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6743c092261ee