Jump to content
Sign in to follow this  
lonesoldier

Radio text

Recommended Posts

ok.

Say theres a trigger, and in its activation field it has player globalradio "jsdhasfdjk".

Well, how can i make it that whatever unit sets it off will be the one that says the radio message?

Also, in that Random Sound Script in the other thread, how can i make so that the radio sound comes from the guy who set the script off?

I have 2 teams. And each has 4 custom sounds. I have two different voices for the same 4 bits of sound. One voice, the white mans voice is my guys voic, and the black mans voice is the other teams voice.

Now say i had 10 enemy soldiers, and my team and the other team were there. And i shot a soldier and it set off that script, then the black guy shot a soldier and it set off the Black guys voice. So how would i make the game know who killed which soldier, so that it can activate the black guys voice when he kills someone and the white guys voice when i kill someone?

Share this post


Link to post
Share on other sites

put this into the trigger's activation field:

speaker=thislist select 0; [speaker] exec "voice.sqs"

Now in your script:

First line of script: _speaker = _this

Then just change aP into _speaker (if i remember correctly, it

was aP, saying that kill-message)

P.S - if this should become a multiplayer map, then you'll

need some changings in general, for most of the hints, you

got during the last 2 days

~S~ CD

Share this post


Link to post
Share on other sites

THANKS VERY MUCH MATE!!!

So how do i get the black guy to say black voices only?confused.gif

one more thing. Do you have msn? Because then it would be easier for me to ask you stuff. But you probably dont want me bigging u tounge.gif

Share this post


Link to post
Share on other sites

OK, in your script, right after the creation of your

random variable, put something like that:

?_speaker == blackguy: goto "blackvoices"

#whitevoices

...

your usual script

...

goto "end"

#blackvoices

...

the same script, but with blackvoices instead of the whities

...

#end

exit

:r u on icq aswell? - i can't use msn here @ work, but icq

works.

Share this post


Link to post
Share on other sites

Shit i just tried figuring out what you explained and im lost. What would the EXACT scripts be? Can you please post the 2 scripts exact writing please? And the script names are soundplay.sqs and soundplay1.sqs

Dont have ICQ. For the black guy, where do i exec his script? And also, if i exec both scripts from the one trigger will it decided which voices to use?

Share this post


Link to post
Share on other sites

It's all inside the same script.

With that line: ? _speaker == blackguy: goto "blackvoices"

you will ask, wether it's the blackguy or not.

If it's the blackguy, then the statement after the ":" will be

executed => goto "blackvoices"

If it's not the blackguy, then the script continues at the

