Fortress Forever

Go Back   Fortress Forever > Editing > Mapping > Lua

Reply
 
Thread Tools Display Modes
Old 07-01-2009, 07:38 PM   #41
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
I removed it and that map still doesn't seem to work.
DudeWheresMyMedic is offline   Reply With Quote


Old 07-01-2009, 07:39 PM   #42
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.
Quote:
Originally Posted by DudeWheresMyMedic View Post
I removed it and that map still doesn't seem to work.
Then paste the console error(s) again.
__________________
#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 07-01-2009, 07:41 PM   #43
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
execing config.cfg
Can't use cheat cvar dsp_dist_max in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar dsp_dist_min in multiplayer, unless the server has sv_cheats set to 1.
Can't use cheat cvar r_ambientfraction in multiplayer, unless the server has sv_cheats set to 1.
2 CPUs, Frequency: 3.0 Ghz, Features: GenuineIntel SSE SSE2 MMX RDTSC CMOV FCMOV
Client/Server up to date
execing valve.rc
maxplayers set to 4
Unknown command "cr_civilian"
maxplayers set to 4
Network: IP 98.231.201.74, mode MP, dedicated No, ports 27015 SV / 27005 CL
Spawn Server koth_classic
Begin loading faces (loads materials)
End loading faces (loads materials)
[SCRIPT] Attempting to start up the entity system...
[SCRIPT] Entity system initialization successful.
[SCRIPT] Loading Lua File: maps/includes/base.lua
[SCRIPT] Successfully loaded maps/includes/base.lua
[SCRIPT] Loading Lua File: maps\koth_classic.lua
Error loading maps\koth_classic.lua: [string "maps\koth_classic.lua"]:300: ')' expected near 'fullresupply'
[EntSys] Entity System Helper Spawned
Executing listen server config file
SENTENCEG_Init: precached scripts/sentences.txt
SENTENCEG_Init: precached scripts/sentences_common.txt
SV_StartSound: npc/headcrab/headcrab_burning_loop2.wav not precached (0)
SV_StartSound: ambient/fire/fire_small_loop2.wav not precached (0)
player/demoman/demoman.mdl/player/ff_player_shared.mdl : missmatched parent bones on "ffSkel_Hips"
player/medic/medic.mdl/player/ff_player_shared.mdl : missmatched parent bones on "ffSkel_Hips"
player/hwguy/hwguy.mdl/player/ff_player_shared.mdl : missmatched parent bones on "ffSkel_Hips"
player/pyro/pyro.mdl/player/ff_player_shared.mdl : missmatched parent bones on "ffSkel_Hips"
SV_StartSound: npc/headcrab/headcrab_burning_loop2.wav not precached (0)
SV_StartSound: ambient/fire/fire_small_loop2.wav not precached (0)
SV_StartSound: npc/headcrab/headcrab_burning_loop2.wav not precached (0)
SV_StartSound: ambient/fire/fire_small_loop2.wav not precached (0)
Attempted to create unknown entity type info_tfdetect!
Can't init info_tfdetect
couldn't exec listenserver.cfg
couldn't exec koth_classic.cfg
Section [Scenes]: 1096 resources total 17.54 KB, 0.84 % of limit (2.10 MB)
-------------- Omni-bot Init ----------------
Omni-bot Loading: LoadLibrary Failed with Error: The specified module could not be found.
Omni-bot Loading: Looking for omni-bot\omnibot_ff.dll,
Omni-bot Loading: LoadLibrary Failed with Error: The specified module could not be found.
Omni-bot Loading: Looking for .\omni-bot\omnibot_ff.dll,
Omni-bot Loading: LoadLibrary Failed with Error: The specified module could not be found.
Omni-bot Loading: Looking for omnibot_ff.dll,
---------------------------------------------
4 player server started
Adding master server 69.28.140.247:27011
Adding master server 68.142.72.250:27011
Client "[TALOS]DudeWheresMyMedic" connected (127.0.0.1:27005).
Connected to 127.0.0.1:27015
[VERSION] Server: 2.3
DudeWheresMyMedic is offline   Reply With Quote


Old 07-01-2009, 08:18 PM   #44
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
Bridget: whitespace doesn't matter.

Quote:
Originally Posted by DudeWheresMyMedic View Post
-----------------------------------------------------------------------------
-- Quad area
-- The area where the player is supposed to be holding
-----------------------------------------------------------------------------

quadarea = trigger_ff_script:new({ })

-- on touch, give quad
function quadareantouch( trigger_entity )
if ( IsPlayer( trigger_entity ) ) then
local player = CastToPlayer( trigger_entity )

