G_scripting:trigger must have a name and an identifier


(Lock Ness Monster) #1

I did a search and i couldn’t find the answer im hunting for, im trying to make two objects that rotates when u press a button.
railing1_move
{
spawn
{
}
trigger move_down
{
wait 100
trigger move_down
}
trigger move_up
{
wait 100
trigger move_up
}
}
railing2_move
{
spawn
{
}
trigger move_down
{
wait 100
trigger move_down
}
trigger move_up
{
wait 100
trigger move_up
}
}
railing1
{
spawn
{
}
trigger move_down
{
wait 500
faceangles -90 0 0 8000
}
trigger move_up
{
wait 500
faceangles 0 0 0 8000
}
}

railing2
{
spawn
{
}
trigger move_down
{
wait 500
faceangles 90 0 0 8000
}
trigger move_up
{
wait 500
faceangles 0 0 0 8000
}
}

The whole error i got was

G_scripting:trigger must have a name and an identifier:move_down

I have a feeling that if i get this fixed ill get another error saying move_up also since i did the both the same way.

also the lay out of my items is

/button1
classname func_button
angle 90
target down

/button2
classname func_button
angle 270
target up

/target_script_trigger #1
scriptname railing1_move
targetname down
target move_down

/target_script_trigger #2
scriptname railing2_move
targetname down
target move_down

/target_script_trigger #3
scriptname railing1_move
targetname up
target move_up

/target_script_trigger #4
scriptname railing2_move
targetname up
target move_up

/railing #1
classname script_mover
scriptname railing1
spawnflags 2 (solid)

/railing #2
classname script_mover
scriptname railing2
spawnflags 2 (solid)

As youi can see, i want it them to rotate to teh down position when you press either button the first time and rotate back to the up position when u press either button again

What exactly am i doing wrong, probably alot since ive never done a thing like this before lol.


(zl1corvette) #2

when you are triggering a function of another entity you have to give that entities name :bash:


railing1_move
{
spawn
{
}
trigger move_down
{
wait 100
trigger railing1 move_down
}
trigger move_up
{
wait 100
trigger railing1 move_up
}
}
railing2_move
{
spawn
{
}
trigger move_down
{
wait 100
trigger railing2 move_down
}
trigger move_up
{
wait 100
trigger railing2 move_up
}
}
railing1
{
spawn
{
}
trigger move_down
{
wait 500
faceangles -90 0 0 8000
}
trigger move_up
{
wait 500
faceangles 0 0 0 8000
}
}

railing2
{
spawn
{
}
trigger move_down
{
wait 500
faceangles 90 0 0 8000
}
trigger move_up
{
wait 500
faceangles 0 0 0 8000
}
} 

(Lock Ness Monster) #3

well i didnt know that lol, thanks


(Ifurita) #4

Think of it as an address. When you mail a letter, you have to give city and address. Same thing for scripts. you have to give Script block railing2, railing1, the the sub address/routine e.g., move_dwon, move_up