Lua Cheat Script Help

Have a question, suggestion, or comment about Aleph One's features and functionality (Lua, MML, the engine itself, etc)? Post such topics here.
Post Reply
Fenrir
Spazeroid
Posts: 5
Joined: Jan 24th '14, 22:20

Hi I recently downloaded a cheat script from http://simplici7y.com/items/cheats-advanced-v2 and found out that it will not work for me on any of the Marathon games even though I have it set to the solo script. If someone could look over it for me and, possibly tell me what's wrong, I would greatly appreciate it! Here is the script if you don't want to download it:

Code: Select all

--[[
Cheats advanced.lua  version:  2.7E   last revised:  20121127
The Original version was created by Treellama and is included in the Aleph One download
original 'cheats advanced' released on Simplici7y by Iamanidiot123
this revised version was by x13/puffindingo

to use, select this script as the solo script in the environment preferences.

when using this script:
	-M1A1 skips the PID intro. [currently dissabled, see variables section to use]
	-Player can jmp using microphone key
	-hard falls are audible
	-hard falls cause damage, including oxygen drain if landing in media.  Please note, that the falling damage will take away about 		60-70% of 1 energy bar for a fall equivalent to the vent shaft on M2:What About Bob?.  This feature has not been tested on 		3rd party maps.  The damage is calculated mathematically to increase semi-exponentially as the velocity increases.  Using 		the 'fly mode', I have been able to get damages of up to ~200 points [or higher] and ~90-100% of the oxygen bar.  This is 		an extreme case, it is typically less than 1/4 of the oxygen bar and 2/3rds of 1 energy bar.
	-for other capabilities, see the functions list below

to use script functions, press the console key and type the desired function, including parentheses
and any required parameters, then press the 'return' key.

Functions:
Oxygen:
	sigh()	toggle oxygen regeneration, enabled by default
	oxy()	toggle unlimited oxygen mode
	otwo()	fills the oxygen bar

energy:  please note that when invincibility modes are enabled, player can still suffocate
	heal()	toggle life regeneration/healing, enabled by default
	lich()	undead/0x shields mode [invincibility mode]
	god()	1x shields mode [invincibility mode]
	fill()	2x shields mode [invincibility mode]
	full()	3x shields mode [invincibility mode]
	nrg()	fill all 3 energy bars [essentially same effect as 3x energy capsule]

weapons and ammunition:
	unli()	unlimited ammo [you always have at least] one clip]
	mag()	+1 pistol, +10 pistol clips
	rif()	assault rifle, 10 magazines, 10 grenade cartridges
	pow()	rocket launcher, 10 rocket packs
	toast()	flamethrower, 10 napalm canisters
	melt()	fusion pistol, 10 batteries
	puff()	+2 shotguns, 50 shotgun shells
	zip()	smg, 10 magazines
	alien()	alien weapon
	ammo()	+10 all ammo

powerups:
	bye()	invisibility powerup [2 needed for full invisibility]
	nuke()	invincibility powerup
	see()	infravision [night vision] powerup
	wow()	extravision [fisheye/sniper mode] powerup

other items:
	key()	S'pht door key
	chip()	uplink chip, remember, you can only carry 1 chip at a time

location and teleportation:
	where()	get player's current location [polygon #].  Same info is displayed continuous when
		the overlay function is enabled.
	what()	get location of polygon player is currently looking at
	back()	teleport to location of last level load
	go()	teleport to location you are looking at.  Does not work under media.
	here()	marks current location for the 'goto()' command
	goto()	teleport to location marked with the 'here()' command.
	tele(polygon)	teleport to polygon # specified.  Replace word 'polygon' with polygon
			number.
	warp(level)	warp to the specified level.  Replace word 'level' with the level number
			you want [IE: 'warp(2) to go to level 2]  You will keep all your items.

miscelaneous functions:
	peek()	toggle zoom
	aim()	toggle crosshair [f8 will not work when this script is enabled]
	shit()	gives you everything [almost...]
	yourmom()	save the game at your current location
	fly()	toggle fly/jump modes.  Jump mode is default
	plat(ploygon,state)	sets platform at 'polygon' to state.  State is true [active] or
				false [inactive].  Only wirks with polyons designated as platforms
				or doors.
	over()	toggles overlay displaying current polygon location, target polygon, current health as % of full
		[1x shield] health, and current oxygen level as % of full oxygen.  Disabled by
		default.
	audio()	toggle the audio effects included in this script.  Initially disabled
	hardfall()	toggle hard falls.  Initially enabled
]]

