Page 2 of 4

Posted: Tue Nov 16, 2004 9:10 pm
by HDL_CinC_Dragon
Yes, it is MOHAA not BT or SH
I never needed that roundbased stuff.

$fan1 time 5 //this line is redundant
$fan2 time 2 //this line is redundant
$fan3 time 2 //this line is redundant
What do you mean by those lines being redundant?
(I know what redundant means but i dont know what u mean by it being redundant)

The lift sound wont work because you have no workaround for that (singleplayer only) sound alias.
What do you mean? the sound i have is a stock sound for MOHAA

I never use prespawns, porecaches, other scripts for one map. All my scripting for a map is done all in one script. No shaders, no... other script. Never have.

What do u mean different targetnames? Every different object i have has its own targetname. Like, a fan with fan blades and the origin. I just select the fan center, fan blades, and the origin when. (when I make fans... this is my first attempt to make fans both vertical and horizontal which is why im putting them in my testing site before using this)

I always do Key: script Value: yadda.scr it always works... I know your trying to give me improvements and all but... i like my old method until i get good at scripting. (i only know up and down movements, text with script, hide - show, remove, and i think thats it. right now im trying to figure out rotating spinning. Next im going for side to side movements which i think are just MoveNorth 60

Here is a very old script of mine and it works fine. Dont even have a "main:" This was when i was learning how to add 2 + 2 (not litterally, i mean the basics)

Code: Select all

Thread B1_Control
$B1 time 10

Thread B2_Control
$B2 time 10

Thread B4_Control
$B4 time 10

Thread B5_Control
$B5 time 10

Thread Axis_sign1_Control
$Axis_sign1 time 3

Thread Axis_sign2_Control
$Axis_sign2 time 3

Thread Allied_sign1_Control
$Allied_sign1 time 3

Thread Allied_sign2_Control
$Allied_sign2 time 3

Thread Allied_Door_Control1
$Allied_Door1 time 2
$Allied_Door3 time 2
$Allied_Door5 time 2

Thread Allied_Door_Control2
$Allied_Door2 time 2
$Allied_Door4 time 2
$Allied_Door6 time 2

Thread Axis_Door_Control1
$Axis_Door1 time 2
$Axis_Door3 time 2
$Axis_Door5 time 2

Thread Axis_Door_Control2
$Axis_Door2 time 2
$Axis_Door4 time 2
$Axis_Door6 time 2

Thread Allied_Door_Control3
$Allied_Door1 time 2
$Allied_Door3 time 2
$Allied_Door5 time 2

Thread Allied_Door_Control4
$Allied_Door2 time 2
$Allied_Door4 time 2
$Allied_Door6 time 2

Thread Axis_Door_Control3
$Axis_Door1 time 2
$Axis_Door3 time 2
$Axis_Door5 time 2

Thread Axis_Door_Control4
$Axis_Door2 time 2
$Axis_Door4 time 2
$Axis_Door6 time 2

B1_Control: 

$S1 waittill trigger
$S1 nottriggerable
$B1 loopsound lighthouse_run 
$B1 moveup 352 
$B1 waitmove 
$B1 stoploopsound 
$S1 triggerable

$S1 waittill trigger
$S1 nottriggerable
$B1 loopsound lighthouse_run 
$B1 movedown 352 
$B1 waitmove 
$B1 stoploopsound 
$S1 triggerable

goto B1_Control 
end

B2_Control: 

$S2 waittill trigger
$S2 nottriggerable
$B2 loopsound lighthouse_run 
$B2 moveup 352 
$B2 waitmove 
$B2 stoploopsound 
$S2 triggerable

$S2 waittill trigger
$S2 nottriggerable
$B2 loopsound lighthouse_run 
$B2 movedown 352 
$B2 waitmove 
$B2 stoploopsound 
$S2 triggerable

goto B2_Control 
end

B4_Control: 

$S4 waittill trigger
$S4 nottriggerable
$B4 loopsound lighthouse_run 
$B4 moveup 352 
$B4 waitmove 
$B4 stoploopsound 
$S4 triggerable

$S4 waittill trigger
$S4 nottriggerable
$B4 loopsound lighthouse_run 
$B4 movedown 352 
$B4 waitmove 
$B4 stoploopsound 
$S4 triggerable

goto B4_Control 
end

B5_Control: 

$S5 waittill trigger
$S5 nottriggerable
$B5 loopsound lighthouse_run 
$B5 moveup 352 
$B5 waitmove 
$B5 stoploopsound 
$S5 triggerable

$S5 waittill trigger
$S5 nottriggerable
$B5 loopsound lighthouse_run 
$B5 movedown 352 
$B5 waitmove 
$B5 stoploopsound 
$S5 triggerable

goto B5_Control 
end

B3_Switch_Control:

$S3 waittill trigger
$S3 nottriggerable
$S3 loopsound lighthouse_run

wait 5

$S3 stoploopsound 
$S3 triggerable

goto B3_Switch_Control
end

Axis_sign1_Control:

$AAS1 waittill trigger
$AAS1 nottriggerable
$Axis_sign1 loopsound lighthouse_run 
$Axis_sign1 movedown 200
$Axis_sign1 waitmove 
$Axis_sign1 stoploopsound 
wait 3
$Axis_sign1 loopsound lighthouse_run 
$Axis_sign1 moveup 200
$Axis_sign1 waitmove 
$Axis_sign1 stoploopsound
wait 7
$AAS1 triggerable

goto Axis_sign1_Control
end

Axis_sign2_Control:

$AAS2 waittill trigger
$AAS2 nottriggerable
$Axis_sign2 loopsound lighthouse_run 
$Axis_sign2 movedown 200
$Axis_sign2 waitmove 
$Axis_sign2 stoploopsound 
wait 3
$Axis_sign2 loopsound lighthouse_run 
$Axis_sign2 moveup 200
$Axis_sign2 waitmove 
$Axis_sign2 stoploopsound
wait 7
$AAS2 triggerable

goto Axis_sign2_Control
end

Allied_sign1_Control:

$AS1 waittill trigger
$AS1 nottriggerable
$Allied_sign1 loopsound lighthouse_run 
$Allied_sign1 movedown 200
$Allied_sign1 waitmove 
$Allied_sign1 stoploopsound 
wait 3
$Allied_sign1 loopsound lighthouse_run 
$Allied_sign1 moveup 200
$Allied_sign1 waitmove 
$Allied_sign1 stoploopsound
wait 7
$AS1 triggerable

goto Allied_sign1_Control
end

Allied_sign2_Control:

$AS2 waittill trigger
$AS2 nottriggerable
$Allied_sign2 loopsound lighthouse_run 
$Allied_sign2 movedown 200
$Allied_sign2 waitmove 
$Allied_sign2 stoploopsound 
wait 3
$Allied_sign2 loopsound lighthouse_run 
$Allied_sign2 moveup 200
$Allied_sign2 waitmove 
$Allied_sign2 stoploopsound
wait 7
$AS2 triggerable

goto Allied_sign2_Control
end

Allied_Door_Control1:
$Allied_Door_Control1 waittill trigger
$Allied_Door_Control1 nottriggerable
$Allied_Door_Control3 nottriggerable
$Allied_Door1 loopsound lighthouse_run
$Allied_Door1 moveup 127
$Allied_Door1 waitmove
$Allied_Door1 stoploopsound
$Allied_Door3 loopsound lighthouse_run
$Allied_Door3 moveup 127
$Allied_Door3 waitmove
$Allied_Door3 stoploopsound
$Allied_Door5 loopsound lighthouse_run
$Allied_Door5 moveup 127
$Allied_Door5 waitmove
$Allied_Door5 stoploopsound

wait 10

$Allied_Door1 loopsound lighthouse_run
$Allied_Door1 movedown 127
$Allied_Door1 waitmove
$Allied_Door1 stoploopsound
$Allied_Door3 loopsound lighthouse_run
$Allied_Door3 movedown 127
$Allied_Door3 waitmove
$Allied_Door3 stoploopsound
$Allied_Door5 loopsound lighthouse_run
$Allied_Door5 movedown 127
$Allied_Door5 waitmove
$Allied_Door5 stoploopsound
$Allied_Door_Control1 triggerable
$Allied_Door_Control3 triggerable

goto Allied_Door_Control1
end

Allied_Door_Control2:
$Allied_Door_Control2 waittill trigger
$Allied_Door_Control2 nottriggerable
$Allied_Door_Control4 nottriggerable
$Allied_Door2 loopsound lighthouse_run
$Allied_Door2 moveup 127
$Allied_Door2 waitmove
$Allied_Door2 stoploopsound
$Allied_Door4 loopsound lighthouse_run
$Allied_Door4 moveup 127
$Allied_Door4 waitmove
$Allied_Door4 stoploopsound
$Allied_Door6 loopsound lighthouse_run
$Allied_Door6 moveup 127
$Allied_Door6 waitmove
$Allied_Door6 stoploopsound

wait 10

$Allied_Door2 loopsound lighthouse_run
$Allied_Door2 movedown 127
$Allied_Door2 waitmove
$Allied_Door2 stoploopsound
$Allied_Door4 loopsound lighthouse_run
$Allied_Door4 movedown 127
$Allied_Door4 waitmove
$Allied_Door4 stoploopsound
$Allied_Door6 loopsound lighthouse_run
$Allied_Door6 movedown 127
$Allied_Door6 waitmove
$Allied_Door6 stoploopsound
$Allied_Door_Control2 triggerable
$Allied_Door_Control4 triggerable

goto Allied_Door_Control2
end

Allied_Door_Control3:
$Allied_Door_Control3 waittill trigger
$Allied_Door_Control3 nottriggerable
$Allied_Door_Control1 nottriggerable
$Allied_Door5 loopsound lighthouse_run
$Allied_Door5 moveup 127
$Allied_Door5 waitmove
$Allied_Door5 stoploopsound
$Allied_Door3 loopsound lighthouse_run
$Allied_Door3 moveup 127
$Allied_Door3 waitmove
$Allied_Door3 stoploopsound
$Allied_Door1 loopsound lighthouse_run
$Allied_Door1 moveup 127
$Allied_Door1 waitmove
$Allied_Door1 stoploopsound

wait 10

$Allied_Door5 loopsound lighthouse_run
$Allied_Door5 movedown 127
$Allied_Door5 waitmove
$Allied_Door5 stoploopsound
$Allied_Door3 loopsound lighthouse_run
$Allied_Door3 movedown 127
$Allied_Door3 waitmove
$Allied_Door3 stoploopsound
$Allied_Door1 loopsound lighthouse_run
$Allied_Door1 movedown 127
$Allied_Door1 waitmove
$Allied_Door1 stoploopsound
$Allied_Door_Control3 triggerable
$Allied_Door_Control1 triggerable

goto Allied_Door_Control3
end

Allied_Door_Control4:
$Allied_Door_Control4 waittill trigger
$Allied_Door_Control4 nottriggerable
$Allied_Door_Control2 nottriggerable
$Allied_Door6 loopsound lighthouse_run
$Allied_Door6 moveup 127
$Allied_Door6 waitmove
$Allied_Door6 stoploopsound
$Allied_Door4 loopsound lighthouse_run
$Allied_Door4 moveup 127
$Allied_Door4 waitmove
$Allied_Door4 stoploopsound
$Allied_Door2 loopsound lighthouse_run
$Allied_Door2 moveup 127
$Allied_Door2 waitmove
$Allied_Door2 stoploopsound

wait 10

$Allied_Door2 loopsound lighthouse_run
$Allied_Door2 movedown 127
$Allied_Door2 waitmove
$Allied_Door2 stoploopsound
$Allied_Door4 loopsound lighthouse_run
$Allied_Door4 movedown 127
$Allied_Door4 waitmove
$Allied_Door4 stoploopsound
$Allied_Door6 loopsound lighthouse_run
$Allied_Door6 movedown 127
$Allied_Door6 waitmove
$Allied_Door6 stoploopsound
$Allied_Door_Control4 triggerable
$Allied_Door_Control2 triggerable

goto Allied_Door_Control4
end

Axis_Door_Control1:
$Axis_Door_Control1 waittill trigger
$Axis_Door_Control1 nottriggerable
$Axis_Door_Control3 nottriggerable
$Axis_Door1 loopsound lighthouse_run
$Axis_Door1 moveup 127
$Axis_Door1 waitmove
$Axis_Door1 stoploopsound
$Axis_Door3 loopsound lighthouse_run
$Axis_Door3 moveup 127
$Axis_Door3 waitmove
$Axis_Door3 stoploopsound
$Axis_Door5 loopsound lighthouse_run
$Axis_Door5 moveup 127
$Axis_Door5 waitmove
$Axis_Door5 stoploopsound

wait 10

$Axis_Door1 loopsound lighthouse_run
$Axis_Door1 movedown 127
$Axis_Door1 waitmove
$Axis_Door1 stoploopsound
$Axis_Door3 loopsound lighthouse_run
$Axis_Door3 movedown 127
$Axis_Door3 waitmove
$Axis_Door3 stoploopsound
$Axis_Door5 loopsound lighthouse_run
$Axis_Door5 movedown 127
$Axis_Door5 waitmove
$Axis_Door5 stoploopsound
$Axis_Door_Control1 triggerable
$Axis_Door_Control3 triggerable

goto Axis_Door_Control1
end

Axis_Door_Control2:
$Axis_Door_Control2 waittill trigger
$Axis_Door_Control2 nottriggerable
$Axis_Door_Control4 nottriggerable
$Axis_Door2 loopsound lighthouse_run
$Axis_Door2 moveup 127
$Axis_Door2 waitmove
$Axis_Door2 stoploopsound
$Axis_Door4 loopsound lighthouse_run
$Axis_Door4 moveup 127
$Axis_Door4 waitmove
$Axis_Door4 stoploopsound
$Axis_Door6 loopsound lighthouse_run
$Axis_Door6 moveup 127
$Axis_Door6 waitmove
$Axis_Door6 stoploopsound

wait 10

$Axis_Door2 loopsound lighthouse_run
$Axis_Door2 movedown 127
$Axis_Door2 waitmove
$Axis_Door2 stoploopsound
$Axis_Door4 loopsound lighthouse_run
$Axis_Door4 movedown 127
$Axis_Door4 waitmove
$Axis_Door4 stoploopsound
$Axis_Door6 loopsound lighthouse_run
$Axis_Door6 movedown 127
$Axis_Door6 waitmove
$Axis_Door6 stoploopsound
$Axis_Door_Control2 triggerable
$Axis_Door_Control4 triggerable

goto Axis_Door_Control2
end

Axis_Door_Control3:
$Axis_Door_Control3 waittill trigger
$Axis_Door_Control3 nottriggerable
$Axis_Door_Control1 nottriggerable
$Axis_Door5 loopsound lighthouse_run
$Axis_Door5 moveup 127
$Axis_Door5 waitmove
$Axis_Door5 stoploopsound
$Axis_Door3 loopsound lighthouse_run
$Axis_Door3 moveup 127
$Axis_Door3 waitmove
$Axis_Door3 stoploopsound
$Axis_Door1 loopsound lighthouse_run
$Axis_Door1 moveup 127
$Axis_Door1 waitmove
$Axis_Door1 stoploopsound

wait 10

$Axis_Door5 loopsound lighthouse_run
$Axis_Door5 movedown 127
$Axis_Door5 waitmove
$Axis_Door5 stoploopsound
$Axis_Door3 loopsound lighthouse_run
$Axis_Door3 movedown 127
$Axis_Door3 waitmove
$Axis_Door3 stoploopsound
$Axis_Door1 loopsound lighthouse_run
$Axis_Door1 movedown 127
$Axis_Door1 waitmove
$Axis_Door1 stoploopsound
$Axis_Door_Control3 triggerable
$Axis_Door_Control1 triggerable

goto Axis_Door_Control3
end

Axis_Door_Control4:
$Axis_Door_Control4 waittill trigger
$Axis_Door_Control4 nottriggerable
$Axis_Door_Control2 nottriggerable
$Axis_Door6 loopsound lighthouse_run
$Axis_Door6 moveup 127
$Axis_Door6 waitmove
$Axis_Door6 stoploopsound
$Axis_Door4 loopsound lighthouse_run
$Axis_Door4 moveup 127
$Axis_Door4 waitmove
$Axis_Door4 stoploopsound
$Axis_Door2 loopsound lighthouse_run
$Axis_Door2 moveup 127
$Axis_Door2 waitmove
$Axis_Door2 stoploopsound

wait 10

$Axis_Door6 loopsound lighthouse_run
$Axis_Door6 movedown 127
$Axis_Door6 waitmove
$Axis_Door6 stoploopsound
$Axis_Door4 loopsound lighthouse_run
$Axis_Door4 movedown 127
$Axis_Door4 waitmove
$Axis_Door4 stoploopsound
$Axis_Door2 loopsound lighthouse_run
$Axis_Door2 movedown 127
$Axis_Door2 waitmove
$Axis_Door2 stoploopsound
$Axis_Door_Control4 triggerable
$Axis_Door_Control2 triggerable

goto Axis_Door_Control4
end

Posted: Wed Nov 17, 2004 9:17 am
by jv_map
When a script works it doesn't mean it's good :wink:

For example in the above script you're using thread indentifiers as labels for your gotos, which is very bad practice... it's probably a scripter's worst nightmare :( ... also, I doubt if you noticed it already but you have two instances of the B1_Control: thread running at the same time which may very well cause weird behaviour in the future.

Anyway, I'm not posting this just to annoy you but here's a good advice you just can take :wink: : add some structure to your scripts!

It really helps when you place all the commands in nice clean short threads. Never place any code outside threads. Don't use goto.. force yourself to use while or for loops instead.

If you do the above with dedication, you're a great scripter already :)... as soon as you can make good structured code you can easily learn any other programming language, too.

Syntax errors (like forgetting a $) should never pose a big problem as your console will tell you exactly what the error was and where it occured. When testing a script always study your console carefully because that's where you get the most valuable feedback ;)

Posted: Wed Nov 17, 2004 5:57 pm
by HDL_CinC_Dragon
well like i said, I was still learning the basics on that one =) I try to study peoples scripts when i DL new maps and im always like "well... i think that means... no i dont". I still have a lot to learn though but yeah. Ok, so how would u suggest I rewrite this script? Take out the waitill's and goto's? Should I do setthreads instead of targetnames for my triggers? Should i keep the "thread thread_name" at the top of my scripts?

