Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 09-24-2007, 12:26 AM   #21
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
2 dolla
__________________
-------------------------------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-25-2007, 07:09 AM   #22
shadow
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
So, how does one go about making a bag which only gives concs (and not, say, mirvs)?
shadow is offline   Reply With Quote


Old 09-26-2007, 05:33 PM   #23
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
is it possible to make it where rockets dont explode or dissappear unless they hit the player?

it would be very nice for a map i have ready.
__________________
-------------------------------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-26-2007, 05:49 PM   #24
[P]Infidel
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Quote:
Originally Posted by shadow
So, how does one go about making a bag which only gives concs (and not, say, mirvs)?
Code:
-----------------------------------------------------------------------------
-- concpack -- give gren2s to scout/medic only (backpack-based)
-----------------------------------------------------------------------------
concpack = genericbackpack:new({
	gren2 = 4,
	model = "models/items/backpack/backpack.mdl",
	materializesound = "Item.Materialize",
	touchsound = "Backpack.Touch",
	botgoaltype = Bot.kBackPack_Grenades
})

function concpack:dropatspawn() return false end

function concpack:touch(touch_entity)
	if IsPlayer(touch_entity) then
		local player = CastToPlayer(touch_entity)
		local class = player:GetClass()
		if class == Player.kScout or class == Player.kMedic then
			genericbackpack.touch(self, touch_entity)
		end
	end
end

blue_concpack = concpack:new({touchflags = AllowFlags.kOnlyPlayers,AllowFlags.kBlue})
red_concpack = concpack:new({touchflags = AllowFlags.kOnlyPlayers,AllowFlags.kRed})
yellow_concpack = concpack:new({touchflags = AllowFlags.kOnlyPlayers,AllowFlags.kYellow})
green_concpack = concpack:new({touchflags = AllowFlags.kOnlyPlayers,AllowFlags.kGreen})
This just hooks into the regular genericbackpack but adds the conditional touch, in this case checking for class.

Adjust the gren2 = 4 value if you don't want to give full concs. You could add the other health/ammo types in as well if desired.

Just place your info_ff_script as "concpack" or "team_concpack".
[P]Infidel is offline   Reply With Quote


Old 09-26-2007, 07:07 PM   #25
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
is it possible to make it where rockets dont explode or dissappear unless they hit the player?

it would be very nice for a map i have ready.

anybody gonna take this challenge? come'on where's the hard core coders at?

to give you better insight on what im trying to do is i dont want civi's taking damage from the rocket blast near him i only want him to get damage if he is directly hit with the rocket.
__________________
-------------------------------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-26-2007, 07:49 PM   #26
[P]Infidel
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Quote:
Originally Posted by GambiT
anybody gonna take this challenge?
When they fix the Damage methods. GetDamageType, SetDamage, etc. seem to be missing the implied self-reference in the linking necessary to make the calls. SetDamage is linked to (number) when it needs (Damage, number) and so on.
[P]Infidel is offline   Reply With Quote


Old 09-26-2007, 08:07 PM   #27
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 way around it?

like not blowing up on walls/floors are some kind of brush entity?
__________________
-------------------------------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-26-2007, 08:30 PM   #28
A1win
Nutcracker
 
A1win's Avatar
 
Join Date: Sep 2007
Location: Kuopio, Finland
Posts Rated Helpful 0 Times
Send a message via MSN to A1win
Quote:
Originally Posted by GambiT
any way around it?

like not blowing up on walls/floors are some kind of brush entity?
Make a 1-4 (or so) unit thick trigger_remove in front of every wall named "remover" and check the "Everything" flag for it. Then add this LUA code:

Code:
remover = trigger_ff_script:new({ })

function remover:allowed( allowed_entity )
	if IsPlayer(allowed_entity) or IsDispenser(allowed_entity) or IsSentrygun(allowed_entity) then
		return EVENT_DISALLOWED
	end
	return EVENT_ALLOWED