--default values
scriptfx = 1	--controls the script's sounds
skip = 0	--toggles PID skip; on = 1, off = 0.  Not changeable in-game
limit = 0	--1 limits jumping [jump mode], 0 does not [fly mode]
uamm = 1	--set to 1 to enable unlimited ammo by default
vacu = 1	-- set to 1 to enable unlimited oxygen by default
gmode = 450	--default invincibility mode setting.  Resets to this value on level start/load
		--values:  -1 to turn off, 0 for undead/0x shields mode, 150 for 1x shields mode,
		--300 for 2x shields mode, 450 for 3x shields mode
ovrlay = 1	--toggles location/health/oxygen overlay display mode, 0 is off, 1 is on
xhair = 0	--0 is crosshair off by default, 1 is on
zoom = 0	--used to zoom, 0 is default and only recommended setting
orgen = 1	--oxygen regen default.  1 is on, 0 is off
lrgen = 1	--energy regen default.  1 is on, 0 is off
hfall = 0	--hard falls default.  1 is on, 0 is off


function sigh()
	if orgen == 0 then
		orgen = 1
		if scriptfx == 1 then
			Players[0]:play_sound("ball bounce",0)
		end
		Players.print("Air compressor enabled")
	else
		orgen = 0
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
		Players.print("Air compressor disabled")
	end
end

function oxy()
	if vacu ~= 1 then
		vacu = 1
		if scriptfx == 1 then
			Players[0]:play_sound("ball bounce",0)
		end
		Players.print("Unlimited oxygen on")
	else
		vacu = 0
		Players.print("Unlimited oxygen off")
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
	end
end

function otwo()
	Players[0].oxygen = 10800
end

function heal()
	if lrgen == 0 then
		lrgen = 1
		if scriptfx == 1 then
			Players[0]:play_sound("ball bounce",0)
		end
	Players.print("Healing enabled")
	else
		lrgen = 0
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
		Players.print("Healing disabled")
	end
end

function lich()
	if gmode ~= 0 then
		gmode = 0
		if scriptfx == 1 then
			Players[0]:play_sound("got ball",0)
		end
	else
		gmode = -1
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
	end
end

function god()
	if gmode ~= 150 then
		gmode = 150
		if scriptfx == 1 then
			Players[0]:play_sound("got ball",0)
		end
	else
		gmode = -1
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
	end
end

function fill()
	if gmode ~= 300 then
		gmode = 300
		if scriptfx == 1 then
			Players[0]:play_sound("got ball",0)
		end
	else
		gmode = -1
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
	end
end

function full()
	if gmode ~= 450 then
		gmode = 450
		if scriptfx == 1 then
			Players[0]:play_sound("got ball",0)
		end
	else
		gmode = -1
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
	end
end

function nrg()
	Players[0].life = 450
end

function unli()
	if uamm ~= 1 then
		uamm = 1
		Players.print("Unlimited ammo on.")
		if scriptfx == 1 then
			Players[0]:play_sound("ball bounce",0)
		end
	else
		uamm = 0
		Players.print("Unlimited ammo off.")
		if scriptfx == 1 then
			Players[0]:play_sound("computer page",0)
		end
	end
end

function mag()
	local items = Players[0].items
	items["pistol"] = items["pistol"] + 1
	items["pistol ammo"] = items["pistol ammo"] + 10
end

function rif()
	local items = Players[0].items
	items["assault rifle"] = items["assault rifle"] + 1
	items["assault rifle ammo"] = items["assault rifle ammo"] + 10
	items["assault rifle grenades"] = items["assault rifle grenades"] + 10
end

function pow()
	local items = Players[0].items
	items["missile launcher"] = items["missile launcher"] + 1
	items["missile launcher ammo"] = items["missile launcher ammo"] + 10
end