Posted: Wed Nov 17, 2004 7:02 pm
by jv_map
Ok cool 8-) I'll make you a small example :) ... only containing the Bx_Control threads.

Always start your script like this:

Code: Select all

// maybe put your name here ;)
main:

end
Wow that's nice innit... you'd be surprised how many people forget that 'end' there but now you can no longer make that mistake ;)... you're now ready to start adding code in between:

Code: Select all

main:
  // usually don't need much code above waittill spawn
  level waittill spawn

  // start a thread for each b_control thingy
  thread b_control $S1 $B1
  thread b_control $S2 $B2
  thread b_control $S4 $B4
  thread b_control $S5 $B5

  // can have other stuff here
end


// yay the wonders of code reusal
// only need one bit of code for these 4 threads
// makes your script much shorter and easier to debug :D

// local.s and local.b take their values from the thread call
// for instance, in the 'first' thread local.s = $S1 and local.b = $B1
b_control local.s local.b:

  local.b time 10 // this used to be at top of your script

  // replaced the goto with a while loop
  // you can now immediately see 
  // this block of code is being looped
  while(1)
  {
    local.s waittill trigger
    local.b loopsound lighthouse_run
    local.b moveup 352
    local.b waitmove
    local.b stoploopsound

    local.s waittill trigger
    local.b loopsound lighthouse_run
    local.b movedown 352
    local.b waitmove
    local.b stoploopsound

    // this prevents map from crashing 
    // when switch doesn't exist
    waitframe
  }
