6743c0fd75cc5

Page: « 1 2 [3] 4 »
6743c0fd771e2
2 Guests are here.
 

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

6743c0fd77c6dvoodoo47

6743c0fd77cca
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 »
6743c0fd781f4
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 !
6743c0fd78342
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.

6743c0fd784e1voodoo47

6743c0fd78532
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 »
6743c0fd7861f
Im sorry to be such a burdon, but .. Would you care to make an example of how to swap two objects ? :-)

6743c0fd78754voodoo47

6743c0fd7879f
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 »
6743c0fd78a6d
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

6743c0fd78b0dvoodoo47

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

6743c0fd78ce1voodoo47

6743c0fd78d2e
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.
6743c0fd78e2e
You're da man voodoo.. ! Now i got something to work with tonight!  8)

6743c0fd78ec1voodoo47

6743c0fd78f1c
well yes, I was indeed a man last time I've checked.
Acknowledged by: Da9L
6743c0fd790c4
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 ?

6743c0fd794d3unn_atropos

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

6743c0fd7976cvoodoo47

6743c0fd797bd
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 »
6743c0fd798db
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
6743c0fd79a56
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?

6743c0fd79b18voodoo47

6743c0fd79b65
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.

6743c0fd79c95ZylonBane

6743c0fd79ce2
Now that we have Squirrel... this really should be done with Squirrel. It allows so much more direct control over what you're doing.
6743c0fd79fe7
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 ? :)

6743c0fd7a0ccvoodoo47

6743c0fd7a12f
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
6743c0fd7a3fe
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

6743c0fd7a4eavoodoo47

6743c0fd7a534
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).

6743c0fd7a777ZylonBane

6743c0fd7a7cd
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.
6743c0fd7aa4e
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 ?
2 Guests are here.
If I were a rich man? ...Yubby dibby dibby dibby dibby dibby dibby dum~
Page: « 1 2 [3] 4 »
Contact SMF 2.0.19 | SMF © 2016, Simple Machines | Terms and Policies
FEEP
6743c0fd7da8a