function toast()
	local items = Players[0].items
	items["flamethrower"] = items["flamethrower"] + 1
	items["flamethrower ammo"] = items["flamethrower ammo"] + 10
end

function melt()
	local items = Players[0].items
	items["fusion pistol"] = items["fusion pistol"] + 1
	items["fusion pistol ammo"] = items["fusion pistol ammo"] + 10
end

function puff()
	local items = Players[0].items
	items["shotgun"] = items["shotgun"] + 2
	items["shotgun ammo"] = items["shotgun ammo"] + 50
end

function zip()
	local items = Players[0].items
	items["smg"] = items["smg"] + 1
	items["smg ammo"] = items["smg ammo"] + 10
end

function alien()
	local items = Players[0].items
	items["alien weapon"] = items["alien weapon"] + 1
end

function ammo()
   local items = { "pistol ammo", "fusion pistol ammo", "assault rifle ammo", "assault rifle grenades", "missile launcher ammo", "alien weapon ammo", "flamethrower ammo", "shotgun ammo", "smg ammo" }
   for _, item in pairs(items) do
      Players[0].items[item] = Players[0].items[item] + 10
   end
end

function bye()
	Players[0].items["invisibility"] = 1
end

function nuke()
	Players[0].items["invincibility"] = 1
end

function see()
	Players[0].items["infravision"] = 1
end

function wow()
	Players[0].items["extravision"] = 1
end

function key()
	local items = Players[0].items
	items["key"] = items["key"] + 1
end

function chip()
	local items = Players[0].items
	items["uplink chip"] = items["uplink chip"] + 1
end


function where()
	wherami = get_player_polygon(0)
	Players.print(wherami)
end

function what()
	whatget()
	Players.print(that.polygon)
end

function whatget()
	that = Players[0]:find_target()
end

function back()
	if Level.name == "Arrival" and skip == 1 then
		Players[0]:teleport(destination)
		Players.print("Teleported to level start")
	else
		Players[0]:teleport(poly)
		Players.print("teleported to location of last level load")
	end
end

function skip_pid()
	destination = Polygons[56]
	for p in Players() do
		p:position(destination.x, destination.y, destination.z, destination.index)
		p.direction = -40
	end
end

function go()
	target = Players[0]:find_target()
	if target.polygon == nil then
		Players.print("Destination unreachable, please try another destination")
	else
		Players[0]:teleport(target.polygon)
		Players.print("Destination reached successfully.")
	end
end

function goto()
   if mark == nil then
   Players.print("No destination specified. Make a destination mark with here() command")
   else
   Players[0]:teleport(mark)
   Players.print("Marked destination reached successfuly")
   end
end

function here()
	mark = Players[0].monster.polygon
	Players.print("current position marked")
end

function tele(where)
	Players.print("teleporting...")
	teleport_player(0,where)
end

function warp(level)
	Players.print("warping to level specified")
	Players[0]:teleport_to_level(level - 1)
end

function peek()
	if zoom == 0 then
		zoom = 1
		if scriptfx == 1 then
			Players[0]:play_sound("pfhor platform",0)
		end
	else
		zoom = 0
		if scriptfx == 1 then
			Players[0]:play_sound("pfhor platform stopping",0)
		end
	end
end

function aim()
	if xhair ~= 1 then
		xhair = 1
		if scriptfx == 1 then
			Players[0]:play_sound("empty gun",3)
		end
	else
		xhair = 0
		if scriptfx == 1 then
			Players[0]:play_sound("empty gun",2)
		end
	end
end

function shit()
   ammo()
   local weapons = { "alien weapon", "pistol", "fusion pistol", "assault rifle", "missile launcher", "flamethrower", "shotgun", "shotgun", "smg" }
   for _, weapon in pairs(weapons) do
      Players[0].items[weapon] = Players[0].items[weapon] + 1
   end
end

function yourmom()
	Game.save()
end

function fly()
	if limit ~= 0 then
		limit = 0
		if scriptfx == 1 then
			Players[0]:play_sound("rocket flyby",0)
		end
		Players.print("fly mode on.")
	else
		limit = 1
		if scriptfx == 1 then
			Players[0]:play_sound("ball bounce",0)
		end
		Players.print("jump mode on.")
	end
