Change targetname

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Change targetname

Post by agentmad007 »

Hi ,

How can i change the name of a trigger with the script? I know how is it called and i know the origin ? ( because i have 2 triggers with the same targetname and i want to erase only 1 of them )

And can someone tell me why i dont have my message print on the screen

Code: Select all


main:

............

thread ladder_info
thread text_info

ladder_info:


local.multiple = spawn trigger_multiple "targetname" "text_trigger" "setthread" "text_info"
local.multiple.origin = ( 1840 -3544 80 )
local.multiple setsize ( -80 -80 -80 ) ( 80 80 80 )



end 

text_info:

$text_trigger waittill trigger
$text_trigger triggerable ==> tried with and wothout without success
iprintIn "Wrong place"
end
TY
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I don't understand the 1st part of your question but for the latter simply remove this line

$text_trigger waittill trigger

8-)
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

In my map i have a switch+ trigger misplaced .With the script i spawned an another switch(WITH THE SAME TARGETNAME) in a safe place But the other one is still here.And i want to remove it.

problem if in the script i write :

Code: Select all

$my_switch_name remove
$my_trigger_name remove

It remove the bad one + the new that i added with the spawn script.
In other words , my question would be how to remove only the bad one, knowing that i know the origin + the targetname?

Ty
[/code]
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

how about removeing the old one before you spawn the new one .
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

with radiant , would need a huge compile then !

with script if i remove the old one , that have the same targetname as my new one , it remove both !
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

script

Post by tltrude »

Remove both triggers with the script and then spawn a new one, with the script, using the origin--that is the only way to do it. We can help you with it if you give us the origin point, the size of the trigger brush (xyz in radiant), and what type trigger it is.

For the message you have spelled the command wrong--it should be "iprintln" ( I P R I N T L N ). You can also use "iprintlnbold_noloc".
Tom Trude,

Image
strafer
Captain
Posts: 237
Joined: Sat Jan 31, 2004 11:29 pm
Location: The Motherland..
Contact:

Post by strafer »

For the message you have spelled the command wrong--it should be "iprintln" ( I P R I N T L N ). You can also use "iprintlnbold_noloc".
What is iprintlnbold_noloc? I never heard of that one before. When i saw it on this post I tried it out and it was just like iprintlnbold.
Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

thx tom , wasn't sure if it was a I or a L ;)

For the switch , its for a liberation map (moh breakthrough), then the targetname have to be axisjailtrigger for the trigger and axisjailswitch for the switch .

Adding a cmd remove with the script and spawn a new one with the same targetname will do nothing .

But why not giving a try maybe i m wrong.

old switch to remove :

Code: Select all


key/value 

targetname/axisjailswitch


old trigger_use to remove

Code: Select all


k/v

targetname/axisjailtrigger

new switch to add

Code: Select all


k/v 

targetname/axisjailswitch
angle: 0 270 0
origin: 2488.09 -3665.62 300

new trigger to add

Code: Select all

k/v
targetname/axisjailtrigger
origin: 2488.09 -3665.62 300
in my script for setsize i setted ( -10 -10 -10 ) ( 10 10 10 ) and it work fine so no problem
Finally , i just want my new switch to stay on game .

thx
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

classnames

Post by tltrude »

Why do you want the switch removed? Just move it to the new location.

$axisjailswitch.origin = ( 2488.09 -3665.62 300 )
$axisjailswitch.angles = ( 0 270 0 )

$axisjailtrigger delete

local.trigger spawn trigger_use targetname "axisjailtrigger"
local.trigger.origin = ( 2488.09 -3665.62 300 )
local.trigger setsize ( -10 -10 -10 ) ( 10 10 10 )

I would need to know the tiki name (classname) of the switch to spawn one.
Tom Trude,

Image
agentmad007
Brigadier General
Posts: 570
Joined: Tue Feb 24, 2004 3:52 pm

Post by agentmad007 »

thx tom
Post Reply