end
This removes all rockets, grenades, pipes etc. I'm not sure if you can specify it to only remove rockets but I guess it doesn't matter?

If you don't add the lua code and walk through it, the server crashes when it tries to remove the player entity Also I think if it removes a sentry gun or a dispenser, it can't probably be created again as it isn't "killed", but "removed". I tested this in my map and the remover didn't remove my info_ff_script flag entity even though I didn't disallow it for the trigger_remover.

Side note: Why can't we have seperate LUA forum and Mapping forum so we don't need to spend hours when we try to find posts from the mapping forum?
A1win is offline   Reply With Quote


Old 09-26-2007, 08:50 PM   #29
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
sweet i'll try it. as long as it removes rockets and allows players it'll work.

its only soldiers and civis. civis get points the longer they stay alive and red and blue(sollys) get points for kills. yellow has to dodge rockets.

the tfc version was fun but ppl started shooting the walls/ceiling and floor instead of direct hit like i wanted it to be.

thanks man i'll add it to the lua this evening and let you know if it works.
__________________
-------------------------------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-26-2007, 10:54 PM   #30
shadow
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Thanks! I wasn't using a local variable to get the player class. Instead I had a player.GetClass() as the conditional.

Anyone know a way to do this?
http://www.fortress-forever.com/foru...ad.php?t=11748

Or even simpler, anyone know how to make a clipping brush while only blocks thrown flags? (ie, makes them bouce off or something..)

Any additional help would be greatly appreciated, since it will allow me to finally release this map.
shadow is offline   Reply With Quote


Old 09-26-2007, 10:57 PM   #31
nodnarb
 
Join Date: Mar 2007
Posts Rated Helpful 5 Times
Quote:
Originally Posted by shadow
Or even simpler, anyone know how to make a clipping brush while only blocks thrown flags? (ie, makes them bouce off or something..)
Do players need to go through it?
nodnarb is offline   Reply With Quote


Old 09-26-2007, 11:44 PM   #32
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 A1win
Make a 1-4 (or so) unit thick trigger_remove in front of every wall named "remover" and check the "Everything" flag for it. Then add this LUA code:

Code:
remover = trigger_ff_script:new({ })

function remover:allowed( allowed_entity )
	if IsPlayer(allowed_entity) or IsDispenser(allowed_entity) or IsSentrygun(allowed_entity) then
		return EVENT_DISALLOWED
	end
	return EVENT_ALLOWED
end
This removes all rockets, grenades, pipes etc. I'm not sure if you can specify it to only remove rockets but I guess it doesn't matter?

If you don't add the lua code and walk through it, the server crashes when it tries to remove the player entity Also I think if it removes a sentry gun or a dispenser, it can't probably be created again as it isn't "killed", but "removed". I tested this in my map and the remover didn't remove my info_ff_script flag entity even though I didn't disallow it for the trigger_remover.

Side note: Why can't we have seperate LUA forum and Mapping forum so we don't need to spend hours when we try to find posts from the mapping forum?

DUDE!!! works perfect! thanks a shit load 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-26-2007, 11:54 PM   #33
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'm trying to get a steady resupply of rockets for the soldiers is this correct?

Code:
function RestockPlayer(player_entity, eventName)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        player:AddAmmo(Ammo.kRockets, 400)
    else
        RemoveSchedule(eventName)
    end
end
__________________
-------------------------------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-26-2007, 11:56 PM   #34
shadow
Retired FF Staff
 
Join Date: Mar 2007
Posts Rated Helpful 0 Times
Quote:
Originally Posted by nodnarb
Do players need to go through it?
Yes, it must block only flags.

Let me explain explicitly:
I am finishing up the remake of congestus, and one of the centerpieces of this map is the large air jet in the flagroom.

There is a beta version which I leaked last week floating around (with the suffix _beta) which has several key differences from the final version I have on my hard drive now, including bug fixes and visual/aesthetic improvements.