end
That's all there is really... I hope this shows you how you can make your code easier to read... e.g. do you agree with me using the above code it's easier to understand what the script actually does?

Posted: Wed Nov 17, 2004 8:53 pm
by Bjarne BZR
The key to debugging scripts is the console. Here is a short but very usedful tutorial on how to use it to detect the errors in a script: Finding script errors

Posted: Thu Nov 18, 2004 2:33 am
by HDL_CinC_Dragon
-Bjarne, I know. I always use the console. But for some reason nothing is in the console aobut my script which really puzzled me

-JV, say wha!? i dont understand most of that. let me take out the //... lines and try to see only the codes

ok, i did that... still dont get it. Do i use targetnames still for the local.b and local.s and junk like that? and what if I dont want it to just keep looping? i want it to only act on a trigger once it is triggered, go thru the thread once, then wait for the tirgger again.

Posted: Thu Nov 18, 2004 11:44 am
by jv_map
[HDL]-{Gen} Dragon wrote:-JV, say wha!? i dont understand most of that. let me take out the //... lines and try to see only the codes

ok, i did that... still dont get it. Do i use targetnames still for the local.b and local.s and junk like that? and what if I dont want it to just keep looping? i want it to only act on a trigger once it is triggered, go thru the thread once, then wait for the tirgger again.
The code I posted above does exactly the same as yours...

