OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Corben Dallas on 15 Jun 2005, 10:27:27
-
I'm trying to use General Barron's InforShare (http://www.ofpec.com/editors/resource_view.php?id=608) script to make my loons react when someone near to them gets shot - a major failing in OFP I think.
Anyway, I have all resistance units, and it wasn't working. I searched and found a thread that said put GUER units in to make resistance work, then set the trigger which activates the script to do the same. However, I get an invalid number error with the following line in my init.sqs file:
{[_x, GUER_units, west_units] exec "infoShare.sqs"} foreach GUER_units
if I change it to:
[_x, GUER_units, west_units] exec "infoShare.sqs" foreach GUER_units
I don't get the error, but it doesn't work.
I don't want to understand how the whole thing works, I'd just like it to work so loons aren't so, well, loony.
Personally, I feel that if I can't get the loons to react then it's worthless continuing spending hours and days writing my first mission (which could be reasonably good) - it looks so stupid shooting someone only to have the rest of them all continue and mooch about happily. >:(
Any help very much appreciated.
Edit:
I've just re-read the page at the link above, and was missing this:
knownEnemies = preprocessFile "knownEnemies.sqf"
Mind you, that gives an error - not supported in 1.46?
Is there a simple way to make enemies within say 20 meters go combat if they 'see' or 'hear' someone get shot..?
This is making a mess of my mission, and the only way to make it less unrealistic is to just keep units apart, but then I can't have the mission plot I'm working on...
-
Hm... you won't be able to use functions if you're running 1.46
You could try taking the content of the function (i don't know too much about it, so i could be off the ball a bit here) and converting it for use in your script, but that's a difficult way, plus you need to credit the author (Gen Barron) if you do so, as you no doubt know.
There are lots and lots of things that resistance supports that CWC does not. I was in the same situation as you a while back, trying to work in 1.46. I knew there were quite a few things i was missing out on, but i just kind of ignored them. Later, when I got a copy of resistance, I came to realise all of the things that could be done in res that couldn't in 1.46, and i realised how limited my own stuff was. My advice is try and find a copy of resistance; it's dirt cheap now, and according to various people quite easy to get a hold of.
For the foreach line, try this:
"[_x, GUER_units, west_units] exec ""infoShare.sqs"" " foreach GUER_units
that's how i used to do it before i found out about the curly braces... maybe it's a 1.46 thing.
-
Thanks for that, I'll give it a go.
As to Resistance 1.9x, I binned the CD it annoyed me so much. Some might say that was crazy, but it made my PC slow down horribly, and nothing I could do helped. It just runs too many things in the background, and I didn't see that having pathetic graphic quality just to play 1.9 was worth it. Pehaps next year if I buy a super powered PC I'll get hold of it again.
Edit:
Nope, the code with quotes didn't work.
1.46 doesn't appear to have the AddEventHandler command, which a lot of scripts use. Is there any way around this?
-
You can do soooo much stuff in 1.75+ it's worth it. You're right the graphics didn't make it worth it though.
Resistance runs fine on a Pentium II processor. If you have that or better its just a question of using mod folders, -nomap, low settings and all that good stuff to make it run ok.
-
I run 1.46 in 800x600 on my laptop (P4 2.8ghz, 512mb Ram, 1400x1050 TFT, GeForce Go5200) and it looks fine. Any higher version with all of its background processing, having to drop the graphics until it looks like a Sinclair Spectrum - forget it. I'd rather not play the game.
Incidentally, if anyone runs Res. 1.96 at top resolution with all goodies turned on, maxed out everything, etc., and still running smooth as you like - what the hell kind of PC do you need to do that?! :P
-
what the hell kind of PC do you need to do that?!
HAL 9000, naturally. ;)
-
Stop shooting people Dave. I don't like it when you do that...
Seriously, can anyone run it at full tilt..?
-
Ok, I have an idea - tell me how stupid this is or if it can be done.
How about placing a trigger which checks whenever an east/res unit has been shot, then sets all other units within the trigger range to combat mode. Is that, or something like it, possible?
There must be some way of making the loons in 1.46 more aware, surely..? I swear you could kill some of them with a box of old bagels. What's more, nobody else would even notice.
-
No, nobody can run it at anything like full tilt. Setting the viewdistance to 5000 will crash it for most people.
Your setup is better than average. Stop being so fussy. ;) And look at the middle distance, not the foreground. Best graphics you've ever seen. I've nearly crashed the car more than once because the view was so like OFP.
Your trigger idea is essentially possible. However, by far the easiest way to get what you want is to use eventhandlers.
-
i just yesterday did something similar... let's see now...
create a trigger, whatever dimensions, make it activate on east present. in the 'on activation' field put
east_area1_total = +thislist; east_area1 = thislist
next to it create a trigger, no area, and in the conditional field put
count (east_area1) < count (east_area1_total)
in the 'on activation' field put
{_x setbehaviour "combat"} foreach east_area1
just tested it, and it works just fine ;)
-
How about placing a trigger which checks whenever an east/res unit has been shot, then sets all other units within the trigger range to combat mode. Is that, or something like it, possible?
http://www.ofpec.com/editors/resource_view.php?id=686
-
Many thanks for those ideas/links. I'll try them out in a few minutes. I think if I got the loons to be more AI I'd be happier spending time making missions. As it is it's kind of;
"Oooh, Brian just blew up! Well, who'd have thought it."
"Yeah, happens. Let's walk over there..."
Oh, and yes I am fussy with the game. It's not so much the actual frame rate (as long as I can run it high to stop lurrrghhh) - it's more the sudden slow down when things start happening. Why have a P4 with a resonable spec and have it feel like playing on an old box? I only play OFP - nothing else - and I like it smooth, loud and with bits of things going all over the place. Heck, half the fun of making a mission is seeing what happens when I change the BlackOp for an AT and whap the UAZ and surrounding folks with something big and loud.
Edit:
In fact, I want an Old Testament mod with Moses in flowing robes, sheeps and shepherds, etc., so I can try the Armageddon Falling Comets script I saw somewhere. ;D
Edit too:
Just had a thought. My son is in the Paras, and has been filling me in on some of the kit they use. Basically, everyone in a battle area gets to know what's going on right away (assuming all is working ok). So, it seems to me that what I want is a very simple script which when any oppo unit is shot just sets the entire lot to combat mode. After all, that's pretty much what would happen.
-
Ok, can anyone help turn my simple description into code? It's got to be easy this way, and shouldn't laaaag either:
1. Trigger covering whole of map. Calls script whenever East/Resistance present.
2. Script.
if global time_count < 20 exit
increment time_count
check all east/res units
if any in "combat"
set all others to aware
exit
That way it'd work in 1.46, and all units would go combat quickly after any of them were shot, just as if someone had radioed that they were under attack. It doesn't say where you are, just that shots have been fired so keep your heads down.
I can't code it though. :-[
Edit three: Better would be:
if global time_count < 20 exit
increment time_count
check all east/res units
if any in "combat"
if others within 100 yards
set them to aware
exit
I'm going to try and code this. You may hear from me again by next Christmas. 8)
Ok, the trigger exists, detects Resistance repeatedly, and calls a script. The script is called "warnfriends.sqs". All I need to do now is put some code in it... ::)
-
I tried your doube trigger way bedges, but 1.46 doesn't like this:
{_x setbehaviour "combat"} foreach east_area1
It errors on the curly bracket. I've tried removing it, but then it errors on 'local variable _x'. Quotes instead of {} don't seem to work either. ???
-
1.46 doesn't know what to do with braces (ie, you can't use them at all!).
You'll need to use a double set of double quotes, like so:
"_x setbehaviour ""combat""" foreach east_area1
Note that there's one set at the start of the line, two sets at the start of combat and three sets at the end of combat. Nice and confusing... ;D
-
Thanks - that works! Good tip about the quotes/doubles, etc.
One thing though, they all see me right away now, and I only want this trigger to fire when someone goes down. I guessed that this bit:
east_area1_total = +thislist; east_area1 = thislist
was adding 1 to the count in thisList (?) and took the plus off, but then it failed. So I set the second trigger to repeat, but that doesn't help.
How can I set it so that it checks the units against the total units and fires the 'warn everybody' trigger only when someone is shot? (Gawd, I'm still having trouble with the basics).
-
Darn it - I just can't get the hang of this script/trigger business at all.
I'm now trying the GroupChain script at http://www.ofpec.com/editors/resource_view.php?id=686, but I don't know what he means by "Initialise your groups first with the GROUP command"..?
I've tried running it from a start-up trigger with [thisList] exec "groupchain.sqs" but it errors and says Group or Object expected.
Darnit >:(
Edit: Yay!! :)
Did something right. Gave my units names and passed them to the script as it said to, and it works. (Funny that...) No more loons.
Thanks to all - I can now carry on with the rest of it as it makes sense to play.
-
just to clarify, the +thislist bit gets a static total of units within the trigger. thislist on its own (without the '+') will continue to dynamically update according to the number within the trigger.
the second trigger simply checked if the numbers were equal, and if not, raised the alarm.
-
That makes more sense now. However, as soon as I ran the mission the alarm was raised, and I hadn't done anything, which is why I wondered about the math conditions...