The single largest problem occurs when a player throws the flag into the air jet. In TFC, the flag would float up and be within the grasp of any respectable offender (or more likely it would just slowly float off of the air jet as it bounced up and down). In the FF version however, the flag sinks right to the bottom and is exceedingly difficult to reach against any competent defender.

Now, there are two solutions:
1.) Implement a trigger_push-like entity in the LUA which affects only the red and blue flags and overlay the new entity on the existing trigger_push. Mulchman offered a hypothetical solution to this problem, but I'm afraid I am not familiar enough with the LUA to actually code it in.
2.) Implement some clip brush which blocks only flags and use it to cover the surface of the air jet, effectively making it impossible to throw the flag into it. (it would just bounce off)

In my opinion, option two would be a much simpler solution to this obnoxious problem. Sorry if tl;dr.
shadow is offline   Reply With Quote


Old 09-27-2007, 12:37 AM   #35
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'm trying to get a steady resupply of rockets for the soldiers is this correct?

Code:
function RestockPlayer(player_entity, eventName)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        player:AddAmmo(Ammo.kRockets, 400)
    else
        RemoveSchedule(eventName)
    end
end
__________________
-------------------------------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-27-2007, 12:31 PM   #36
GambiT
Fortress Forever Staff
 
GambiT's Avatar
 
Join Date: Mar 2007
Location: Baton Rouge
Class/Position: Spy
Affiliations: -=DoM=-
Posts Rated Helpful 0 Times
come on....
__________________
-------------------------------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-27-2007, 12:46 PM   #37
mervaka
A Very Sound Guy!
Fortress Forever Staff
 
mervaka's Avatar
 
Join Date: May 2005
Location: UK
Posts Rated Helpful 15 Times
Quote:
Originally Posted by shadow
Yes, it must block only flags.

Let me explain explicitly:
I am finishing up the remake of congestus, and one of the centerpieces of this map is the large air jet in the flagroom.

There is a beta version which I leaked last week floating around (with the suffix _beta) which has several key differences from the final version I have on my hard drive now, including bug fixes and visual/aesthetic improvements.

The single largest problem occurs when a player throws the flag into the air jet. In TFC, the flag would float up and be within the grasp of any respectable offender (or more likely it would just slowly float off of the air jet as it bounced up and down). In the FF version however, the flag sinks right to the bottom and is exceedingly difficult to reach against any competent defender.

Now, there are two solutions:
1.) Implement a trigger_push-like entity in the LUA which affects only the red and blue flags and overlay the new entity on the existing trigger_push. Mulchman offered a hypothetical solution to this problem, but I'm afraid I am not familiar enough with the LUA to actually code it in.
2.) Implement some clip brush which blocks only flags and use it to cover the surface of the air jet, effectively making it impossible to throw the flag into it. (it would just bounce off)

In my opinion, option two would be a much simpler solution to this obnoxious problem. Sorry if tl;dr.
for 'push' type arrangements, check out cz2 (upward steam jets) and aardvark (horizontal push pads)
__________________
Support FF:
mervaka is offline   Reply With Quote


Old 09-27-2007, 09:26 PM   #38
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'm trying to get a steady resupply of rockets for the soldiers is this correct?

Code:
function RestockPlayer(player_entity, eventName)
    if IsPlayer(player_entity) then
        local player = CastToPlayer(player_entity)
        player:AddAmmo(Ammo.kRockets, 400)
    else
        RemoveSchedule(eventName)
    end
end

somebody please let me know whats wrong with this.
__________________
-------------------------------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-27-2007, 09:59 PM   #39
L0ki
 
Join Date: Sep 2007
Posts Rated Helpful 0 Times
Are you trying to restock an individual player when a certain event happens or do you want to restock all players every x seconds?
L0ki is offline   Reply With Quote


Old 09-27-2007, 10:09 PM   #40
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 would like to restock all soldiers(all teams) every second or so yes.


i know nothing about LUA and i pulled this part out of my sgwar LUA somebody made for me. i thought that is what was restocking the engys.
__________________
-------------------------------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


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 02:43 AM.


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