OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Dionysos on 09 Apr 2005, 00:59:17
-
I have a rather embarassing problem. The thing is, I want to create a number of sideChats which are triggered when the player enters a camp. More precisely, I have a bunch of triggers set to Resistance-present so that when the resistance is present in the area, the first trigger is activated thus showing the first sideChat message. All the other triggers are the same with a timer so that they all activate in the proper order.
The problem is: When I enter the triggers, nothing happens. No messages, nothing. I am sure the soloution is really simple. Please help me!
-
Uhhh, the unit you are using is a resistance unit, right?
-
Try grouping the unit you want to activate trigger to the trigger.
When you make a bunch of res present triggers sometimes they act funny so grouping the trigger to the unit is more reliable.
-
This sounds obvious, but it might be the problem... ;)
If you have guy1 sidechat "Blah", make sure you actually have a guy called guy1, and that he hasn't been killed. If he's dead, he won't do the message ;)
-
Okay, I modified the triggers so that they are only sensitive to the player. Thanks to this, the first sideChat was successfully activated and displayed. However, the second one is still AWOL. The unit who is supposed to "chat" this message is a friendly soldier on the other side of the island where the are no enemies. I walk into the triggers and the first message, which comes from the player, is activated. However, the second message, which is supposed to come from "hqman" on the other side of Nogova, is nowhere to be seen. What am I doing wrong with "hqman"?
-
What is the condition of the second trigger? Also, have you named the second soldier hqman and made him resistance?
Note:
This would be easier to do in a script. In the first trigger put this in On Activation: [player, hqman] exec "talk.sqs"
Talk.sqs:
_man1 = _this select 0
_man2 = _this select 1
_man1 sidechat "blah blah blah"
~5
_man2 sidechat "blah blah blah"
exit
The "~5" is the time between the two sidechats, change this to what works for you.
If you have any questions about it, ask me and I will gladly help you. If you don't want to use a script, that's fine, I'm simply offering different suggestions.
-
Using a script sounds great! I must confess, I am a real newbie and I would appreciate some help making this?
Will you help me?
-
Well, it's quite easy but extremely efficient. The easiest way is not for us to write 1000 words about scripts, because we'll always forget something. You just head over to the ed depot and read A Friendly Introduction To Code Snippets by our beloved SnYpir, and you should be able to take care of it yourself. If not, try reading the first few pages of Johan Gustavsson's Scripting Tutorial. Actually, I never finished reading that one myself. ;D
:beat: *Gets Shot* :beat:
-
Well, that is the problem... I have read both those tutorials, I really have! But I got confused while trying to use it and even if I read them again, I doubt I could use this particular script to do what I want.
Man, I feel stupid!!!!
-
Will you help me?
I'd be glad to help. If you have any problems incorporating the script, ask, and I (or someone else) will try to help you.
EDIT:
Don't worry about feeling stupid. We all have to learn somewhere.
-
I'm really glad there are skilled people out there who are patient enough to deal with us newbies. I'll try that sqs as soon as I can!
-
sideChat chatText
Operand types:
chatText: String
Type of returned value:
Nothing
Description:
Type text to side radio channel. Note: this function only types text to the list, it does not broadcast the message. If you want the message to show on all computers, you have to execute it on them.
Example:
soldierOne sideChat "Show this text"
Thats from the comRef
-
Flauta, you are confusing me!
-
@Dionysos
why don't you try thisone:
you need:
1 x gamelogic + waypoints
1 x trigger syncronized with the first wayppoint of the game logic
the trigger fires when your guy enters the camp... that causes the gamelogic to activate its waypoints. in each "on activation"field of the gamelogics waypoints you can put your code like yourguy sidechat "yourtext".
with the timout fields of the gamelogics waypoints you can define the time intervals between the messages.
timeout fields explanation:
max = maximum time intervall
min = minimum time intervall
mid = medium time intervall
by inserting identic numbers in each fiel (max,min,mid) the delay will be exactly the way you want it to be. otherwise ofp will create a random delay between max and min parameters.
this has 2 BIG advantages:
first you only need one trigger and second you don't need a additional script.
think about it ;)
-
@vandeveen
this has 2 BIG advantages:
first you only need one trigger and second you don't need a additional script.
While this would certainly work, it has two big disadvantages. For a beginner, this method would be difficult to comprehend, and it is messier in the mission editor. One trigger and one script are cleaner than one trigger, one gamelogic, waypoints for the gamelogic, and the synchronization needed to connect the two. Furthermore, the script is, in my opinion, easier to edit should editing be necessary.
Just my two cents. ;)
-
Nah, for the beginner this is much easier to comprehend. This is the way BIS would do it.
Scripting is really hard, completely new, and (at first) doesn't relate at all to the mission editor. Most people start from a position of wanting to avoid scripts at all costs, not least because the game is designed to used without scripts.
-
I'm about to start crying any second now...
The method with the Game Logic and the waypoints was succesful, almost. All the main characters messages are transmitted and displayed without a hitch. However, "hqman's" messages are still AWOL. It is as if he wasn't there. He is a resistance colonel named "hqman" who is in a town where there are no enemies so there is no way he can be killed.
WHAT IS GOING ON??? ??? >:( :'(
-
If a character is going AWOL, check him out. Play the mission as a test unit watching said colonel and see what happens to him
However, in this case, it sounds like you have spelling mistake or typo somewhere. Check everything again very, very carefully.
-
did you ever get it to work?
-
Okay, I tried to play as a test unit and watched the colonel during the entire mission. Nothing happened to him. Then, the sideChat trigger was triggered.
Guess what?
The message which was AWOL before was displayed but not the other ones.
It is like this:
1. From player
2. From hqman
3. From player
This time, number 2 was displayed but not 1 and 3. This might be because the "player" unit was dead, I don't know. Anyways, why did message number 2 appear this time??
What the **** is going on?
-
Ok take a deep breath. Good news is that it all works at some point. :D
I would take your guys and triggers, logics, waypoints, and whatever else that is related to the sidechat you have, group them together and copy (control "C" for in game copying) and transfer these to Desert island useing in ( pasted by control "V". ) Save it as Sidechat test or what-ever you want. Also go into mission folder and save everything in there execpt for (mission sqm) to the new folder Sidechat Test. This way there is no interference, no enemy.
Now test and see.
It maybe timing error, two triggers going off at once, logic waypoints maybe waiting on another condition.
This is sounds compliacated, but is easy to do and good for bebugging.
-
i'd say figure out how to use a very simple conversation script.
-
I DON'T BELIEVE THIS!!!!!!!
THIS IS ALL A CRUEL JOKE!!!!!
Sharkyjoe, I followed your instructions and actually, everything worked smoothly. All the messages were triggered and displayed perfectly. Using this method, I was able to discover that I had forgot to set the timeout for the last logic waypoint. So I set it and tested it on Desert Island. Then, I went back to the actual mission and set the timeout...
NO DIFFERENCE! THE SECOND MESSAGE IS STILL AWOL IN THE MISSION, AS IF HQMAN IS DEAD OR MISSING! WHAT IS GOING ON!!!!!!!!!!????????
-
@Macguba
I repectfully disagree with you, A few lines of code isn't too hard to understand. But seeing as Dionysos has already done it the BIS way, I won't press the issue.
@Dionysos
Did you change the right timeout? Maybe you set the timeout for the wrong waypoint?
-
I repectfully disagree with you, A few lines of code isn't too hard to understand.
It really all depends on your upbringing. If you are very familiar with triggers and waypoints then that is easier: if you are very familiar with scripts then that is easier.
The most important thing is to get the problem solved. Dionysos, it is almost certainly some stupid little error of spelling or syntax: or something so painfully obvious it is impossible to spot. These things are very frustrating and very hard to find.
OFP does occasionally go a little bit mad, and finding your own mistakes is a difficult task. When I am completely stumped like this I delete the relevant triggers, waypoints and units and carefully recreate them, testing at every stage. It usually works.
If hqman is apparently dead or missing, but in fact is not dead or missing, then you may have spelt his name wrong in his name field or somewhere else. Check yet again.
-
That's it, I surrender! I am defeated!
I can't take this any more! I have been trying for days, following all the instructions from you guys, but I can not do this! Enough! The editor is hell bent on not letting me do this!
I'm just so tired... I want this to work, but I'll have to scrap the mission and start a new one. Thank you all for trying to help! You guys are the best there ever were!
-
Nah, don't give up. Just put it to one side for a couple of weeks then come back to it. With the fresh eye you'll have it working in notime. :)
-
Macguba, what would I do without you? I'm really honored, being coached by the creator of the Un-Impossible mission. Thank you very much! I hope you will be around when I start working on the problem again!
-
dunno if this will be of any use to you, but i hashed together a missionette to show you how the scripting side would work. it's the very bare necessities so you can see what's going on.
i did also notice that if you define someone's radio with the
radioname = [WEST, "HQ"]
command, as a side other than the side which you want to hear the sidechat, it won't appear.
so for example, both characters in the sample mission are resistance. i defined one as west and true to your problem, his sidechats didn't show. but by using
radioname = [RESISTANCE, "HQ"]
there they were.
i've left that part out though, as it needlessly complicates things. i confess i've seldom used sidechats, so i don't know about getting different colours and suchlike, but hopefully this will help. i know how infuriating and frustrating these things can be, so hang in there ;)