Home   Help Search Login Register  

Author Topic: My Scripting Thread  (Read 3219 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: My Scripting Thread
« Reply #15 on: 14 Aug 2006, 17:52:45 »
Look out for Chris's OFP Script editor. It checks most syntax for you (but doesn't check if your combinations created are valid ;-) ). You should find it here on ofpec.com somewhere.

Offline nominesine

  • Former Staff
  • ****
  • I'm NOT back!
    • The IKB Forum
Re: My Scripting Thread
« Reply #16 on: 14 Aug 2006, 22:56:30 »
There's also a very useful program called eVolved, a text editor that can learn to recognize all sorts of code, and hence show you if you are using existing commands or making up erroneous ones by accident. It doesn't teach you how to script, but it's very useful for proof reading scripts that you are making or downloading.

It's for free and you will find it here.

You have to teach eVolved to recognize ofp commands, but thats easy. There's a folder in eVolved that's called keywords. Put the files from my attached zip inside the keyword folder of eVolved, once you have downloaded and installed the eVolved program itself and OFP scripting will be much easier.

EDIT: Corrected my infamous english grammar/spelling a little  :-X
« Last Edit: 14 Aug 2006, 22:58:47 by nominesine »
OFPEC | Intel Depot
RETARDED Ooops... Retired!

Javito

  • Guest
Re: My Scripting Thread
« Reply #17 on: 16 Aug 2006, 20:16:53 »
Okay, I'll tell you all about the wall I've run into. I have a sequence of groups moving around to preset waypoints. In the midst of that sequence I'm trying to include a loop which will be activated when a soldier gets close enough to a certain object. And this loop can activate at -any- time during said sequence.

Now the problem is that I have something like this

leader group1 move getPos Barn
leader group2 move getPos May
#loop
? (Bee distance Joe < 5) : goto "Continue"
~.01
goto "loop"
leader group2 move getpos james
#continue
hint "Oh crap!"

The problem is that I want the loop to be able to activate at -any- time while the groups are in motion, and from what I've seen it instead stops at the #loop and forever continues testing that variable until it becomes true, then goes to continue like I have written. And I don't know how to make it so that #continue can activate at -any- time... before group1 reaches its waypoint, after, before or after group2 reaches its waypoint, etc... and if it is -not- activated then I want the groups to continue their movements without any interference. In this case "continue" may never be active, but if it -is- I want it to happen at any time. And I'm just unsure how to accomplish that.  :banghead:

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re: My Scripting Thread
« Reply #18 on: 16 Aug 2006, 20:28:32 »
Two points:
1. This is a different question so I suggest you use a new thread (in future) :)
2.  From a quick read it sounds like you might need to use a switch trigger.  Have a look at this thread:

http://www.ofpec.com/forum/index.php?topic=27843.0

Must rush

Javito

  • Guest
Re: My Scripting Thread
« Reply #19 on: 16 Aug 2006, 20:44:32 »
D'OH. I've gotten so used to scripting since I started last Saturday that I've forgotten all about doing things the old fashioned way with triggers.