Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 09-27-2007, 10:50 PM   #41
public_slots_free
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Can someone write me a LUA script that does this:

There is prop static on the map. Someone touches the prop static and then it shows a message to everyone

"Phrase that everyone sees" . The person then gets 1000 FF points and 10 Frag points. Then in order to stop people from just camping on the spot and getting points, i want it to have a delay of like 60 seconds where if you touch it in the 60 seconds, it wont work. That or it logs the person and that person cannot touch that prop static again. Can anyone help me?
public_slots_free is offline   Reply With Quote


Old 09-27-2007, 11:05 PM   #42
L0ki
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Haven't tested this myself, however it should restock all soldiers with 25 rockets every 60 seconds. Change the 2 varaibles at the top to change the restock interval and amount of rockets that are restocked:

Code:
-- Number of seconds between restocks
RESTOCK_INTERVAL = 60

-- Amount of rockets to restock every RESTOCK_INTERVAL seconds
RESTOCK_AMT_ROCKETS = 25

-- standard map startup function
function startup()
    -- Do other team and class limit setup here
    AddScheduleRepeating( "RestockPlayers", RESTOCK_INTERVAL, RestockPlayers )
end

-- function to perform the actual restock
function RestockPlayers()
    for i = 1, 32 do
        local player = CastToPlayer(GetEntity(i))
        if (player ~= nil) then
            if player:IsAlive() and (player:GetClass() == Player.kSoldier) then
                player:AddAmmo( Ammo.kRockets, RESTOCK_AMT_ROCKETS )
            end
        end
    end
end
L0ki is offline   Reply With Quote


Old 09-28-2007, 12:07 AM   #43
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
any particular place that should be in my lua? i tried it and it not only allowed a green team(set to -1, worked fine before) but it crashes FF.


EDIT: i appreciate your help man
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 09-28-2007, 12:24 AM   #44
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
got it work but now it cancels out my team and class restrictions
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 09-28-2007, 12:30 AM   #45
L0ki
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Sorry, I should have asked you beforehand, do you currently have a startup function in your lua file? If so, you'll need to do the following:
  1. Copy the AddSchedule line from the startup function I posted to your original startup function, placing it after any code to set team and class limits.
  2. Remove the startup function I posted from your lua file
  3. Place the 2 variables after any IncludeScript calls (which should be the first things in your lua file), but before any other functions.
  4. place the RestockPlayers function after the startup function
If it still doesn't work, I guess I don't know lua as well as i thought I did . Regardless, I'm going to try and get hammer working so I can actually test this stuff beforehand
L0ki is offline   Reply With Quote


Old 09-28-2007, 12:55 AM   #46
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
got it thanks man!!
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 10-01-2007, 01:38 PM   #47
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
i have a working lua and i want to add the soccerball and i want them(team) to gain points for holding the ball(not very fast though). like in murderball. what do i add into my lua?

i also want it to go back to its location after being dropped for 5 seconds.

anything else you need to know to do this let me know. thanks!
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 10-02-2007, 12:43 PM   #48
mervaka
A Very Sound Guy!
Fortress Forever Staff
 
mervaka's Avatar
 
Join Date: May 2005
Location: UK
Posts Rated Helpful 15 Times
you need a repeating schedule. when the schedule fires, points are given to the ball's current owner.
__________________
Support FF:
mervaka is offline   Reply With Quote


Old 10-02-2007, 12:50 PM   #49
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
um...i have no idea what you just said...lol..

i know nothing about LUA
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 10-02-2007, 10:12 PM   #50
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
Quote:
Originally Posted by GambiT
i have a working lua and i want to add the soccerball and i want them(team) to gain points for holding the ball(not very fast though). like in murderball. what do i add into my lua?

i also want it to go back to its location after being dropped for 5 seconds.

anything else you need to know to do this let me know. thanks!

__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 10-06-2007, 09:33 PM   #51
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
can somebody tell me what to add to my LUA to constantly give scouts and medics nades?
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 10-08-2007, 11:44 AM   #52
stino
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Quote:
Originally Posted by mervaka
i for one know a bit on lua coding. i'm free to hook people up with Lua if i've got time
i'm getting away with lua, so if you have something to script, i'll try to make it
stino is offline   Reply With Quote


Old 10-10-2007, 03:12 AM   #53
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
I don't really think this thread is a good place to ask for LUA related stuff. If I see a new posts in this thread at the list, I never know what they are about and usually don't bother checking. It's much easier to help people when the thread topic says what the question is about.

Speaking of which, we NEED a lua sub forum. The mapping forum is just too crowded. Oh right... please?

edit: ... even when you add the lua documentation wiki or whatever, people won't find all the answers from there.

Quote:
Originally Posted by GambiT
can somebody tell me what to add to my LUA to constantly give scouts and medics nades?
Download my ff_juggle_this map. It has the source VMF and LUA included and does exactly that.

Last edited by A1win; 10-11-2007 at 09:15 AM.
A1win is offline   Reply With Quote


Old 10-10-2007, 03:29 AM   #54
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
i agree we need a lua subforum...
__________________
-------------------------------FF_Rock2(WIP)------------------------------
---------------------------FF_RedGiant(Released)-------------------------
--------------------------FF_Fragzone_G(Released)------------------------
--------------------------FF_Civibash_G(Released)------------------------
-------------------FF_Conc_G1(WIP)--------------------
-------------------FF_Hollow_G(WIP)---------------------
GambiT is offline   Reply With Quote


Old 10-12-2007, 12:16 AM   #55
sir_frags
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Quote:
Originally Posted by A1win
Speaking of which, we NEED a lua sub forum. The mapping forum is just too crowded. Oh right... please?
.

Good luck with that. I asked for a "tutorial" section just last week in a PM to the forum leader and didn't get it. Lua help would have fit in just fine under a Tutorial subforum.

But regarding the crowding of the mapping section...the number of posts are dieing down quick. I haven't had to scroll past the first page in two days. And the new posts seem to all be about new maps anyway.
sir_frags is offline   Reply With Quote


Old 10-12-2007, 02:11 PM   #56
Mongoose
 
Join Date: Oct 2007
Posts Rated Helpful 0 Times
Any LUA knowledgable coders please PM me to help with a flagrun (warpath) style map with command points...

URGENT!
Mongoose is offline   Reply With Quote


Old 02-25-2008, 02:42 AM   #57
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.
Unstickied due to this thread. Make any lua requests there.
__________________
#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


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:55 AM.


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