end

function plat(polygon,state)
	set_platform_state(polygon,state)
	Players.print("activating platform")
	if scriptfx == 1 then
		Players[0]:play_sound("ball bounce",0)
	end
end

function over()
	if ovrlay ~= 0 then
		ovrlay = 0
	else
		ovrlay = 1
	end
end

function fall_damage()
	for p in Players() do
		fdmg = math.abs(p.external_velocity.z ^ 3) / 6.3
		fdmgwet = math.abs(p.external_velocity.z)
		oxydrain = ((math.abs(p.external_velocity.z) ^ 3) * 20)

	end
end


function audio()
	if scriptfx == 1 then  --if 1, play interface sounds
		scriptfx = 0
		Players.print("Audio effects off.")
	else
		scriptfx = 1  --if 0, don't play interface sounds
		Players.print("Audio effects on.")
	end
end

function hardfall()
	if hfall == 1 then
		hfall = 0
		Players.print("hard falls disabled.")
	else
		hfall = 1
		Players.print("hard falls enabled.")
	end
end

--trigger functions below

Triggers = {}

function Triggers.init()
	poly = Players[0].polygon
	Players[0].heath = 450
	if Level.name == "Arrival" and skip == 1 then
		skip_pid()
	end
end

function Triggers.idle()
	--handle overlay
	if Game.ticks == 0 then
		Players.print("Cheats Advanced V2.7E enabled.  do not use on multiplayer game.")
		if scriptfx == 1 then
			Players[0]:play_sound("startup")
		end
	else
		if Players[0].oxygen <= 1 then
			gmode = -1
			lrgen = 0
			orgen = 0
			Players[0]:damage(5000,"suffocation")

		end
		if ovrlay == 1 then
			for p in Players() do
				wherami = get_player_polygon(0)
				whatget()
				xa = Players[0].life
				xb = (xa / 150)
				hlth = (xb * 100)
				xc = Players[0].oxygen
				xd = (xc / 10800)
				crntoxy = (xd * 100)
				p.overlays[0].text = "poly: "..wherami
				if that ~= nil then
					p.overlays[1].text = "Target: " .. tostring(that.polygon)
				end
				p.overlays[2].text = "       Energy %: "..math.floor(hlth)
				p.overlays[4].text = "        O2 %:"..math.floor(crntoxy)
				p.overlays[0].color = "green"
				p.overlays[1].color = "green"
				p.overlays[2].color = "yellow"
				if hlth < 100 then
					p.overlays[2].color = "red"
				end
				if hlth > 200 then
					p.overlays[2].color = "dark red"
				end
				if crntoxy < 20 then
					p.overlays[4].color = "red"
				else
					p.overlays[4].color = "blue"
				end
			end
		else
			for p in Players() do
				p.overlays[0]:clear()
				p.overlays[1]:clear()
				p.overlays[2]:clear()
				p.overlays[4]:clear()
			end
		end
	end

	--handle jump/fly mode
	for p in Players() do
		if limit ~= 0 then
			if p.dead == false then
				if p.external_velocity.z == 0 then
					if p.action_flags.microphone_button then
						p:accelerate(0, 0, 1)
						if scriptfx == 1 then
							p.monster:play_sound("bob hit",0)
						end
					end
				end
			end
		end
		if limit == 0 then
			if p.dead == false then
				if p.action_flags.microphone_button then
					p:accelerate(0, 0, 1)
					if scriptfx == 1 then
						p.monster:play_sound("tick flapping",0)
					end
				end
			end
		end
		if hfall == 1 then
			if p.external_velocity.z > 5 then
				fall_damage()
				fall = 0
			end
			if p.external_velocity.z < -2 then
				fall_damage()
				fall = 1
			end
			if fall == 1 then
				if p.external_velocity.z == 0 and not p.feet_below_media then
					if scriptfx == 1 then
						p.monster:play_sound("body falling",0)
					end
					Players[0]:damage(fdmg,"compiler")
					fall = 0
				elseif p.external_velocity.z == 0 and p.feet_below_media then
					if scriptfx == 1 then
						p.monster:play_sound("large water splash",0)
					end
					Players[0]:damage(fdmgwet,"compiler")
					Players[0]:damage(oxydrain,"oxygen drain")
					Players[0]:fade_screen("flicker negative")
					fall = 0
				end
			end
			p.action_flags.microphone_button = false
		end
	end
	--handle unlimited oxygen and ammo modes
	if uamm == 1 then
		if Game.ticks%30 == 0 then
			local items = {"pistol ammo", "fusion pistol ammo", "assault rifle ammo", "assault rifle grenades", "missile launcher ammo", "alien weapon ammo", "flamethrower ammo", "shotgun ammo", "smg ammo" }
			for _, item in pairs(items) do
				if Players[0].items[item] == 0 then
					Players[0].items[item] = 1
				end
			end
		end
	end

	if vacu == 1 then
		if Players[0].oxygen < 10800 then
			Players[0].oxygen = 10800
		end
	end

	--handle vison enhancements [crosshair and zoom effects)
	if xhair == 1 then
		Players[0].crosshairs.active = true
	else
		Players[0].crosshairs.active = false
	end
	if zoom == 1 then
		Players[0].zoom_active = true
	else
		Players[0].zoom_active = false
	end

	--handle oxygen and life regeneration
	if orgen == 1 then
		if not Level.vacuum and not Players[0].head_below_media then
			if Game.ticks%30 == 0 and Players[0].oxygen < 10800 then
				Players[0].oxygen = Players[0].oxygen + 120
				if scriptfx == 1 then
					Players[0]:play_sound("oxygen refuel",0)
				end
			end
		end
	end
	if lrgen == 1 then
		if Game.ticks%20 == 0 and Players[0].life < 450 then
			if Players[0].life < 150 then
				Players[0].life = Players[0].life + 5
				if scriptfx == 1 then
					Players[0]:play_sound("adjust volume",10)
				end
			elseif Players[0].life < 300 then
				Players[0].life = Players[0].life + 3
				if scriptfx == 1 then
					Players[0]:play_sound("adjust volume")
				end
			elseif Players[0].life >=300 then
				if Game.ticks%40 == 0 then
					Players[0].life = Players[0].life + 1
				end
			end
		end
	end