Posted: Thu Nov 18, 2004 2:16 pm
by Bjarne BZR
[HDL]-{Gen} Dragon wrote:-Bjarne, I know. I always use the console. But for some reason nothing is in the console aobut my script which really puzzled me
Yes, but sometimes the console can be decieving. Because it has a limit to the amount of text it can hold, so sometimes you need to use the "logfile" command (described in the link I gave) to get ALL of the console messages...

Have you tried that?

Posted: Thu Nov 18, 2004 8:20 pm
by HDL_CinC_Dragon
Bjarne - Ya i tried "logfile 1" and it didnt say anything about my script. Thats why I was wondering whats going on. I know i told Radiant the script to read. I rewrote the name of the script like 20 times in radiant Worldspawn.

I dont understand why it wont work. Didnt do anything different from the ones that do work...



JV - Ya i know but like, whats the "local." for? is that kinda telling it that its a targetname? and for the object do I still type Key: targetname Value: the_object_name ? and local. is basically like the $ ? I need answers, i might be a little slow to learn this new form, please forgive me and have patience. I bet your thinking "slow? SLOW? HES FRICKING STOPPED!" well i'll get myself back into gear soon... with your help.



P.S. What scripting language is MOHAA scripting? I was just wondering that.

Posted: Thu Nov 18, 2004 8:55 pm
by Bjarne BZR
[HDL]-{Gen} Dragon wrote:Bjarne - Ya i tried "logfile 1" and it didnt say anything about my script. Thats why I was wondering whats going on.
OK, so you dont get console errors then, thats a start :)
[HDL]-{Gen} Dragon wrote:I know i told Radiant the script to read. I
rewrote the name of the script like 20 times in radiant Worldspawn.
Ehhh.... don't do that... take that away from worldspawn. Just name the script the same as your BSP ( but ending with SCR naturally ) and put it in the same dir.
No need to say that in worldspawn. Not sure that even works or if it is a relic from the quake core of the engine.