next line (#whitevoices)

tounge.gif.S: blackguy you replace with the name of your

black guy

~S~ CD

Share this post


Link to post
Share on other sites

Youve lost me man...

Im sorry, i dont wanna seem like a pain in the ass. But could you post the whole scripts here please? And where i exec them from and stuff.

sorry for any inconveniencies man. sad.gif

Share this post


Link to post
Share on other sites

OK, here's the new script:

_speaker = _this

_sound = random 4

_sound = _sound - (_sound mod 1)

? _speaker == blackguy: goto "blackvoices"

#whitevoices

?(_sound == 0) : _speaker SideRadio "gotem"

?(_sound == 1) : _speaker SideRadio "heshistory"

?(_sound == 2) : _speaker SideRadio "killconfirmed"

?(_sound == 3) : _speaker SideRadio "goodbye"

goto "end"

#blackvoices

?(_sound == 0) : _speaker SideRadio "blackgotem"

?(_sound == 1) : _speaker SideRadio "blackheshistory"

?(_sound == 2) : _speaker SideRadio "blackkillconfirmed"

?(_sound == 3) : _speaker SideRadio "blackgoodbye"

#end

exit

Well, after reading through you threads again, i figured out,

that it's very hard to bypass the killer unit to the script.

Problem: you can't detect: who has killed whom

Possible solution: check the rating of a unit and save it into

a variable. If it increased for any unit, then this was the

killer unit.

e.g:

Use a trigger with condition: true

and into it's activation field type:

blackguyrating=rating blackguy; whiteguyrating=rating whiteguy

Do that for all units, which could use your voice.sqs

Then you need to create a trigger for each unit:

trigger1:

activation: none/repeatedly

condition: rating blackguy > blackguyrating

activation field: blackguyratig=rating blackguy; [blackguy] exec "voice.sqs"

You need to change blackguyrating, blackguy and [blackguy] for each trigger, depending on the name of the unit, you want to check here.

e.g: trigger2:

condition: rating whiteguy > whiteguyrating; [whiteguy] exec "voice.sqs"

P.S: for the reason, that you only have two different kind

of voicesets, you can use [whiteguy] exec "voice.sqs"

for each white unit, saying that voice, and

[blackguy] exec "voice.sqs" for each black unit, saying it.

hope this helps and works wink.gif

~S~ CD

Share this post


Link to post
Share on other sites

Thanks very much mate!! i cant thank you enough. Geez im gonna be busy tomorrow... tounge.gif

Cheers matey!!!!

Share this post


Link to post
Share on other sites

Ok, i put this in the black guys trigger:

Cond: rating Pa > 100

Activation: Parating=100; [Pa] exec "voices1.sqs"

Now his name is Pa, coz its opposite of aP, which is my guys name. I also had to make a script for teh black guys voices, coz it kept coming up with errors when my guy was sharing the script with the black guy. Anyway when the black guy kills someone he says his radio message, but then when he kills another person he doesnt say any more messages. I changed the values in the Rating bit, to like 1000 and stuff and he still only says 1 voice. Same with ym guy, my guys trigger is exactly the same except i changed the Pa to aP, and the script in the exec to "Voices.sqs".

The black guys script is voices1.sqs.

Im guessing the problem is with the rating, how can i make it so they can say there voices atleast 60 times?

Share this post


Link to post
Share on other sites

Well

Indeed i think, you did something wrong with the ratings.

OK, here's the math' lession for the rating counting:

Let's say, aP is the one, we're talking about now:

In the initialization trigger, we save the actual rating of aP

in a variable: aPrating=rating aP

Let's say the rating is 0 actually, then aPrating is 0 aswell now.

The trigger condition for aP's kill detection trigger is:

rating aP > aPrating

Once aP kills an enemy unit, his rating will increase, this means

rating aP will increase (not aPrating).

Now the trigger becomes active because: rating aP > aPrating

is fact now.

Then it's activation field will be executed:

aPrating=rating aP; [aP] exec "voice1.sqs"

The first statement (aPrating=rating aP) we need to update

the variable aPrating, so that it's equal to rating aP again.

Unless aP doesn't kill anymore enemies, rating aP won't become greater than aPrating, once he kills again, it would

become greater again aswell.

:note - don't forget to set the trigger to be activated repeatedly.

There's no need for specifying any values manually (like

aPrating=100 or summit else).

After thinking a bit about your mission, i would recommend

to use 2 seperate scripts for the voices (script 1 for whitevoices and script 2 for blackvoices).

~S~ CD

Share this post


Link to post
Share on other sites

"In the initialization trigger, we save the actual rating of aP

in a variable: aPrating=rating aP

Let's say the rating is 0 actually, then aPrating is 0 aswell now.

The trigger condition for aP's kill detection trigger is:

rating aP > aPrating"

So i dont actually put any numbers? I have that EXACT text you put there? i dont put rating aP > 100 or anything? I just put exactly what you put?

Also do i put all this in the one trigger? or does aP need another trigger?

If i use one trigger will it be like this:

Radiuses: 0

Activation: none/ repeatedly

Condition: rating aP > aPrating

Activation: aPrating=rating aP; [aP] exec "voice1.sqs"

So that the only trigger ill need for aP's kill detection?

I just want to get it right so i dont have to keep posting when i get an error.

I also made a script for aP and a script for Pa.

Ill go test now on what i put above....

Ok just tested, and the sounds wont play.

What exactly will be put in aP's trigger? Radiuses, activations and so on...

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">BUMP<span id='postcolor'>

Sorry, but even me needs some sleep  smile.gif

OK, i've tried that thing out now, before posting the

next reply (just to get sure it works);

...and...it.... wow.gif  works

I've tried it with a sidechat message, instead of a voice,

so i mean the rating counting way works.

Now the triggers:

trigger nr.1 (init-trigger) !important!

Radiuses: 0

Activation: none/once

Condition: true

Activation: aPrating=rating aP; Parating=rating Pa

:note - you need to initialize all your guys rating variables

in the activation field of this trigger.

trigger to detect kills (each man needs his own trigger)

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Radiuses: 0

Activation: none/ repeatedly

Condition: rating aP > aPrating

