Home   Help Search Login Register  

Author Topic: My Love-Hate Relationship With OFP.  (Read 678 times)

0 Members and 1 Guest are viewing this topic.

Kinnon

  • Guest
My Love-Hate Relationship With OFP.
« on: 23 Apr 2003, 18:13:27 »
It's so infuriating.

The game is so good.

Being able to script is brilliant.

BUT I NEED MORE INFORMATION !!!

WHY - do my variables end up being nulls for NO APPARENT REASON.

WHY - does a simple loop counting from one to ten jump all over the place for NO APPARENT REASON.

WHY - if i write code to loop until a simple condition is met does it leave the loop before the condition is met FOR NO APPARENT REASON.

I've coded 6502/68000 assembly-language, Visual Basic, Delphi and C++ - I KNOW WHAT I'M DOING BUT I DON'T KNOW WHAT'S HAPPENING.

PLEASE - WHAT IS HAPPENING ?
PLEASE - WHO KNOWS WHAT'S GOING ON INSIDE OFP ?
PLEASE - IF YOU CAN'T TELL ME THEN JUST SHOOT ME.

thx

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:My Love-Hate Relationship With OFP.
« Reply #1 on: 23 Apr 2003, 19:18:27 »
mebe if u post example mision - nd da scripts - we cud take a look :P

but if u dont da only thin we wil do is 2 shot u ::)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:My Love-Hate Relationship With OFP.
« Reply #2 on: 23 Apr 2003, 20:27:06 »
dinger dotarget kinnon
dinger dofire "G36a"
Dinger/Cfit

Kinnon

  • Guest
Re:My Love-Hate Relationship With OFP.
« Reply #3 on: 23 Apr 2003, 20:50:45 »
Oh you funny guys ;+}

Here's an example.

The trigger.

A trigger covering the whole map and activated by west on the condition that gwEnemyScanActive = false makes gwEnemy = thislist.

The code.

gwEnemyScanActive = true

~1 (or 2 or 5 or 10, doesn't matter how long i wait.)

_i = 0

#loop

_enemy = gwEnemy select _i

etc ...

Trouble is, even though there are over 50 enemies on the map, _enemy always ends up being null.

I even through in a condition saying "if (_enemy == _null) then {goto "loop"}' and the damn thing jumps the condition even though it's still null.

Shoot me again ???

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:My Love-Hate Relationship With OFP.
« Reply #4 on: 23 Apr 2003, 21:20:02 »
condtion

Quote
gwEnemyScanActive = false

u cant use dat as condition ::)

gwEnemyScanActive = true

it doesnt activate if it waits 4 it 2 b false

:P

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Kinnon

  • Guest
Re:My Love-Hate Relationship With OFP.
« Reply #5 on: 23 Apr 2003, 22:24:16 »
Yes it does.

A condition is a condition, i could wait for it to equal "custard" if i wanted it to.

Anyway it works now, strangely, i ran the script first instead of last and it works ...

thx though :)

Condition = '!gwEnemyScanActive'

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:My Love-Hate Relationship With OFP.
« Reply #6 on: 23 Apr 2003, 23:47:26 »
Quote
Condition = '!gwEnemyScanActive'



i was thinkin u put

gwEnemyScanActive = false  in da condition ::) - i know u can use da not somthin ;D ;)

LCD OUT
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Kinnon

  • Guest
Re:My Love-Hate Relationship With OFP.
« Reply #7 on: 24 Apr 2003, 20:55:05 »
Same thing Dood, as long as the conditional statement is true, ie; it is true that gwEnemyScanActive is false ...

Offline Dinger

  • Contributing Member
  • **
  • where's the ultra-theoretical mega-scripting forum
Re:My Love-Hate Relationship With OFP.
« Reply #8 on: 24 Apr 2003, 21:45:09 »
the trigger should be "Repeatedly", since arrays are indexed.  Otherwise, the moment you turn the trigger off, you may lose the array associated with it.
and the activation execs the code? Or are they separate?
Also not that OFP uses a three-valued logic, and GWEnemyScanActive is by default undefined, not false.  So the trigger won't fire until you set GWEnemyScanActive to false.
Dinger/Cfit

Kinnon

  • Guest
Re:My Love-Hate Relationship With OFP.
« Reply #9 on: 25 Apr 2003, 00:29:01 »
Yup, the trigger is set to repeat.
Activation is just 'gwEnemy = thislist'

But no, i didn't predefine gwEnemyScanActive, thx for that Dinger :)

I've solved it now, anyhow, after Spinor telling me 99.9% of errors are human - and he was of course right. I had a few spelling mistakes and a couple of logical errors.

Trouble is it takes twenty seconds or so before the arrays linked to triggers are properly populated, it's not an actual problem but i'm a perfectionist control-freak so ... ;+}

Been browsing CoC website, interesting to see Denoir is into nn's, is this for use with OFP ? Also is he interested in genetic algorithms ? I used to be mad on them, i wrote one that solved the travelling-salesman problem more efficiently than the classical shortest-path algorithm once, they really are amazing. I'm amazed if he's using nn's in OFP, i HAVE to see it :)





Offline DrStrangelove

  • Members
  • *
  • Mr.Creative
Re:My Love-Hate Relationship With OFP.
« Reply #10 on: 26 Apr 2003, 13:37:33 »
Problem i see with NNs is that no routine in OpF can 'learn' really because this involves:

a.) trying out lots & lots of different situations
b.) get feedback how good a single situation has been solved
c.) save values of the best solved situations somewhere for later use

Well, I HOPE I'M WRONG ON THIS ONE, but i think OpF can't save custom data and load it during a mission. *remembers*

... hmm how about these campaign stats ? These are saved in files which can be used later, but i don't think this could be done while a MP mission is running, can it ? A learning routine would've to load/save many many values every minute. Even IF it would be possible there's still a potential nettraffic & OpF memory problem.
« Last Edit: 26 Apr 2003, 13:38:16 by DrStrangelove »

Kinnon

  • Guest
Re:My Love-Hate Relationship With OFP.
« Reply #11 on: 26 Apr 2003, 16:44:21 »
CoC's Command Engine has a save-game, and that must be used to save it's various arrays so it probably can be done, i'll have to check ...