I need some very basic scripting help - checkpoints


(Avoc) #1

Well, in case you don’t know, I can not script for the life of me.

I’m in the progress of making a small fun-map for an event that my clan will be hosting. My problem is that I have placed several ‘checkpoints’ throughout the map, and they are supposed to trigger the attached spawnpoints.
As an example, I have a flag called ‘extraspawn_1’ that is targeting 2 spawnpoints with the targetname ‘spawn1’.

I tried following the 2bit forward flag tutorial, but with no luck.

The only thing the flag is supposed to do, is to trigger the spawnpoints, and do a wm_announce ‘Checkpoint Reached!’. Its not supposed to show anything on the command map.

If anyone could tell me what I need to do to make it work, it will be much appreciated!


(acQu) #2

Entities have a targetname. In script do

setstate targetname default

for showing the spawnpoints or

setstate targetname invisible

to hide. Next thing to do is to force people to spawn there, because when no wolfobj not there, they will standardly spawn nearest spawnpoint from wolfobj. I dont know if you can do this without wolfobj. The command for forcing someone to spawn in a certain spawnpoint is

setautospawn

i guess. But have not in mind anymore the whole expression.

You need a very basic tute about scripting :slight_smile:


(stealth6) #3

can’t you just do this:
Make a trigger_multiple attatch it to a script_trigger
in the scripttrigger you trigger the piece of the script
In that piece yo just setstate spawnpoints, if the spawnpoint is invisible then you can’t spawn on it?


(acQu) #4

[QUOTE=stealth6;235268]can’t you just do this:
Make a trigger_multiple attatch it to a script_trigger
in the scripttrigger you trigger the piece of the script
In that piece yo just setstate spawnpoints, if the spawnpoint is invisible then you can’t spawn on it?[/QUOTE]

LOL why make it complicated when you can do it the easy way. Avocs problem probably is that he is setstating his spawnpoints correctly but still there is no result.This might be because there are wolfobj missing in his “entity collection”

Didnt mean to be a smartass sar :slight_smile:

But the entities he uses already make a good function in that “calling the script problem”. Avocs problem is to handle all the entities from within the script, as i think he got no problem to reach it due to “wm_announce information” he gave.

sorry for bad english. maybe someone will explain it better :>


(acQu) #5

[QUOTE=stealth6;235268]can’t you just do this:
Make a trigger_multiple attatch it to a script_trigger
in the scripttrigger you trigger the piece of the script
In that piece yo just setstate spawnpoints, if the spawnpoint is invisible then you can’t spawn on it?[/QUOTE]

LOL why make it complicated when you can do it the easy way. Avocs problem probably is that he is setstating his spawnpoints correctly but still there is no result.This might be because there are wolfobj missing in his “entity collection”. But im only guessin and didnt mean to be a smartass. But basically that flag entity should replace your trigger_multiple approach stealth.

The entities he uses already make a good function in that “calling the script problem”. Avocs problem is to handle all the entities from within the script, as i think he got no problem to reach it due to “wm_announce information” he gave.

Sorry for bad english. Maybe someone will explain it better :>


(stealth6) #6

oh oopsie, didn’t read the full post :stuck_out_tongue:

Can’t you just attatch the flag to 2 spawn points and to a script trigger.
In the script trigger you trigger a sound. Done?


(Avoc) #7

I have never scripted anything in my life, so even something as simple as a forward spawn is hard for me :smiley:

But I have taken care of it, thanks for the help! :slight_smile:


(mortis) #8

I found that the etpro mapscripts gave me a very good understanding of spawnpoints, because you have to spawn in all the entities and the related scripting in one block. You might want to examine my haxxor efforts, found here: http://bani.anime.net/banimod/forums/viewtopic.php?t=5932&start=0


(Avoc) #9

Is it possible to make the script trigger wm_endround by having the player go through a trigger_multiple brush?


(masterkiller) #10

of course!

The trigger_multiple need to target a target_script_trigger.
In the TST, you put a target key … ex: activate
and a scriptname :ex trigger_multiple_tst

script look like this:


trigger_multiple_tst
{
	spawn
	{
	}
	trigger activate
	{
		trigger game_manager axis_win
	}

}

in the game_manager you add this:


	trigger axis_win
	{
		wm_announce "^5The Axis are victorious."
		wait 2000
		wm_setwinner 0
		wm_endround
	}


(Qualmi) #11

avoc, read this here -> http://qualmi.de.tl/1.htm

selfcommercial who cares. basically it attempts (not finnished yet) to explain all, so that you realize that scripting isnt really that hard.

greetings from the outer planet :stroggtapir:


(Avoc) #12

@ Master: Thanks! I will try it out now

@ Qualmi: Thanks for the link! Will read up on it as soon as I try what masterkiller has suggested! :slight_smile:


(Avoc) #13

Ok, I have checked and double checked that everything is as its supposed to be in radiant:

  1. The trigger multiple is a box, it has a scriptname called ‘axis_portal’ - I have copy and pasted the script masterkiller gave me, and have renamed it from trigger_multiple_tst to ‘axis_portal’.

  2. I added the ‘axis_win’ in the game_manager, below the spawn brackets.

When I make an axis player touch the box, it does not trigger the ‘activate’ event :frowning:

The box is ticked to ‘axis only’


(stealth6) #14

[QUOTE=Avoc;235578]Ok, I have checked and double checked that everything is as its supposed to be in radiant:

  1. The trigger multiple is a box, it has a scriptname called ‘axis_portal’ - I have copy and pasted the script masterkiller gave me, and have renamed it from trigger_multiple_tst to ‘axis_portal’.

  2. I added the ‘axis_win’ in the game_manager, below the spawn brackets.

When I make an axis player touch the box, it does not trigger the ‘activate’ event :frowning:

The box is ticked to ‘axis only’[/QUOTE]

you are missing a step, the trigger_multiple has to be attatched to a target_script_trigger
and in that target you need scriptname etc…


(Avoc) #15

Ok - I now have:

  1. One trigger_multiple. It has a targetname called ‘axis_portal_box’
  2. One target_script_trigger. It has a scriptname (axis_portal) and a target ‘axis_portal_box’
  3. I have not changed the .script part

Damn I suck at this :smiley:


(shagileo) #16

Well, here’s the go:

1: trigger_multiple (this is a trigger brush which you give a ‘trigger_multiple’ key )

  • target: portal_scripter (this could be the name for your target_script_trigger)

2: target_script_trigger (this should be a little yellow box)

  • scriptname: axis_portal (‘chapter’ of the script to read)
  • target: activate (part of the ‘chapter’ to read)
    *targetname: portal_scripter (so now the trigger multiple is linked to the script trigger

Then your script looks like this:


axis_portal  / this is the scriptname as seen in the target_script_trigger
{
	spawn
	{
	}
	trigger activate  /this is the part it needs to read or execute... it doesn't matter how you call it, as long as your target from target_script_trigger matches this name
	{
		trigger game_manager axis_win
	}

}

and the rest of the script is what Masterkiller suggested (well the script above is the same, but with some explanation)

What you did here:

  1. One trigger_multiple. It has a targetname called ‘axis_portal_box’
  2. One target_script_trigger. It has a scriptname (axis_portal) and a target ‘axis_portal_box’

is link the target_script_trigger to the trigger_multiple, that won’t do the trick :wink:
(targetname is the name of the entity which is selected/activated in radiant, target is for linking it to another entity or to ‘aim’ it (can only be used with the target_script_trigger entity) to the correct part of the script to read)

I hope I’m a bit clear and it works out for you :slight_smile:

EDIT: Additional explanation

of course you can play with the trigger_multiple as well
depending of the storyline of your map, you can hide the trigger before players completed a certain objective (to avoid cheat ending the map)
or only allies or axis can activate the trigger. Because as it is now, both teams can end the map when triggering the trigger_multiple

If you need further information about scripting, you can always ask here or pm or visit cool websites or whatever :slight_smile:


(Avoc) #17

damn… still doesn’t work!

Just kidding! Finally it works! Yeah, one of the problem was that I didnt understand that the script_trigger had to target a specific part of the script (i.e. activate) - I thought it was just something it would do automatically.
Thanks a lot shagileo, and the rest of you! :slight_smile:

I guess this means I will need to release something to the community as a thanks! :smiley:


(aaa4) #18

its nice to see how you again try to make science out of this. yeah common, lets just abuse this target_script_trigger entity, because hm…the name sounds to me like it is neccessary to insert whenever i think there has to be something with scripting to be done. OMG LOL

why are you abusing this poor entity so much i ask myself. see i dont wanna be an ashole again, but its funny to see how you dont really grasp anything of scripting. yeah and now target this, do targetname there, do key trigger there LOL - not really.

so a smart question from me: would you also use a target_script_trigger when it comes to the func_constructible entity ?

think about it. i might be an ashole, but what i say has probably more boost than anything here in this thread. if you really would have understand anything basic about scripting, then you wouldnt use a target_script_trigger together with a trigger_multiple.

and even more - you will punish yourself with radiant stuff, as long as you thin a tst is the solution to all of your scripts probelms. in fact this entity is something like an “emergency solution”. think about it.


(aaa4) #19

its nice to see how you guys again try to make science out of such simple and basic stuff. “oh yeah common, lets just abuse this target_script_trigger entity, because hm…the name sounds to me like it is neccessary to insert whenever i think there has to be something with scripting to be done.” OMG LOL

why are you abusing this poor entity so much i ask myself. see i dont wanna be an ashole again, but its funny to see how you dont really grasp anything of scripting. yeah and now target this, do targetname there, do key trigger there LOL - not really.

so a smart question from me: would you also use a target_script_trigger when it comes to the func_constructible entity ?

think about it. i might be an ashole, but what i say has probably more boost than anything here in this thread. if you really would have understand anything basic about scripting, then you wouldnt use a target_script_trigger together with a trigger_multiple.

and even more - you will punish yourself with radiant stuff, as long as you think a tst is the solution to all of your scripts probelms LOL. in fact this entity is something like an “emergency solution”. never really got this, eh ?! think about it.


(Avoc) #20

thinks about it

Oh aaa4, u so crazy! ;D