Activation: aPrating=rating aP; [aP] exec "voice1.sqs"

<span id='postcolor'>

this is the correct trigger for aP

Radiuses: 0

Activation: none/ repeatedly

Condition: rating Pa > Parating

Activation: Parating=rating Pa; [Pa] exec "voice2.sqs"

this is the correct one for Pa

This part works for sure, if you do it in this way.

A reason, why he won't say it again could be:

If you kill an enemy, the counter increases, but if you

kill a friendly unit, the counter decreases, and so it would

take more than one enemy-kill, to let it become activated

again (just for info).

This is a problem, we can sort out aswell, once you got

the basic counting to work properly.  wink.gif

Add also a message as third statement to your kill detection

trigger, just for debugging, wether the problem is in the trigger, or in the script.

aP sidechat "one more kill"

gimmie your results - i'll be back online in about 40 mins

(@ work then)

~S~ CD

Share this post


Link to post
Share on other sites

I did what you said, and i get this error when me or Pa kills someone:

'|#|};': Error Invalid Number In Expression

It says that at the top of the screen...

Any idea on what it is?

Anyway ill be going to sleep in 30 mins so i wont be able to reply until the morning ok. Cheers. biggrin.gif

Share this post


Link to post
Share on other sites

OK, if you get this error message, once you or the other

one kills an enemy, you know now, that at least the

condition for the trigger works.

There must be something wrong in your activation field then.

If you can post now exactly, what you have done,

plz copy/paste from trigger to here so that we really can

debug this.

As i said, i've tried it for myself and it works. So there must

be something wrong in your mission.

~S~ CD

Share this post


Link to post
Share on other sites

Cond: rating aP > aPrating

Activ: aPrating=rating aP; [aP] exec "voices.sqs"; aP sideChat "HAHAHA"

Thats for aP, exactly the same for the black ddue, exept i changed the name from aP to Pa.

Also that init trigger or whatever you said it was looks like this:

Cond: This

Activation: aPrating=rating aP; Parating=rating Pa

There. Anyway im going to bed, so ill check it tomorrow morning matey biggrin.gifbiggrin.gifbiggrin.gif

Also all the triggers have no radiuses.

Share this post


Link to post
Share on other sites

OK, i think i've found the error.

It's in the init trigger.

If you compare my init trigger with yours, then you will see,

that my condition is: true, and your's is: this.

This means, your variables aren't initialized, and so they aren't

defined to be numeric variables.

Here's what the official comref says about your problems:

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">Variables

Variable must be inicialized before being used. When any uninitialized variable is detected in any expression, the whole expression results nil (undefined value). When undefined value is encountered in field where boolean value is expected, it is converted to false. Variable may be unitialized by assigning it nil value. This effectively destroys variable as if it never existed. <span id='postcolor'>

~S~ CD

Share this post


Link to post
Share on other sites

Ok, THE SOUNDS WORK!!!! And that little sidechat message works for both dudes too, but i still get that message in the top of the screen when i kill someone....

Any idea on what it might be?

Share this post


Link to post
Share on other sites

errm - could i see your scripts again plz,

(i mean, how they are looking like now).

It could be that they gonna need to be changed

for the new 2 scripts situation.

Probably the message comes from the scripts.

~S~ CD

Share this post


Link to post
Share on other sites

_speaker = _this

_sound = random 5

_sound = _sound - (_sound mod 1)

#start

?(_sound == 0) : aP SideRadio "gotem"

?(_sound == 1) : aP SideRadio "heshistory"

?(_sound == 2) : aP SideRadio "killconfirmed"

?(_sound == 3) : aP SideRadio "goodbye"

?(_sound == 4) : aP SideRadio "naildem"

goto "end"

#end

exit

That aP's Script

Heres Pa's, i use a dude out in the middle of no where to say Pa's speech because is Pa dies then the speech can be said by the other team members.

Heres Pa's script:

_speaker = _this

_sound = random 5

_sound = _sound - (_sound mod 1)

#start

?(_sound == 0) : radiodude GlobalRadio "gotem1"

?(_sound == 1) : radiodude GlobalRadio "heshistory1"

?(_sound == 2) : radiodude GlobalRadio "killconfirmed1"

?(_sound == 3) : radiodude GloballRadio "goodbye1"

?(_sound == 4) : radiodude GlobalRadio "naildem1"

goto "end"

#end

exit

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×