Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 10-27-2013, 05:10 AM   #101
Dexter
internet user
Fortress Forever Staff
 
Dexter's Avatar
 
Join Date: Jun 2007
Posts Rated Helpful 42 Times
The code is right but it didnt fore until I set flags to "Everything" in hammer on the detpack_trigger, try that. it defaults to clients and a detpack isnt a client
__________________
9:17 PM - DEXTER: can you teach me how to play o
9:17 PM - squeek.: you jump a lot
9:18 PM - squeek.: and do sweet moves

8:55 PM - FDA: fart in you fridge and blame it on wild animals
Dexter is offline   Reply With Quote


1 members found this post helpful.
Old 10-28-2013, 03:03 AM   #102
Jay Mofo Mills
Jay|mOfO|Mills
Beta Tester
 
Join Date: Feb 2009
Location: Santa Fe, NM
Gametype: Snag the flag beotches
Posts Rated Helpful 8 Times
That did not fix my problem however this one little line did, not sure why....
renaming the function to something else and voila.... doesnt make sense to me but I dont know wtf I'm doing anyway.

Thanks for the help dex

detpack_easter_egg = detpack_trigger:new({})
Jay Mofo Mills is offline   Reply With Quote


Old 11-01-2013, 12:54 AM   #103
Dexter
internet user
Fortress Forever Staff
 
Dexter's Avatar
 
Join Date: Jun 2007
Posts Rated Helpful 42 Times
weird, i have no idea then, i have never had to set flags before either .. so maybe a conflict or halloween spoooky ghosts spooky
__________________
9:17 PM - DEXTER: can you teach me how to play o
9:17 PM - squeek.: you jump a lot
9:18 PM - squeek.: and do sweet moves

8:55 PM - FDA: fart in you fridge and blame it on wild animals
Dexter is offline   Reply With Quote


Old 11-06-2013, 07:08 PM   #104
Jay Mofo Mills
Jay|mOfO|Mills
Beta Tester
 
Join Date: Feb 2009
Location: Santa Fe, NM
Gametype: Snag the flag beotches
Posts Rated Helpful 8 Times
Gravity?

Hey peeps, Is there a way I can reset the gravity to normal on spawn? I have a special place in the map that triggers a low gravity change but if you die and respawn you keep the low gravity..... Can I put it in my player_spawn function? It will be easier than setting a trigger_gravity brush on every spawn in the map.
Jay Mofo Mills is offline   Reply With Quote


Old 11-06-2013, 11:05 PM   #105
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
Can do it all through Lua:

Code:
trigger_name = trigger_ff_script:new({})

function trigger_name:ontouch( touch_entity )
  if IsPlayer( touch_entity ) then
    local player = CastToPlayer( touch_entity )
    player:SetGravity( 0.5 ) -- number > 0 and <= 1
  end
end

function trigger_name:onendtouch( touch_entity )
  if IsPlayer( touch_entity ) then
    local player = CastToPlayer( touch_entity )
    player:SetGravity( 1 ) -- back to normal
  end
end

function player_spawn( player )
  player:SetGravity( 1 )
end
__________________
#FF.Pickup ¤ Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington
squeek. is offline   Reply With Quote


Old 05-09-2014, 08:06 PM   #106
ddm999
worst ff player eu
 
Join Date: Jun 2012
Location: South Yorks., England
Class/Position: o - no, d - scout
Gametype: IvDZ
Posts Rated Helpful 18 Times
Quote:
Any way to get the current map's name?
(if not plz add for next patch squeek kthxbye)

Attempting to make a system to rate maps, which I'll expand into a full map voting system.

( Also would really like to know if there's a nice and simple way of making a list short of just making a large table and annoying the hell out of all server admins by forcing them to be unable to copy-paste their old map lists. :P )
EDIT: Found it! host_map is a cvar that shows the current map file.

EDIT 2: NOPE. host_map is a client variable, that is set to 0 on the server. Therefore, Lua can't actually use it. Brilliant.
__________________
gg ff not ded
ff very much alive

Last edited by ddm999; 05-10-2014 at 06:09 PM. Reason: god damn it
ddm999 is offline   Reply With Quote


Old 05-09-2014, 08:28 PM   #107
KubeDawg
Nade Whore
Server Owner
Beta Tester
 
KubeDawg's Avatar
 
Join Date: Sep 2007
Location: Oklahoma
Class/Position: Scout/Soldier
Gametype: CTF/TDM
Affiliations: blunt. Moto
Posts Rated Helpful 128 Times
Please just make it where it won't stop you from switching weapons when you vote, but not make it like the current alternative where you must hit Escape to even see the vote.
__________________
Moto's Funhouse | Dallas, TX - 74.91.114.247:27015

ff_plunder - Complete
KubeDawg is offline   Reply With Quote


Old 05-10-2014, 03:38 PM   #108
ddm999
worst ff player eu
 
Join Date: Jun 2012
Location: South Yorks., England
Class/Position: o - no, d - scout
Gametype: IvDZ
Posts Rated Helpful 18 Times
Unfortunately Lua in FF has no access to actual keypresses, so the only real system I can use is the menu system in game.

( Which is the same as the one that mods use - the one that blocks weapon switching - if I remember correctly. :P )

I'll look into an alternative system where rather than using the menu system it uses chat messages. ( I'll probably introduce it with a custom HUD display, say, think of the voting system in Garry's Mod. - Except you can't click the buttons. D: )

Say for instance, you write:

!vote1
!vote2
!vote3

Potentially, the messages can be bound to keys ( say, numpad ) so that you can vote with a single keypress and it doesn't interrupt weapon switching.

I'll look into it further, but the current focus of my system is rating maps more than voting for the next map.
__________________
gg ff not ded
ff very much alive

Last edited by ddm999; 05-10-2014 at 06:08 PM.
ddm999 is offline   Reply With Quote


Old 05-10-2014, 05:34 PM   #109
KubeDawg
Nade Whore
Server Owner
Beta Tester
 
KubeDawg's Avatar
 
Join Date: Sep 2007
Location: Oklahoma
Class/Position: Scout/Soldier
Gametype: CTF/TDM
Affiliations: blunt. Moto
Posts Rated Helpful 128 Times
Look at CS:GO's vote system. I believe they have found a way to get around that whole mess.
__________________
Moto's Funhouse | Dallas, TX - 74.91.114.247:27015

ff_plunder - Complete
KubeDawg is offline   Reply With Quote


Old 05-10-2014, 06:06 PM   #110
ddm999
worst ff player eu
 
Join Date: Jun 2012
Location: South Yorks., England
Class/Position: o - no, d - scout
Gametype: IvDZ
Posts Rated Helpful 18 Times
The majority of Dota 2 and CS:GO uses Flash for HUD and menu elements.
If you dig around in the files, you'll notice that map overlays use Flash, the main menu is purely written in Flash, etc.

FF doesn't have this support.

Plus, that's Valve. Not like they completely wrote it from scratch in C++ or anything.
__________________
gg ff not ded
ff very much alive

Last edited by ddm999; 05-10-2014 at 06:07 PM.
ddm999 is offline   Reply With Quote


Old 09-29-2015, 05:10 AM   #111
[TALOS]Smoke
 
Join Date: Jul 2012
Location: Killeen, Tx, USA
Class/Position: Demo Defense
Gametype: Capture the Flag
Affiliations: [TALOS]
Posts Rated Helpful 3 Times
I have a trigger_ff_script that I need to only be *ahem* triggered by an emp. Here is what I have so far, not 100% sure it's correct

<quote>highvolt_trigger = trigger_ff_script:new({ team = Team.kUnassigned, team_name = "neutral" })

function highvolt_triggernexplode( explode_entity )
if grenade:Type() == Grenade.kEmp then
local grenade = CastToGrenade( explode_entity )

OpenDoor( self.team_name .. "_light_doorhack" )

end

return EVENT_ALLOWED
end

red_highvolt_trigger = highvolt_trigger:new({ team = Team.kBlue })
blue_highvolt_trigger = highvolt_trigger:new({ team = Team.kRed })</quote>

Last edited by [TALOS]Smoke; 09-29-2015 at 05:11 AM.
[TALOS]Smoke is offline   Reply With Quote


Old 09-29-2015, 08:29 AM   #112
squeek.
Stuff Do-er
Lua Team
Wiki Team
Fortress Forever Staff
 
squeek.'s Avatar
 
Join Date: Mar 2007
Location: Northern California
Class/Position: Rallygun Shooter
Gametype: Conc tag (you just wait)
Affiliations: Mustache Brigade
Posts Rated Helpful 352 Times
Send a message via AIM to squeek.
You mixed up the order of the if and the variable definition, and you might want to check that the cast succeeded. Those lines should be:

Code:
local grenade = CastToGrenade( explode_entity )
if grenade ~= nil and grenade:Type() == Grenade.kEmp then
The rest looks fine to me. Just make sure that you have "FF Grenades" checked in the trigger's flags in Hammer.
__________________
#FF.Pickup ¤ Fortress-Forever pickups

My Non-official Maps
Released FF_DM_Squeek - FF_2Mesa3_Classic - FF_Siege_Classic
Beta FF_Myth - FF_Redlight_Greenlight

Sick of the people on the internet, always moanin'. They just moan.
- Karl Pilkington
squeek. is offline   Reply With Quote


Old 10-03-2015, 05:01 PM   #113
[TALOS]Smoke
 
Join Date: Jul 2012
Location: Killeen, Tx, USA
Class/Position: Demo Defense
Gametype: Capture the Flag
Affiliations: [TALOS]
Posts Rated Helpful 3 Times
It's probably best for me to just explain what I have in mind and maybe one of ya'll nice people can write me a function for it?

Here is what I need: A trigger_ff_script, that is only triggered by an enemy emp, after being triggered it will open a doorhack which will disable some lights. To close out the function I also need it to have another trigger_ff_script that is very similar to dropdown in that it takes a few hits from the teams engineer with the spanner to restore.
I reworked the code from my previous post and I cannot seem to get it to work at all, so I'm giving up on it and asking for help.
[TALOS]Smoke is offline   Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:43 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.