Jump to content
Come try out our new Arcade we just put up, new games added weekly. Link at the top of the website ×

need scripting help


Labob

Recommended Posts


  • Member ID:  42
  • Group:  *** Clan Members
  • Followers:  50
  • Topic Count:  338
  • Topics Per Day:  0.06
  • Content Count:  8265
  • Content Per Day:  1.54
  • Reputation:   5977
  • Achievement Points:  53618
  • Solved Content:  0
  • Days Won:  12
  • Joined:  09/01/09
  • Status:  Offline
  • Last Seen:  
  • Birthday:  01/30/1959
  • Device:  Windows

Hey Dawgy or anybody else who knows this better then me. I'm trying to run a script this one to be exact

 

}


tribute_enter()
{
  enter1 = getentarray ("tribute_enter","targetname");
  if ( isdefined(enter1) )
    for (i = 0; i < enter1.size; i++)
    enter1 thread tribute_enter_act();
}

tribute_enter_act()
{
  while (1)
  {
    self waittill ("trigger", player);
    player disableWeapon();
  }
}

tribute_exit()
{
  exit1 = getentarray ("tribute_exit","targetname");
  if ( isdefined(exit1) )
    for (i = 0; i < exit1.size; i++)
    exit1 thread tribute_exit_act();
}

tribute_exit_act()
{
  while (1)
  {
    self waittill ("trigger", player);
    player enableWeapon();
  }
}

 

I am running it on a waw map my problem is I can't sem to figure out what type of trigger to use. what i'm trying to do is have the weapons become inactive  when you enter the room and become active when you leave it. Any help would be sweeet thanks .

Link to comment
Share on other sites



  • Member ID:  2068
  • Group:  +++ COD5 Head Admin
  • Followers:  69
  • Topic Count:  1073
  • Topics Per Day:  0.22
  • Content Count:  8434
  • Content Per Day:  1.73
  • Reputation:   7291
  • Achievement Points:  74913
  • Solved Content:  0
  • Days Won:  64
  • Joined:  12/25/10
  • Status:  Offline
  • Last Seen:  
  • Birthday:  05/23/1973
  • Device:  Android

I don't know anything about map making but can a trigger be a specific XYZ plane in the map like a doorway?  Like I said, don't know, just thought I throw that out there.

Link to comment
Share on other sites



  • Member ID:  42
  • Group:  *** Clan Members
  • Followers:  50
  • Topic Count:  338
  • Topics Per Day:  0.06
  • Content Count:  8265
  • Content Per Day:  1.54
  • Reputation:   5977
  • Achievement Points:  53618
  • Solved Content:  0
  • Days Won:  12
  • Joined:  09/01/09
  • Status:  Offline
  • Last Seen:  
  • Birthday:  01/30/1959
  • Device:  Windows

Yea a trigger can be made into just about any shape. for this to work it would be 2 triggers one in a room and one on your way out . My problem is there are 5 or 6 different types of triggers damage , chain , AI , so on

Link to comment
Share on other sites



  • Member ID:  1540
  • Group:  **- Inactive Registered Users
  • Followers:  13
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  856
  • Content Per Day:  0.17
  • Reputation:   100
  • Achievement Points:  4812
  • Solved Content:  0
  • Days Won:  0
  • Joined:  06/28/10
  • Status:  Offline
  • Last Seen:  
  • Birthday:  09/20/1969

I dont know if this code would be of any use just something I seen but lost the page looking for a better example.

 

Also it looks like a volume trigger may work best, then you can just call isTouching

 

init(){ // handle disabled weapon check variable level thread onPlayerConnect(); level thread setupTrigger();}onPlayerConnect(){ while(1) { level waittill( "connected", player ); player thread onDeath(); player.weaponsDisabled = false; }}onDeath(){ self endon( "disconnect" ); while(1) { self waittill( "death" ); self.weaponsDisabled = false; }}setupTrigger(){ weapon_disable = getEnt( "weap_disable", "targetname" ); while(1) { weapon_disable waittill( "trigger", player ); if( player.pers["team"] == "allies" && !player.weaponsDisabled ) { player.weaponsDisabled = true; player thread disablePlayerWeapons( weapon_disable ); } }}disablePlayerWeapons( trigger ){ self endon( "disconnect" ); self endon( "death" ); self endon( "joined_spectator" ); self endon( "left_weapon_trigger" ); self iPrintLnBold( "Weapons disabled" ); self disableWeapons(); while(1) { if( !self isTouching( trigger ) ) { self iPrintLnBold( "Weapons enabled" ); self enableWeapons(); self.weaponsDisabled = false; self notify( "left_weapon_trigger" ); } wait 0.05; }}

Link to comment
Share on other sites



  • Member ID:  2068
  • Group:  +++ COD5 Head Admin
  • Followers:  69
  • Topic Count:  1073
  • Topics Per Day:  0.22
  • Content Count:  8434
  • Content Per Day:  1.73
  • Reputation:   7291
  • Achievement Points:  74913
  • Solved Content:  0
  • Days Won:  64
  • Joined:  12/25/10
  • Status:  Offline
  • Last Seen:  
  • Birthday:  05/23/1973
  • Device:  Android

I think Nutcutter may be on the right track.

For trigger type, can you use multiple and use the isTouching function so when the player is touching the space or room that is enclosed by the trigger, weapons will be disabled?

Link to comment
Share on other sites


  • 3 months later...

  • Member ID:  179
  • Group:  *** Clan Members
  • Followers:  27
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  1054
  • Content Per Day:  0.20
  • Reputation:   367
  • Achievement Points:  6817
  • Solved Content:  0
  • Days Won:  1
  • Joined:  09/02/09
  • Status:  Offline
  • Last Seen:  
  • Birthday:  12/07/1981
  • Device:  iPhone

Did u finger this out yet labob? Somehow I missed this thread...i did something like this for a bash room in one of my maps I could get them to loose all there ammo and nades by using trigger multiple over the entry.. Although the only way I could give it back was a trigger use/touch after leaving the room..

Link to comment
Share on other sites

Awards


  • Member ID:  179
  • Group:  *** Clan Members
  • Followers:  27
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  1054
  • Content Per Day:  0.20
  • Reputation:   367
  • Achievement Points:  6817
  • Solved Content:  0
  • Days Won:  1
  • Joined:  09/02/09
  • Status:  Offline
  • Last Seen:  
  • Birthday:  12/07/1981
  • Device:  iPhone

Oh and trigger multiples reset themselves... Like teleports...work every time

Link to comment
Share on other sites

Awards


  • Member ID:  179
  • Group:  *** Clan Members
  • Followers:  27
  • Topic Count:  96
  • Topics Per Day:  0.02
  • Content Count:  1054
  • Content Per Day:  0.20
  • Reputation:   367
  • Achievement Points:  6817
  • Solved Content:  0
  • Days Won:  1
  • Joined:  09/02/09
  • Status:  Offline
  • Last Seen:  
  • Birthday:  12/07/1981
  • Device:  iPhone

?#$%(??

Link to comment
Share on other sites

Awards

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.