trigger wont trigger

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

trigger wont trigger

Post by Master-Of-Fungus-Foo-D »

My trigger_multiple jsut wont trigger! Im making a thing where you hit a tirgger, the bomb attatches to the buys head nad he goes and runs int oa dude and he explodes and gets a lot of kills...

well heres the script..(updated)

Code: Select all

suicide_bomber:
local.suicidestat = spawn animate/pulse_explosive_pickup.tik
local.suicidestat.origin = (  )
local.suicidestat.angles = (  )
local.suicidestat.scale = 5
//local.suicidestat rotatey 90   }\
//local.suicidestat rotatex 120 } problematic... edited out
//local.suicidestat rotatez 70   }/
///////////////////////////////////////////////////////////
local.suicidestatlight = spawn fx/dummy.tik 
local.suicidestatlight.origin = local.suicidestat.origin
local.suicidestatlight light 1 1 0 500
local.suicidestatlight lighton
////////////////////////////////////////////////////////
local.suicidetrigga = spawn trigger_use
local.suicidetrigga.origin = local.suicidestat.origin
local.suicidetrigga setsize ( 100 100 100 ) ( -100 -100 -100 )
local.suicidetrigga setthread suicide_playa
end 
//////////////////////////////////////////////////////////////////


suicide_playa:
/////////////////////////////////////////////////////
local.bomberhead = parm.other
local.bomberhead.targetname = bomberhead
//////////////////////////////////////////////////////////
if (local.bomberhead.suicideon != 1) 
{ 
local.bomberhead.suicideon = 1 
local.static = spawn script_model 
local.static model "items/explosive.tik" 
local.static notsolid 
local.static.scale= 3 
local.static.origin = (local.player.origin + ( 0 0 96 ))  
local.static glue local.bomberhead
if ( local.bomberhead.dmteam == allies )
{
local.bomberhead stufftext "say ********WE'VE GOT ANOTHER ALLIED BOMBERHEAD ON THE LOOSE***********!!!! " 
}
if ( local.bomberhead.dmteam == axis )
{
local.bomberhead stufftext "say ********WE'VE GOT ANOTHER AXIS BOMBERHEAD ON THE LOOSE***********!!!! " 
}
////////////////////////////////////////////////////////////////////
local.locotrig = spawn trigger_multiple
local.locotrig.origin = local.bomberhead.origin
local.locotrig setsize ( 82 82 82 ) ( -82 -82 -82 )
local.locotrig setthread killradius
////////////////////////////////////////////////////////////////
while( local.bomberhead.health == 0 )
 {
 local.bomberhead.suicideon = 0 
 local.static remove
 local.locotrig remove
 }
end
}
////////////////////////////////////////////////////////////////////
killradius:
if (parm.other.dmteam != $bomberhead.dmteam ) 
{
local.blastrigger = spawn trigger_multiple
local.blastrigger.origin = $bomberhead.origin
local.blastrigger setsize ( 1000 1000 1000 ) ( -1000 -1000 -1000 )
local.blastrigger volumedamage 10000
}
end
////////////////////////////////////////////////////////////////
ok.. the $Sstat spawns ok...
the light... yes it wokrs
but the suicide trigger doesnt seem to go off... could you tell me why?
my thread suicide_bomber is after prespawn
PS to all you eople annoyed at me:
ill shuttap ok?
im just about as stupid as the guy in my avatar looks :P
Last edited by Master-Of-Fungus-Foo-D on Mon Mar 07, 2005 12:48 pm, edited 4 times in total.
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
User avatar
MPowell1944
Moderator
Posts: 287
Joined: Thu Jan 09, 2003 7:06 am
Location: Woodstock, GA
Contact:

Post by MPowell1944 »

local.static.origin = (local.bomberhead.origin + ( 0 0 96 ) )

should be

local.static.origin = local.bomberhead.origin + ( 0 0 96 )

***

local.blastrigger.origin = ( $bomberhead.origin )

should be

local.blastrigger.origin = $bomberhead.origin
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

k thx... i ll try thaat now :)
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

nope.. i get the same effect as before.. nothin...
is that while loop ok? ive never really used while before :S

i open up devcon and there arent any errors....
**edit**ive updated the script**/edit**
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

local.suicidetrigga.origin = local.suicide_stat_1.origin

shouldn't it's origin = local.suicidestat.origin ? where did the _1 come from?
An ambiguous question will get a similar answer...
User avatar
wacko
Field Marshal
Posts: 2085
Joined: Fri Jul 05, 2002 8:42 pm
Location: Germany

Post by wacko »

?tleast

Code: Select all

local.blastriggersetsize
is a typo.
You could add lines of

Code: Select all

iprintln_noloc "Script is now in thread xy"
to see more of what it does
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

ive updated the code and im testing with the correctins.. thx guys :)
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

1. I don't think giving players targetnames is a good idea, especially when you don't use them at all.
2. Glueing the bomb to the player will make it appear at his feet. Use bind or attach instead.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

so im assuming you can bind/attatch objects to players heads,arm ect...?
Image
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

could i attatch it using the player's eyebone?
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

I think so.
Game classes reference wrote:attach( Entity parent, String tagname, [ Integer use_angles ] )

attach this entity to the parent's legs tag called tagname
So, you could use it like this:

Code: Select all

$entity attach local.player "eyes bone"
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Grassy
First Lieutenant
Posts: 221
Joined: Sun Aug 22, 2004 11:36 am

Post by Grassy »

Here's a list of body parts for you :)

//------------------------
Human body parts
//------------------------
Bip01 L Hand
Bip01 R Hand

Bip01 L Forearm
Bip01 R Forearm

Bip01 L UpperArm
Bip01 R UpperArm

Bip01 L Clavicle
Bip01 R Clavicle

Bip01 Head

Bip01 Spine
Bip01 Spine2

Bip01 Pelvis

Bip01 L Thigh
Bip01 R Thigh

Bip01 L Calf
Bip01 R Calf

Bip01 L Foot
Bip01 R Foot

Grassy

** Edit **

Here is one way of attaching something to a certain spot on a player that I use.

local.mover = spawn script_model model "fx/dummy.tik"
local.mover.origin = ( local.player gettagposition "Bip01 Head")
local.mover.angles = local.player.angles
local.mover notsolid
local.mover targetname "spot"
$spot attach local.player "Bip01 Head"
An ambiguous question will get a similar answer...
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

That's exactly what I meant, Grassy, thanks for an example. ;)
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Master-Of-Fungus-Foo-D
Muffin Man
Posts: 1544
Joined: Tue Jan 27, 2004 12:33 am
Location: cali, United States

Post by Master-Of-Fungus-Foo-D »

after this long time i fanally figure out thr problem... the setsize needs to be:

Code: Select all

(-### -### -###) (+### +### +###)
lol...
oh and whoever made the game code, cant spell attatch :wink:
Image
The Fungus Theme song!!!

Code: Select all

while (local.player istouching self)
Post Reply