Home   Help Search Login Register  

Author Topic: Needed some answers for scripting  (Read 3996 times)

0 Members and 1 Guest are viewing this topic.

Offline X75TIGER75X

  • Members
  • *
Re: Needed some answers for scripting
« Reply #15 on: 28 Dec 2008, 04:29:10 »
Okay, My brain cramps for a bit. You mean I could put game logic in building, make it function as trigger and detect unit entering from floor or room.
So, how can I make game logic sends message to the trigger and give it a "go" as Unit is inside the # radius?

What should I put trigger condition as? and How make Game Logic function like "trigger" with # detecting radius?
« Last Edit: 28 Dec 2008, 04:59:08 by X75TIGER75X »

Offline Deadfast

  • Members
  • *
Re: Needed some answers for scripting
« Reply #16 on: 28 Dec 2008, 10:41:40 »
No, he means that you could put a logic inside a building and use it as a point to measure distances from.

So a standard way of using distance with triggers applies:
Code: [Select]
Condition: unit1 distance logic1 < 5

Offline X75TIGER75X

  • Members
  • *
Re: Needed some answers for scripting
« Reply #17 on: 28 Dec 2008, 18:25:44 »
I tried to use yours, I don't think its working properly. I tried tweak the number. Didn't work. Tried do changing < to > didn't work, tried =, it says something is missing.

 :(

EDIT: IT WORKS! I found out what's causing this problem. I put gamelogic init field as
Code: [Select]
this MOVE (b1 buildingPos 27) now I changed it to
Code: [Select]
this setpos (b1 buildingPos 27)
now it works! Thanks Everyone!

EDIT1: By the way, How do you make unit as general unit not specific?
« Last Edit: 28 Dec 2008, 18:33:13 by X75TIGER75X »

Offline X75TIGER75X

  • Members
  • *
Re: Needed some answers for scripting
« Reply #18 on: 10 Jan 2009, 00:46:24 »
Sorry for bumping this thread. I still got some questions.

Quote
How do you change unit1 like this
Code: [Select]
unit1 distance logic1 < 5to generic, could be any unit
-OR-
list of specified units, if one of them appears to be true, trigger exec. How do I do that?

Quote
How do you make everything to freeze so camera script can start without doing nothing? Setacctime=0 did not work, it just freeze/slow camera too. Would be nice if you tell me how to freeze specified side and units too if that is possible.

Quote
How do you temporarily make side or unit disappear in script? Then enable them back to same location they disappeared.
« Last Edit: 10 Jan 2009, 00:50:04 by X75TIGER75X »

Offline Worldeater

  • Former Staff
  • ****
  • Suum cuique
Re: Needed some answers for scripting
« Reply #19 on: 10 Jan 2009, 01:12:44 »
About the freeze question:
I stumbled across the Time Paradox thread yesterday. It might be worth a look.
try { return true; } finally { return false; }

Offline X75TIGER75X

  • Members
  • *
Re: Needed some answers for scripting
« Reply #20 on: 11 Jan 2009, 03:34:08 »
*bump*

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Needed some answers for scripting
« Reply #21 on: 11 Jan 2009, 09:44:27 »
Worldeater already answered to your stop-time question.
To make a unit/units disappear you might move them to a different position. For example, a script that, using a trigger, gets the list of units of side X, then this script, using a tight look, places everything in that list at its current position but with a Z = 4000 + unit current height meters. When a condition is met, the loop exits and places all the units at its current X,Z and a Z = current height - 4000.