Forum

> > CS2D > Scripts > Need a script... please?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Need a script... please?

2 replies
To the start Previous 1 Next To the start

old Need a script... please?

Jarago
User Off Offline

Quote
Hey guys.
Working on a new map... kinda Quest-Adventure.
Im not good in making scripts so i need someone to help me out.

SCRIPT 1:
Quests are main part of this adventure but there are also exploration sections (and non-quest gameplay) and i need to remind player the quest briefing, in case he forgets. So i want this "reminder" script, which may be also possible with IF trigger but i dont know how So script would be something like Trigger_Delay cycle - it triggers when player gets a quest and every 4 minutes it re-triggers = every 240 seconds would appear text (from func_message) that would remind current quest. Thats not hard to do in editor, hard is to cancel the cycling... when specific Trigger_Once triggers. Hope its possible, it would make that adventure very... comfortable

SCRIPT 2:
This may not be possible, but would be helpful: When the player dies, he respawns (like in Team Deathmatch or Deathmatch mode) but with all weapons he had when he died. Keeping same amount of ammo is optional and would be great too, but that depends on how hard it is to do.

SCRIPT 3:
Im not sure if i use this one but... Id like to give player an option to carry TWO primary weapons at the same time... After few quest you would "unlock" second primary weapon slot. Is this possible?

Thanks for any answers

old Re: Need a script... please?

Rainoth
Moderator Off Offline

Quote
Script 1 : tl;dr
Script 2 : It's very possible. Ammo is kind of tricky as you'd have to have a table of all weapons used by player and calculate whenever he attacks/reloads and so on then use setammo command.
Script 3 :
1
2
parse("equip "..id.." 32")
parse("equip "..id.." 10")
That will give players 2 primary weapons so yes it's possible.

old Re: Need a script... please?

MikuAuahDark
User Off Offline

Quote
Script 1: does not possible from editor because Trigger_If does not accept ID parameter but it's possible from server-side script with cs2d lua cmd timer(beware that the current implementation of the timer is not very safe, see thread cs2d Lua Error! : Unprotected error in call to Lua AP for more info)

Script 2: this one is bit tricky but possible, you can use something like this
1
2
3
4
5
6
7
8
9
10
11
12
13
local parse_mode=false
addhook("log","parse_logger")
function parse_logger(txt)
	if parse_mode then
		-- parse something here from log
		return 1
	end
end

-- ... somewhere in your function
parse_mode=true
parse("items")	-- list all items that held by player and items on the groud
parse_mode=false
(see cs2d cmd items, cs2d lua cmd parse, and cs2d lua hook log for more info)
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview