mapping questions


(Qualmi) #1

quiet sure that i will ask 1 or 2 more questions next days, so i better made 1 thread for it.

for now i have problems with the sound, which has to be triggered when i teleport from A to B. i tried with the event “activate”, but no luck. so i had a look at darji2 and found out that there it is done by a trigger_multiple. this is what i want to refuse, caus ppl could jump into it and trigger the sound more often. anybody knows a solution ? i want to trigger a sound when i go into the teleporter, but i cant reach script from that event ? triggering sounds is no problem, but i must reach script first :confused:


(S14Y3R) #2

ey, target the trigger_multiple to a target_script_trigger and give the tst a target of run

that will call the run in scriptname of the tst whenever the trigger_multiple is ‘activated’ (don’t forget to turn on both teams checkbox)

tst_scriptname
{
run
{
//togglespeaker command
}
}

that should do the trick.


(Qualmi) #3

hm…yea…that was obvious…i already gave the answer to myself…feels stupid…maybe should do a small mapping break :slight_smile:

edit: to be honest, a couple of minutes later it thought about that, normally i dont use tst. in darji however the trigger_multiple was used at the outside of the teleport. u could easily jump up and trigger the sound again.


(Pande) #4

or, set the script to use a trigger_multiple that is is hidden somewhere, and the trigger multiple is near the tele.


(stealth6) #5

well most teleports I have seen are 2 triggers, one smaller box that is the trigger teleport and one slightly larger box around it with a sound trigger, that has a tiny delay so they hear it when they get to the other side. Then the chance of it being triggered w/o teleporting are pretty slim.

(Was that the question?)


(Qualmi) #6

the reason posting this question mainly was to somehow refuse the trigger_multiple. normally entities have a scriptname key, and when you trigger the activate event for this entity, then the related scriptblock gets called. yesterday however was a long day and i was too stupid to think it the other way round as i looked into darja. so the ting with the multiples i could have spared myself. but as i said, i was hoping someone might have a “scriptname” way of the trigger_teleport entity, as with this entity activate events doesnt work with my tries. long speech, i finally have my own question thread :smiley:

but maybe you guys wanna discuss my next challenge. realizing how long a flag is hold by the enemy, the capture_the_hill_principe. here my solution.


//hold the flag for 3 minutes
check_time
{

spawn
{
accum 1 set 0
}

//dummyevent. this one gets called when the flag is hold. its probably not consistent
activate
{
trigger self check_time
}

trigger check_time
{
//abort this block if flag is not hold anymore or time is up, could also do this with accums
wait 1000
accum 1 inc 1
trigger check_if_time_is_up //didnt mention this trigger in this script, but you can do this easily
trigger self check_time
}
}

maybe i forgot sth =P created this from scratch.

how about other solutions ? will ofc watch some maps tomorrow, but maybe someone could spare me some time :tongue: maybe there is some extra scriptcommand for it ?


(Qualmi) #7

the reason posting this question mainly was to somehow refuse the trigger_multiple. normally entities have a scriptname key, and when you trigger the activate event for this entity, then the related scriptblock gets called. yesterday however was a long day and i was too stupid to think it the other way round as i looked into darja. so the ting with the multiples i could have spared myself. but as i said, i was hoping someone might have a “scriptname” way of the trigger_teleport entity, as with this entity activate events doesnt work with my tries. long speech, i finally have my own question thread :smiley:

but maybe you guys wanna discuss my next challenge. realizing how long a flag is hold by the enemy, the capture_the_hill_principe. here my solution.


//hold the flag for 3 minutes
check_time
{

spawn
{
accum 1 set 0
}

//dummyevent. this one gets called when the flag is hold. its probably not consistent
activate
{
trigger self check_time
}

trigger check_time
{
//abort this block if flag is not hold anymore or time is up, could also do this with accums
wait 1000
accum 1 inc 1
trigger check_if_time_is_up //didnt mention this trigger in this script, but you can do this easily
trigger self check_time
}
}

maybe i forgot sth =P created this from scratch.

how about other solutions ? will ofc watch some maps tomorrow, but maybe someone could spare me some time :tongue: maybe there is some extra scriptcommand for it ?


(stealth6) #8

I made a koth map a while back well 2 actually.
psl_koth and orb_battle, but psl_koth has the system you describe (but check out orb_battle for an awesome system :smiley:
anyway this is the script I used:


game_manager
{
	spawn
	{
		wm_axis_respawntime	15
		wm_allied_respawntime	14
		wm_set_round_timelimit	20
		wm_number_of_objectives 1

		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// Winner on expiration of round timer (0=Axis, 1=Allies, -1=Nobody)
		wm_setwinner 0

		//Objectives
		//1 Primary Objective: Capture the flag
		// obj nbr, team, status (0=none, 1=passed, 2=failed)
		wm_objective_status 1 0 0
		wm_objective_status 1 1 0

		setautospawn "Axis Spawn" 0
		setautospawn "Allied Spawn" 1

	}

	trigger timelimit_hit	// who has more captures or if they broke even
	{
		wm_setwinner -1
		wait 250
		wm_announce "^dNobody held the flag for 3 minutes"
		wait 500
		wm_announce "It is a draw!"
		wait 2000
		wm_endround
	}
}
win
{

trigger allied_capture
	{
	wm_objective_status 1 0 2
	wm_objective_status 1 1 1
	wm_announce "^4Allies ^dKnow how to capture a Flag^2!!!"
	wait 1000
        wm_announce "^dNow hold it for ^13 ^dminutes^2!"
        wait 60000
        wm_announce "^12 ^dminute remaining^2!"
        wait 60000
        wm_announce "^11 ^dminute remaining^2!"
        wait 30000
	wm_announce "^130 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^120 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^110 ^dseconds remaining^2!"
	wait 5000
	wm_announce "^7*^d5"
	wait 1000
	wm_announce "^7*^d4"
	wait 1000
	wm_announce "^7*^d3"
	wait 1000
	wm_announce "^7*^d2"
	wait 1000
	wm_announce "^7*^d1"
	wait 1000
      wm_announce "^4Allied ^1won^2!"
      wait 1000
      wm_setwinner 1
	wm_endround
	}

trigger axis_capture
	{
	wm_objective_status 1 0 1
	wm_objective_status 1 1 2
	wm_announce "^1Axis ^dKnow how to capture a Flag^2!!!"
	wait 1000
        wm_announce "^dNow hold it for ^13 ^dminutes^2!"
        wait 60000
        wm_announce "^12 ^dminute remaining^2!"
        wait 60000
        wm_announce "^11 ^dminute remaining^2!"
        wait 30000
	wm_announce "^130 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^120 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^110 ^dseconds remaining^2!"
	wait 5000
	wm_announce "^7*^d5"
	wait 1000
	wm_announce "^7*^d4"
	wait 1000
	wm_announce "^7*^d3"
	wait 1000
	wm_announce "^7*^d2"
	wait 1000
	wm_announce "^7*^d1"
	wait 1000
      wm_announce "^1Axis won^2!"
      wait 1000
      wm_setwinner 0
	wm_endround
	}
}

Also your teleport sound can be solved w/o scripting, I’ll get back to that after lunch
edit:
-Make a trigger_multiple just infront of your trigger_teleport, only like 2 blocks on grid 1 bigger then the trigger_teleport.
-Make a target_delay above your misc_teleporter_dest, with key: “wait” and value “.2”
-Make a target_speaker above the target_delay, with key: “volume” and value “200”
also don’t forget to add your sound: key “noise” and value “sound/Qualmi/teleport.wav”
-Deselect all
-Select the trigger_multiple FIRST, THEN the target_delay press ctrl+k
-Deslect all
-Select the target_delay FIRST, THEN the target_speaker press ctrl+k
-Profit

This is what it looks like in my map: (this map was never officially released)


(TomTom7777) #9

[QUOTE=stealth6;190381]I made a koth map a while back well 2 actually.
psl_koth and orb_battle, but psl_koth has the system you describe (but check out orb_battle for an awesome system :smiley:
anyway this is the script I used:


game_manager
{
	spawn
	{
		wm_axis_respawntime	15
		wm_allied_respawntime	14
		wm_set_round_timelimit	20
		wm_number_of_objectives 1

		// Stopwatch mode defending team (0=Axis, 1=Allies)
		wm_set_defending_team	0

		// Winner on expiration of round timer (0=Axis, 1=Allies, -1=Nobody)
		wm_setwinner 0

		//Objectives
		//1 Primary Objective: Capture the flag
		// obj nbr, team, status (0=none, 1=passed, 2=failed)
		wm_objective_status 1 0 0
		wm_objective_status 1 1 0

		setautospawn "Axis Spawn" 0
		setautospawn "Allied Spawn" 1

	}

	trigger timelimit_hit	// who has more captures or if they broke even
	{
		wm_setwinner -1
		wait 250
		wm_announce "^dNobody held the flag for 3 minutes"
		wait 500
		wm_announce "It is a draw!"
		wait 2000
		wm_endround
	}
}
win
{

trigger allied_capture
	{
	wm_objective_status 1 0 2
	wm_objective_status 1 1 1
	wm_announce "^4Allies ^dKnow how to capture a Flag^2!!!"
	wait 1000
        wm_announce "^dNow hold it for ^13 ^dminutes^2!"
        wait 60000
        wm_announce "^12 ^dminute remaining^2!"
        wait 60000
        wm_announce "^11 ^dminute remaining^2!"
        wait 30000
	wm_announce "^130 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^120 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^110 ^dseconds remaining^2!"
	wait 5000
	wm_announce "^7*^d5"
	wait 1000
	wm_announce "^7*^d4"
	wait 1000
	wm_announce "^7*^d3"
	wait 1000
	wm_announce "^7*^d2"
	wait 1000
	wm_announce "^7*^d1"
	wait 1000
      wm_announce "^4Allied ^1won^2!"
      wait 1000
      wm_setwinner 1
	wm_endround
	}

trigger axis_capture
	{
	wm_objective_status 1 0 1
	wm_objective_status 1 1 2
	wm_announce "^1Axis ^dKnow how to capture a Flag^2!!!"
	wait 1000
        wm_announce "^dNow hold it for ^13 ^dminutes^2!"
        wait 60000
        wm_announce "^12 ^dminute remaining^2!"
        wait 60000
        wm_announce "^11 ^dminute remaining^2!"
        wait 30000
	wm_announce "^130 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^120 ^dseconds remaining^2!"
	wait 10000
	wm_announce "^110 ^dseconds remaining^2!"
	wait 5000
	wm_announce "^7*^d5"
	wait 1000
	wm_announce "^7*^d4"
	wait 1000
	wm_announce "^7*^d3"
	wait 1000
	wm_announce "^7*^d2"
	wait 1000
	wm_announce "^7*^d1"
	wait 1000
      wm_announce "^1Axis won^2!"
      wait 1000
      wm_setwinner 0
	wm_endround
	}
}

…[/QUOTE]
@Stealth6: You sure you grabbed the right version? What I read is a script that rewards the first to grab the flag regardless of how long or even if they have it at the end. And the lack of lockouts between the capture scripts and the timelimit_hit script could result in some interesting conflicting messaging.

@Qualmi: in general there are a few ways that mappers have implemented similar timers. Wait-recursion-wait… (like what you have), Linear coded waits (like fixed versions of what stealth6 is proposing) and Others that make use of func_timers. Unfortunately more than a few mappers have not got their scripts perfect and a few problems result like; 1-failure to reset the other teams timer/count resulting in shorting the countdown when they recapture, , 2-granularity or the smallest time your teams has to hold for the script to credit you and dis-credit the other team. 3-Not locking out other scripts (like timelimit ones) with incorrect results when their timing overlaps. The linear method is often the easiest but often suffers from at least one of the problems mentioned. Personally I like the func_timer method since it keeps time more accurately. I suggest you look at dm_hillb2 (by seven_dc) to see one inaction.


(stealth6) #10

oh, I thought that the enemy just has to hold the flag for 3 minutes in total.
so yes, the timer is reset every time, but the timelimit hit works fine. If nobody held the flag for 3 mintues it says DRAW.

But in Orb_battle I have a point system, and the team with the most points at the end wins. so the team that has held the flag for the longest overall time wins. Cause in psl_koth mostly people wouldn’t even both with the flag only if the time was on 1 minute left.


(Qualmi) #11

tried orb, tried dmhill, both cool, but will decide for func_timer style. as far as i see there is no other way of storing your time as with accums, right ? just asking, maybe there is a better solution. and with the orb timelimit_hit system: yea i know, its a cool system, have done this the same way just a few weeks ago for another map of a fellow mapper. as for the trigger_multiple i will refuse calling the script as stealth said. good tipp, thx. i think that everytime the script is called it will caus a short lag i have realized. but the question is, wis the lag more or less if i not involve the script with the trigger_multiple thing ? questions over questions :smiley:


(Qualmi) #12

anybody knows how i can make a shield like the one in shield-b1. i had a look at the mapfile, but hum, im not able to follow.

edit: any help to build this up quickly is appreciated. i never built up a tank, or a truck, so there is where my skill stops. the idea behind it i think i got it a bit. the shield is surrounded by trigger multiples which do sth. but as i said. i dont have the scripting skill. anybody wants to explain ? or ctf_metro will take a bit longer…


(Qualmi) #13

anybody knows how i can make a shield like the one in shield-b1. i think i got the idea, but could use a little help. how can i make trigger_multiples move ?


(stealth6) #14

wasn’t shield-b1 opensource?


(Qualmi) #15

yep, it is. but its very complicated. take a look at the shield. its consists probably out of 100 brushes. script is also very messy. hard to read, since the lines are not tabed.

so if i know how to move a trigger_multiple, it would be a great start, caus this is how the shield works there.

edit: i would appreciate a tutorial about this, since i dont have so much time. it seems very complicated, but it is a great idea. all i want is make an entity follow me. i dont know if that is possible :confused:


(isbowhten) #16

:slight_smile: that’s my part.

the shield had tagged multiples around its middle…

the tags are around the middel so the 8 multiples are not tagged to the middle itself but to the tags outside the middle… ehm…

___tag______tag________tag

tag____origin of a script_mover _____tag
_______Tag________tag___tag

like this…
then if i go inside a multiple another invisible script_mover (not tagged to anything, can be anywhere at mapstart), is moved to the multiples origin which is the same as the tag it is attached to.
(setposition in its script routine)

after this the same routine setting the position of it calls the move routine of the script_mover in the middle, which now moves to the position the tag was before, because the 2nd script_mover has been moved to there…

so it moves from its middle to an entity that is as far away as the distance from middle to a tag.

i invented this and i have to say that there might be another way to make it…
you could also put the tags in a line away form the middle…
middle___Tag____Tag____TAg like this, and rotate them around, the rest stays the same…
this is like a radar then.


(Qualmi) #17

@isbowhten: i dont know what tags are, so i am not that advanced. will try that later, my time is really rare atm.

@forum: how can i make the players shake ? i mean like in vesuv the earthquake at the beginning. is there an entity for it. dont know for what i should search. also i hope that this is possible not only at mapstart, it must be triggerable.


(-SSF-Sage) #18

I’m not the forum, but target_rumble alertentitied by script. Probably buggy. Works only for all players and can be unnoticeable when you are running and shooting. Haven’t played with it (values etc.) except once, but try it. That is the only way.


(Qualmi) #19

thx. i got it to work. you have to alert it on and off i have noticed. strange, but ok. startoff spawnflag is also strange…


(Qualmi) #20

well. i have an idea for a different kind of map, you can make a whole concept out of this if you want. the idea is creating a monster, which is actually a script_mover. you can hurt it, you can kill it, caus you can also hurt and kill a script_mover. now, to make the monster really a monster you must somehow attach a trigger hurt to it. so if the monster moves, then the trigger hurt moves with this monster. and if the monster hits you it will caus some damage…and if you are a totally scripting freak, you can make the monster shoot some stuff at you (certain direction) and if it hits you, you get hurt by the trigger_hurt. i have still more ideas also with other entities, actually a lot :smiley: but i dont know how to solve them with my noobie scripting skills. i would love if someone could take the time to somehow explain to me this attachtotag stuff, or whatever else is there to make this happen. or give me hints, caus i cant find this somewhere written, and i dont know which entities to use, so. hint ? tutorials ? explains ?