-- add to the quad collection
quad_collection:AddItem( player )
-- if resupplying is on, add schedule
if RESUPPLY_IN_ZONE then
AddSchedule("resupply_zone-"..player:GetId(), RESUPPLY_DELAY, fullresupply, player)
end
if RELOAD_CLIPS then
AddSchedule("reload_zone-"..player:GetId(), 5, fullreload, player)
end
end
end
There was a comma missing there.

But I see some other problems.

Quote:
-----------------------------------------------------------------------------
-- Damage event - Add Quad Damage
-----------------------------------------------------------------------------
function player_ondamage( player, damageinfo )

if not damageinfo then return end

-- Entity that is attacking
local attacker = damageinfo:GetAttacker()

-- If no attacker do nothing
if not attacker then return end

-- If attacker is a player
if IsPlayer(attacker) then
local playerAttacker = CastToPlayer(attacker)

-- If player is damaging self do nothing
if player:GetId() == playerAttacker:GetId() then return end

-- If the attacker isn't on the quad area do nothing
if not quad_collection:HasItem( playerAttacker ) then return end

-- if on the defending team
if playerAttacker:GetTeamId() == command_points[1].defending_team then

-- If all conditions are true, increase player's damage to 400% - Quad Damage
damageInfo:SetDamage(damageinfo:GetDamage() * DAMAGE_BONUS)
end
end

end
-- Fully resupply's the player's ammo
function fullresupply( player )
-- if on the defending team
if player:GetTeamId() == command_points[1].defending_team then

player:AddAmmo( Ammo.kNails, 300 )
player:AddAmmo( Ammo.kShells, 300 )
player:AddAmmo( Ammo.kRockets, 300 )
player:AddAmmo( Ammo.kCells, 300 )
end
end

-- Fully reload all weapons of a player
function fullreload( player )
-- if on the defending team
if player:GetTeamId() == command_points[1].defending_team then

ApplyToPlayer( player, { AT.kReloadClips } )
end
end
I assumed you were still including the command point lua, and that players had to have control of the hill to get quad. If that's not true, remove the stuff in bold.

You also have player_ondamage defined twice, and maybe some other stuff too. If you define something twice, only the last one will have any effect. If you want functionality from both, you have to combine them into one. This is a danger when you copy-paste code.
Crazycarl is offline   Reply With Quote


Old 07-01-2009, 08:25 PM   #45
Dr.Satan
Wiki Team
Fortress Forever Staff
 
Dr.Satan's Avatar
 
Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly
Gametype: PAYLOAD
Affiliations: DET-
Posts Rated Helpful 19 Times
lol...nevermind, carl beat me again
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf
(Beta) alchimy_b1
(Lua) base_payload_2015
(Models) props_trainyard
Support FF:
Dr.Satan is offline   Reply With Quote


Old 07-01-2009, 08:26 PM   #46
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
Good God Carzycarl that was mad skill, I didn't know how the lua was so exact that one comma missing cause the whole map to fail. the map is playable now and after I do this pickup going to get my friend and we will test it. Thank you.
DudeWheresMyMedic is offline   Reply With Quote


Old 07-01-2009, 08:38 PM   #47
Crazycarl
D&A Member
Wiki Team
Fortress Forever Staff
 
Crazycarl's Avatar
 
Join Date: Apr 2007
Posts Rated Helpful 31 Times
Commas are very important to computers. In the future, if you forget to use a comma, robots will crush you.
Crazycarl is offline   Reply With Quote


Old 07-01-2009, 09:02 PM   #48
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
LoL, ok. Bad news quad damage doesn't work, rocket jump hurts, fall damage hurt, I'm thinking of droping this LUA its not working together well.
DudeWheresMyMedic is offline   Reply With Quote


Old 07-01-2009, 10:32 PM   #49
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.
Post your current lua (use [code][/code] tags or www.privatepaste.com).

Making a new gametype requires work. All the stuff you're asking for is possible, it's just that you have to help us so that we can help you. Everytime you have a problem, make sure to post your lua and any [SCRIPT] error messages the console gives you and we will be able to help you. Otherwise, there's no hope.
__________________
#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

Last edited by squeek.; 07-01-2009 at 10:32 PM.
squeek. is offline   Reply With Quote


Old 07-01-2009, 10:39 PM   #50
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
http://www.privatepaste.com/a90QLbpob5
DudeWheresMyMedic is offline   Reply With Quote


Old 07-01-2009, 11:54 PM   #51
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.
Replace the top player_ondamage function with:
Code:
function player_ondamage( player, damageinfo )
	
	-- Entity that is attacking
  	local attacker = damageinfo:GetAttacker()
	
	-- shock is the damage type used for the trigger_hurts in this map. Must be allowed to kill players :)
	if damageinfo:GetDamageType() == Damage.kShock then
		return EVENT_ALLOWED
	end

  	-- If no attacker do nothing
  	if not attacker then 
		damageinfo:SetDamage(0)
		return
  	end

  	-- If attacker not a player do nothing
  	if not IsPlayer(attacker) then 
	 	damageinfo:SetDamage(0)
		return
  	end
  
  	local playerAttacker = CastToPlayer(attacker)

 	-- If player is damaging self do nothing
  	if (player:GetId() == playerAttacker:GetId()) or (player:GetTeamId() == playerAttacker:GetTeamId()) then
		damageinfo:SetDamage(0)
		return 
  	end
	
	-- If the attacker is in the quad area, give quad damage
	if quad_collection:HasItem( playerAttacker ) then 
		damageinfo:SetDamage(damageinfo:GetDamage() * DAMAGE_BONUS)
	end
	
end
and delete the bottom player_ondamage function, the one under this:
Code:
-----------------------------------------------------------------------------
-- Damage event - Add Quad Damage
-----------------------------------------------------------------------------
__________________
#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 07-02-2009, 03:41 AM   #52
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
Okay nice, the rocket damage works and no fall damage as well, but the QUAD damage seem to be on and not when someones on the trigger.
DudeWheresMyMedic is offline   Reply With Quote


Old 07-02-2009, 04:01 PM   #53
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
http://www.privatepaste.com/8eBDvnDwIt
DudeWheresMyMedic is offline   Reply With Quote


Old 07-02-2009, 09:03 PM   #54
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.
Any errors in the console when you step into the trigger?

EDIT: It doesn't look like you did what I said. You can only have ONE player_ondamage in a lua, otherwise one will get overwritten by the other.

Here's the correctly modified lua:
http://www.privatepaste.com/d30VquPOJd

(Make sure to click "Copy content" to get the plain text instead of the text and line numbers).
__________________
#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

Last edited by squeek.; 07-02-2009 at 09:06 PM.
squeek. is offline   Reply With Quote


Old 07-04-2009, 11:26 AM   #55
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
Okay, you want me to post the console error? from every test? The Quad Damage still on for all without touching the trigger.
DudeWheresMyMedic is offline   Reply With Quote


Old 07-04-2009, 04:52 PM   #56
Dr.Satan
Wiki Team
Fortress Forever Staff
 
Dr.Satan's Avatar
 
Join Date: Sep 2007
Location: Greeley, CO
Class/Position: Med / Solly
Gametype: PAYLOAD
Affiliations: DET-
Posts Rated Helpful 19 Times
nah just post one, if there is an error, we should be able to find it from any console log

Edit: Also please copy and paste the .lua your currently running, even if it's in an earlier post...just go ahead and copy it all and paste it at private paste again just so we can look through it. You might have copied something wrong and not even know it. Or missed something or something.
__________________
(Released) conc_school | hellion_classic | ksour_PAYLOAD | mulch_faf
(Beta) alchimy_b1
(Lua) base_payload_2015
(Models) props_trainyard
Support FF:

Last edited by Dr.Satan; 07-04-2009 at 04:54 PM.
Dr.Satan is offline   Reply With Quote


Old 07-06-2009, 12:12 PM   #57
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
http://www.privatepaste.com/0b0qCWEcC1
DudeWheresMyMedic is offline   Reply With Quote


Old 07-06-2009, 10:36 PM   #58
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
[SCRIPT] Error calling oninactive ([string "maps\koth_classic.lua"]:291: attempt to index global 'zone_collection' (a nil value)) ent: quadarea
[SCRIPT] Error calling onendtouch ([string "maps\koth_classic.lua"]:277: attempt to index global 'zone_collection' (a nil value)) ent: quadarea
DudeWheresMyMedic is offline   Reply With Quote


Old 07-06-2009, 10:39 PM   #59
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.
That's what I get for copy+pasting and not using my brain.

Fixed version:
http://www.privatepaste.com/980UPcqFhz
__________________
#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 07-06-2009, 11:40 PM   #60
DudeWheresMyMedic
 
DudeWheresMyMedic's Avatar
 
Join Date: Jan 2009
Posts Rated Helpful 0 Times
LoL, I'll test this after pickup. Thanks for your time.
DudeWheresMyMedic is offline   Reply With Quote


Reply


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

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 12:15 AM.


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