Posted: Thu Nov 18, 2004 8:56 pm
by HDL_CinC_Dragon
oh ok... i really hope to figure this out O_O

Posted: Thu Nov 18, 2004 9:04 pm
by jv_map
Na you're not slow I'm too fast or too unclear :wink:

I'm starting with a sidenote this time... have you set developer to 1? Otherwise you won't see any script error messages in your console.

local. is definately not the same as '$' ... the '.' is used to assign variables to an object. For example you could have a variable 'myvar' which belongs to some object $myobject.. this would be $myobject.myvar in the script. Variables can be several data types (int float string vector) or refer to an object or array. For example one could set $myobject.myvar = $someotherobject . From now on, typing $myobject.myvar is the same as typing $someotherobject ; for instance you could do $myobject.myvar remove to remove the object with targetname 'someotherobject'.

Now what does this have to do with local. ? :? hmmm let's see... in fact 'local' is an object you can assign variables to. Actually it directly refers to the thread you type it in: 'local' means the current thread object. This makes it very convenient to assign variables to because they can never be mixed up with the variables belonging to other threads. A 'local.' variable only has it's value within one and the same thread.

Silly example below:

Code: Select all

thread_a:
  local.myvar = 3
  println "myvar: " local.myvar // prints 'myvar: 3'

  thread thread_b