end

--handle invincibility modes
function Triggers.player_damaged(victim)
	for p in Players() do
		if p.life < gmode and not p.dead then
			p.life = gmode
		end
	end
end
User avatar
Wrkncacnter
Vidmaster
Posts: 1948
Joined: Jan 29th '06, 03:51
Contact:

A script that has two 1 star reviews doesn't work very well? Shocking.
Fenrir
Spazeroid
Posts: 5
Joined: Jan 24th '14, 22:20

Wrkncacnter wrote:A script that has two 1 star reviews doesn't work very well? Shocking.
I understand your point, but if you go by what the reviews say, and not just the ratings, one person likes it and the other is criticizing the person who posted the script, not the script itself.
Last edited by Fenrir on Jan 26th '14, 02:42, edited 1 time in total.
User avatar
Wrkncacnter
Vidmaster
Posts: 1948
Joined: Jan 29th '06, 03:51
Contact:

Try the cheat script that comes with alephone. If you can get it to work, there's probably something wrong with the one you're trying to use.
Fenrir wrote: one person says that they like it
Wow.
Fenrir
Spazeroid
Posts: 5
Joined: Jan 24th '14, 22:20

Wrkncacnter wrote:Try the cheat script that comes with alephone. If you can get it to work, there's probably something wrong with the one you're trying to use.
That is why I am asking for help getting this one to work, as I prefer the additional functions that this one has.
User avatar
Wrkncacnter
Vidmaster
Posts: 1948
Joined: Jan 29th '06, 03:51
Contact:

Your log file should have the line number where there's a problem if there's a syntax error with the script. At least it used to print that stuff, I haven't tried in forever.
Fenrir
Spazeroid
Posts: 5
Joined: Jan 24th '14, 22:20

There are no syntax errors, but if I attempt to use the cheats in the new script I get this:

Code: Select all

[string "console"]:1: attempt to call global 'pow' (a nil value) (../../../trunk/Source_Files/Lua/lua_script.cpp:1095)
Here is the 'pow' function in the script that comes with the game:

Code: Select all

function pow()
   local items = Players[0].items
   items["missile launcher"] = items["missile launcher"] + 1
   items["missile launcher ammo"] = items["missile launcher ammo"] + 10
end
And here is the 'pow' function in the new script:

Code: Select all

function pow()
	local items = Players[0].items
	items["missile launcher"] = items["missile launcher"] + 1
	items["missile launcher ammo"] = items["missile launcher ammo"] + 10
end
There do not appear to be any differences, so I do not understand what the issue is...
Fenrir
Spazeroid
Posts: 5
Joined: Jan 24th '14, 22:20

Never mind, I figured it out. It was the 'goto' function...
Thank you for your help!
User avatar
Crater Creator
Vidmaster
Posts: 943
Joined: Feb 29th '08, 03:54
Contact:

Glad it worked for you in the end!
User avatar
Alric
Born on Board
Posts: 50
Joined: Feb 15th '11, 02:29
Contact:

I have a similar problem, this time with the cheat script that comes with A1. When playing a game with the cheats.lua active, it gives me a message that cheats are enabled at the start of the game and I can jump with the microphone button. However, inputting cheats with the control key doesn't seem to work. Has the key been changed for the new version of A1 or does the problem with the script mentioned here persist?
User avatar
ukimalefu
Mjolnir Mark IV
Posts: 623
Joined: Aug 21st '08, 17:25
Contact:

NO CHEATS
Dan
Cyborg
Posts: 94
Joined: Feb 20th '14, 02:26
Location: California

Alric wrote:I have a similar problem, this time with the cheat script that comes with A1. When playing a game with the cheats.lua active, it gives me a message that cheats are enabled at the start of the game and I can jump with the microphone button. However, inputting cheats with the control key doesn't seem to work. Has the key been changed for the new version of A1 or does the problem with the script mentioned here persist?
Cheats.lua uses Lua functions instead of built-in Marathon stuff. Click the console key and type in the name of the cheat followed by two parentheses.

For example: To prevent drowning, I would click the chat/console key and then type in
otwo()

If you want classic cheats, just use a Marathon script and not a AlephOne Lua script. In the Scripts or the MML folder, create a text file (preferably called "cheats.mml") and put "<marathon> <cheats on="true"/> </marathon>" into it.

REMEMBER: No cheating for real vid boys ;)
Last edited by Dan on Mar 22nd '14, 00:01, edited 1 time in total.
Roses are rose red
Poems don't always make sense
Refridgerator
Dan
Cyborg
Posts: 94
Joined: Feb 20th '14, 02:26
Location: California

ukimalefu wrote:NO CHEATS
Couldn't have said it better m'self
Roses are rose red
Poems don't always make sense
Refridgerator
User avatar
Alric
Born on Board
Posts: 50
Joined: Feb 15th '11, 02:29
Contact:

Thanks for the help! In my defense I'm just using the cheats for messing around on multiplayer maps with enemies and maps like Hell Hole :D Cheats.mml doesn't work but I'm already addressing the issue in another thread here.
Dan
Cyborg
Posts: 94
Joined: Feb 20th '14, 02:26
Location: California

Eh? Cheats.mml doesn't work? Works for me, but if it didn't work for me... that would be kinda messing with my brain.
Roses are rose red
Poems don't always make sense
Refridgerator
User avatar
Alric
Born on Board
Posts: 50
Joined: Feb 15th '11, 02:29
Contact:

Yeah, for some reason the MML script I made doesn't seem to work despite the syntax being correct. Its been a while since I coded something for Aleph One but as far as I recall it should work. Here's the script thus far:

<marathon>

<cheats on="true"/>

<player guided="true" oxygen_deplete="1" oxygen_replenish="1"/>

<items>
<item index="35" maximum="20" />
<item index=”5” invalid=”0”/>
<item index=”6” invalid=”0”/>
<item index=”7” invalid=”0”/>
<item index=”8” invalid=”0”/>
<item index=”9” invalid=”0”/>
<item index=”15” invalid=”0”/>
<item index=”16” invalid=”0”/>
</items>

</marathon>
Post Reply