Home   Help Search Login Register  

Author Topic: @ or Loop need more effort?  (Read 588 times)

0 Members and 1 Guest are viewing this topic.

gundernak

  • Guest
@ or Loop need more effort?
« on: 15 Jan 2004, 20:57:55 »
Hi all,

I would like to know which method needs more cpu resource (even if I have so many checks):

@ mycondition
myConsequence


or


#loop
? mycondition: goto "here"
goto "loop"

#here
myConsequence



thanks in advance

m21man

  • Guest
Re:@ or Loop need more effort?
« Reply #1 on: 15 Jan 2004, 21:00:23 »
I'd try to use an eventhandler. If not, I'd use the @.

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:@ or Loop need more effort?
« Reply #2 on: 15 Jan 2004, 21:05:40 »
It depends what you are trying to do in your script.

If you want the script to check multiple variables, then I'd use a loop.  If you only want the script to wait until a certain condition is true, then I'd use an @.
« Last Edit: 15 Jan 2004, 21:15:15 by [icarus_uk] »

m21man

  • Guest
Re:@ or Loop need more effort?
« Reply #3 on: 15 Jan 2004, 21:11:04 »
Quote
If you want the script to check multiple variables, then I'd use a loop.  If you only want the script to wait until a certain condition is true, then I'd use a loop.
:hmm:

Offline icarus_uk

  • Members
  • *
  • LiarLiarPants Inflame True
    • [furryclan]
Re:@ or Loop need more effort?
« Reply #4 on: 15 Jan 2004, 21:15:33 »
I dont know what you're talking about  :P

m21man

  • Guest
Re:@ or Loop need more effort?
« Reply #5 on: 15 Jan 2004, 21:17:38 »
Post changer! ::)

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:@ or Loop need more effort?
« Reply #6 on: 15 Jan 2004, 21:27:51 »
@ will check the condition each 0.5 seconds, just like a trigger does. If you don't need it checked that fast, go with the loop and add a delay in it.
The straight forward answer to your question would be

Code: [Select]
@ mycondition
myConsequence
This is processed every 0.5 seconds.

Code: [Select]
#loop
? mycondition: goto "here"
goto "loop"
This is processed as fast as your computer can and needs (and uses) as much resources from your computer as it gets. Terrible.

Code: [Select]
#loop
? mycondition: goto "here"
~1
goto "loop"
This would be the best way when you think about saving your computer resources. It's looped every 1 seconds, so it's even better than the @ statement.. if it suits your needs.


Oh and it makes no difference wether your checking multiple variables or not. The @ statement isn't suitable for as many things as a loop is, but you can check multiple variables and conditions with the @.

@!(alive (leader mygroup)) || myunit distance enemyunit > 300 && myvariable  :P
« Last Edit: 15 Jan 2004, 21:31:09 by Artak »
Not all is lost.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:@ or Loop need more effort?
« Reply #7 on: 15 Jan 2004, 21:30:09 »
Quote
I dont know what you're talking about

m21man means: whatever you wanna do, you'd use a loop

check yer own post m8  ;D

::edit -  :o post changer  >:(  :)

@gundernak:

@condition - is the most cpu stressing method, as the check
for given condition will happen during every single frame
(said by SUMA)

off course a loop without any time delay is almost the same

a loop with a delay of 1 second is not really stressing the cpu

a trigger would check about: every (from 0.3 to 0.5)th second,
depending on speed of the cpu, based upon various experiences by different mission makers

solved???

:edit - u see Artak - i'm not that bad guy - i've let ya the first
move this time - lol

~S~ CD
« Last Edit: 15 Jan 2004, 21:36:27 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:@ or Loop need more effort?
« Reply #8 on: 15 Jan 2004, 21:32:44 »
Really? I was under the impression that it's the same as a trigger, every 0.5 seconds.  :o

[edit]
lol
« Last Edit: 15 Jan 2004, 21:33:07 by Artak »
Not all is lost.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:@ or Loop need more effort?
« Reply #9 on: 15 Jan 2004, 22:34:33 »
My understanding of the situtation is this:-


@condition                              - polls every frame

Triggers
   Condition:   this                   - polls every 0.3s - 0.5s
   Condition:   anything else    - polls every frame

Loop                                        - user specified

Plenty of reviewed ArmA missions for you to play

gundernak

  • Guest
Re:@ or Loop need more effort?
« Reply #10 on: 16 Jan 2004, 00:24:23 »
Thanks guys,

It was rather detailed.  ;)
Really appriciated  :)