end

thread_b:
  println "myvar: " local.myvar // prints 'myvar: NIL'
end
As you should be able to see local.myvar only has a value in thread_a.

Now there's only 1 more thing I need to explain before you might be able to understand :). For example, you may want to use local.myvar also in thread_b. So, you need a way to 'send' the value of local.myvar from thread_a to thread_b. For this, so called 'parameters' or 'arguments' can be used.

Example:

With the thread call you now supply the value of the variable:

Code: Select all

thread_a:
  local.myvar = 3
  println "myvar: " local.myvar // prints 'myvar: 3'

  thread thread_b local.myvar
end
What the game 'sees' when you do this is:

Code: Select all

// ...
thread thread_b 3
So it's probably confused now :? what to do with that 3 :?

Hence you need to tell thread_b what it should do with the incoming value. You can tell it to store the value in a new variable, belonging to thread_b ( :!: ) , like this:

Code: Select all

thread_b local.myvar_for_thread_b:
  println "myvar: " local.myvar // prints 'myvar: NIL'
  println "myvar_for_thread_b: " local.myvar_for_thread_b // prints 'myvar: 3'
end
As you can see, you can define a variable 'within' the thread name. You can now use this new variable local.myvar_for_thread_b all throughout thread_b :)

This is basically the same as what I did with the local.s and local.b thingies. The 'main:' thread starts 4 'b_control' threads, all with different values for local.s and local.b. The result is you can control four elevators (I'm assuming your code is used for elevators) with only one bit of code.

Nice huh? 8-)

Posted: Thu Nov 18, 2004 9:04 pm
by Bjarne BZR
[HDL]-{Gen} Dragon wrote:oh ok... i really hope to figure this out O_O
You will. 8-)

Posted: Thu Nov 18, 2004 9:07 pm
by HDL_CinC_Dragon
ok, im making a new map just for testing called Operation_Friggen_Script and im gunna make a simple hide/show light in the middle of a 256 x 256 room... with a rocket launcher on the side just in case the light dosnt work o_0



Wait a second... if i didnt have a sky box would that affect my script?

Posted: Thu Nov 18, 2004 9:08 pm
by Bjarne BZR
Now were talking! THATS debugging :twisted: