Jump to content


Auto-Repeating


  • Please log in to reply
12 replies to this topic

#1 NewComer

NewComer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 29 May 2018 - 01:51 PM

So, I made a func_timer attached to target_print in order to view a message on screen after an amount of seconds.
But It keeps repeating itself..  I want it to be viewed once. just once only.
How can I make it like that?

#2 kaua

kaua

    Member

  • Members
  • PipPip
  • 16 posts

Posted 30 May 2018 - 01:44 PM

Can you specify what you wanna do? You can always get the message on another trigger and let the timer activate that trigger

#3 NewComer

NewComer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 30 May 2018 - 02:17 PM

View Postkaua, on 30 May 2018 - 01:44 PM, said:

Can you specify what you wanna do? You can always get the message on another trigger and let the timer activate that trigger
basically, the message(target_print) keeps showing up in my screen over and over. but i want it to be shown up once only.

#4 kaua

kaua

    Member

  • Members
  • PipPip
  • 16 posts

Posted 31 May 2018 - 10:07 AM

View PostNewComer, on 30 May 2018 - 02:17 PM, said:

basically, the message(target_print) keeps showing up in my screen over and over. but i want it to be shown up once only.

how did you connect the func_timer to the target_print ? post an example and ill try to de-bugg it
also specify what you want to achieve? a target_print every X amount of seconds? a target_print once X happens ? this will help also to optimize the code

#5 NewComer

NewComer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 01 June 2018 - 12:08 AM

View Postkaua, on 31 May 2018 - 10:07 AM, said:

how did you connect the func_timer to the target_print ? post an example and ill try to de-bugg it
also specify what you want to achieve? a target_print every X amount of seconds? a target_print once X happens ? this will help also to optimize the code

"classname" "func_timer"
"wait" "30"
"random" "0"
"target" "poop4"
"origin" "0 0 50"
"spawnflags" "1"
}
{
"targetname" "poop4"
"classname" "target_print"
"origin" "3740 1370 -500"
"message" "example"
}
I want target_print to happen once after 30 seconds after the map start..

#6 kaua

kaua

    Member

  • Members
  • PipPip
  • 16 posts

Posted 01 June 2018 - 05:41 PM

View PostNewComer, on 01 June 2018 - 12:08 AM, said:

"classname" "func_timer"
"wait" "30"
"random" "0"
"target" "poop4"
"origin" "0 0 50"
"spawnflags" "1"
}
{
"targetname" "poop4"
"classname" "target_print"
"origin" "3740 1370 -500"
"message" "example"
}
I want target_print to happen once after 30 seconds after the map start..

not sure if func_timer can be used for this but there is an alternative
you can simply make a trigger_multiple or a func_button where the players are spawning and set a "wait" of like 20 minutes (or how long the map latsts in mapcycle)
this way someone will activate it on spawn and it will not display again untill the next restart / mapcycle

#7 NewComer

NewComer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 01 June 2018 - 07:31 PM

View Postkaua, on 01 June 2018 - 05:41 PM, said:

not sure if func_timer can be used for this but there is an alternative
you can simply make a trigger_multiple or a func_button where the players are spawning and set a "wait" of like 20 minutes (or how long the map latsts in mapcycle)
this way someone will activate it on spawn and it will not display again untill the next restart / mapcycle
then, can u give me an example for trigger_multiple? or the code for it?
thanks.

#8 kaua

kaua

    Member

  • Members
  • PipPip
  • 16 posts

Posted 01 June 2018 - 10:46 PM

View PostNewComer, on 01 June 2018 - 07:31 PM, said:

then, can u give me an example for trigger_multiple? or the code for it?
thanks.

ill test it and post codes once i get home but for the concept it should be something like this:
make a trigger_multiple with mins and maxs on player spawns / route, target it with a func_button somewhere in the map (like -999 -999 -999)
so far youve made a button that activates with a trigger_multiple
now add a target_print and connect it with the same target as the button (not to be mistaken with the trigger_multiple)
then set a wait time on the button.
I'm not sure but you might even make the wait time on the trigger itself which will save u a step and some code but im really not sure about this one

here is some untested code if you wanna do the testings untill i have time


Quote

{
"model" "*0"
"classname" "trigger_multiple"
"spawnflags" "1"
"target" "button1"
"wait" "0.5"
"origin" "0 0 0"
"mins" "0 0 0"
"maxs" "100 100 100" // a 100*100*100 cube froim the origin
}

{
"model" "*1"
"classname" "func_button"
"origin" "-999 -999 -999"
"wait" "1200.0" // wont activate again untill wait time is over.
"dmg" "2"
"health" "1"
"lip" "50"
"angles" "-1 0 0"
"targetname" "button1"
"target" "msg"
}

{
"targetname" "msg"
"classname" "target_print"
"origin" "0 0 0"
"message" "welcome"
}

Edited by kaua, 01 June 2018 - 10:51 PM.


#9 NewComer

NewComer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 02 June 2018 - 01:56 PM

View Postkaua, on 01 June 2018 - 10:46 PM, said:

ill test it and post codes once i get home but for the concept it should be something like this:
make a trigger_multiple with mins and maxs on player spawns / route, target it with a func_button somewhere in the map (like -999 -999 -999)
so far youve made a button that activates with a trigger_multiple
now add a target_print and connect it with the same target as the button (not to be mistaken with the trigger_multiple)
then set a wait time on the button.
I'm not sure but you might even make the wait time on the trigger itself which will save u a step and some code but im really not sure about this one

here is some untested code if you wanna do the testings untill i have time
Thanks, M8 I appreciate your help, But do you remember? I said "without buttons"

Edited by NewComer, 02 June 2018 - 01:56 PM.


#10 kaua

kaua

    Member

  • Members
  • PipPip
  • 16 posts

Posted 03 June 2018 - 01:25 AM

View PostNewComer, on 02 June 2018 - 01:56 PM, said:

Thanks, M8 I appreciate your help, But do you remember? I said "without buttons"
ah I did not pay enough attention then :) you can still play around with the "wait" time on the trigger itself but i dont know if triggers has that functionality
maybe someone who is more fammiliar with the structure of the ent files can help you with that
anyway if I come up with a solution I will let you know

#11 hansvanwillekom

hansvanwillekom

    BETA Tester

  • BETA Testers
  • PipPipPip
  • 55 posts

Posted 04 June 2018 - 06:08 PM

Try using a func_trigger? If someone walks in the area of the func trigger, the message will appear.

#12 NewComer

NewComer

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 07 June 2018 - 02:02 PM

View Posthansvanwillekom, on 04 June 2018 - 06:08 PM, said:

Try using a func_trigger? If someone walks in the area of the func trigger, the message will appear.
And, How does that work?

#13 hansvanwillekom

hansvanwillekom

    BETA Tester

  • BETA Testers
  • PipPipPip
  • 55 posts

Posted 24 June 2018 - 08:50 PM

Something like this i think:
Classname func_trigger
Model *..
Origin ...
Angles ...
Target poop


Targetname poop
Classname target_print
Origin ..
Message ..

You need to test it yourself and see if it works out :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users