Anyone know offhand if brushes turned into functions(specificaly crates) can be moved via code?
Wondering if it is possible and I just have scripting errors, or if you cant move a function brush at all.
Moving entities
Moderator: Moderators
Moving entities
When I am king, you will be first against the wall~


the brushes do indeed 'move' when I change thier origin, they spawn in a different place... but they dont seem to be able to 'move'
as yo ucan see, i tried backwards, forwards, left and right... they all produce the same error...
on the bight side, all my indicator messages were hit... the trigger works, the variable to determine if it is open or closed works, and it can be triggered again after 2 seconds... the shutters simply dont seem to be able to move.
Anyone have any clue if I did something wrong in there? Or, as an alternative, another method to make brushes that both move on trigger, and are destructable.
The only other option I thought might be feasable is using the exploder system(which isnt as desireable I think for shotting out a wooden shutter) and since the exploder system uses sets and specific target names, that I dont see how I could target for momevent.
I guess I could cheat a bit by using shootable triggers that move along with the shutters, that trigger the hiding of the shutters... but thats definately not goign to have the same effect I think, plus its even more scripting and mapping.
Code: Select all
shutter1:
$latch1 waitTill trigger
iprintlnbold_noloc "latch1 triggered"
if (level.shutter1_open == 1)
{
iprintlnbold_noloc "shutters were open"
//$shutter_1a time 1
//$shutter_1b time 1
$shutter_1a moveLeft 24
$shutter_1b moveRight 24
$shutter_1a move
$shutter_1b move
//$shutter_1a playsound ...
//$shutter_1b playsound ...
level.shutter1_open = 0
wait 2
thread shutter1
}
else
{
iprintlnbold_noloc "shutters were closed"
//$shutter_1a time 1
//$shutter_1b time 1
$shutter_1a moveBackward 24
$shutter_1b moveForward 24
$shutter_1a move
$shutter_1b move
//$shutter_1a playsound ...
//$shutter_1b playsound ...
level.shutter1_open = 1
wait 2
thread shutter1
}
endCode: Select all
$shutter_1a moveForward 24 (maps/dm/dm_rail-station_beta.scr, 120)
$shutter_1a ^
^~^~^ Script Error: Failed execution of command 'moveforward' for class 'CrateObject' Targetname 'shutter_1a'
$shutter_1b moveBackward 24 (maps/dm/dm_rail-station_beta.scr, 121)
$shutter_1b ^
^~^~^ Script Error: Failed execution of command 'movebackward' for class 'CrateObject' Targetname 'shutter_1b'
$shutter_1a move (maps/dm/dm_rail-station_beta.scr, 122)
$shutter_1a ^
^~^~^ Script Error: Failed execution of command 'move' for class 'CrateObject' Targetname 'shutter_1a'
$shutter_1b move (maps/dm/dm_rail-station_beta.scr, 123)
$shutter_1b ^Anyone have any clue if I did something wrong in there? Or, as an alternative, another method to make brushes that both move on trigger, and are destructable.
The only other option I thought might be feasable is using the exploder system(which isnt as desireable I think for shotting out a wooden shutter) and since the exploder system uses sets and specific target names, that I dont see how I could target for momevent.
I guess I could cheat a bit by using shootable triggers that move along with the shutters, that trigger the hiding of the shutters... but thats definately not goign to have the same effect I think, plus its even more scripting and mapping.
When I am king, you will be first against the wall~


bind
They (CrateObjects) can't be moved by themselves, but they will move if they are attached to a moving object--like a script_origin. Place a script_origin in the center of each shutter and "bind" the shutters to them. Then move the script_origins in the script.
Btw, you can also bind them to script_objects, script_models, or any other movable object--even func_doors or func_rotatingdoors.
Btw, you can also bind them to script_objects, script_models, or any other movable object--even func_doors or func_rotatingdoors.
might be a stupid question here...
binding to a script origin i select the origin first, then the crate, then hit ctrl+k?
that produces a red line.
so far it doesnt look like its working with that method...
the target should be the crateobject correct?
does the origing have to be actualy within(touching) the crate?
binding to a script origin i select the origin first, then the crate, then hit ctrl+k?
that produces a red line.
so far it doesnt look like its working with that method...
the target should be the crateobject correct?
does the origing have to be actualy within(touching) the crate?
When I am king, you will be first against the wall~


K
You don't need to "target" the object. Binding is done in the script with targetnames.
$shutter1 bind $shutter1_origin
You can place that line under prespawn, or in a "shutter_prep" thread along with other lines that prepare the shutters to move--like travel times.
$shutter1 bind $shutter1_origin
You can place that line under prespawn, or in a "shutter_prep" thread along with other lines that prepare the shutters to move--like travel times.
Last edited by tltrude on Tue Jul 13, 2004 6:18 pm, edited 1 time in total.

