Scripting "chronology"


(Erik-Ftn) #1

I have a question regarding the scriptlanguage and its relation to ingame events.

What I really would like is a fairly detailed and technical description of how the script sequential execution works, what interrupts what etc. I’d also like such a description in relation to enteties/ the map/ bsp/ ingame development.

example in misch-mash pseudocode

routine1

function1_1
alertentity A
wait 5000
trigger self function1_1

function1_2
wait 2000

function1_3
wait 1000

routine2

function2_1
trigger function1_2

function2_2
wait 2000


Example questions:

function1_1
Can I do loops like this and then leave the loops by triggering function1_2, I don’t get it to work, ET freezes.

comment: If this does freeze ET then the scripting calls external functions somewhere and they run there and can be interrupted there, even if the script function itself is on wait…yes that seems in line with ingame results…

this would mean that calling eg function1_2, interrupting 1_1 would allow an immediate new call of 1_1 after 1_2 has ended, only calling 1_1 when 1_1 is on wait is inhibited…

function1_2
If I call this from function2_1, I reckon execution returns to function2_1 afterwards.

Q
Does a wait in f2_1 affect the return time to f2_1?
If function1_3 is called during such a wait, is return to 2_1 cancelled?
What happens if function2_2 is called during the execution of function1_2. Will the return from 1_2 cancel function2_2?

etc etc

(These were example questions, the question is about the sequential/ interrupt schema.)

Making a testmap and testing every command and twist, effectively researching the language in detail is (not really) of course an option. :bored: :frowning:

I have no prob. w basic script_movers, splines, triggering btw entities & scripts, building scripted multiple condition triggers, …

A paper&pen schematic over this would be very welcome.

Erik


(SCDS_reyalP) #2

Assuming you know C, you can probably learn these things by looking at the RTCW game source (which you can get from RTCWfiles and other sites). The basic scripting mechanism doesn’t seem to have changed much.

Of maybe you will get lucky and someone from splash will give us a detailed explaination.


(Erik-Ftn) #3

Ok, maybe I should clarify one thing… with “detailed” I mean anything more than what’s in the “Enemy Territory :: Level Designers Reference”, seriously.

Like a basic schema of how its supposed to work.

eg when a function calls a function which calls a function in the first routine… do they stack the adresses or interrupt etc.

eh the reason why I’m asking is that I’m not as a good programmer is I want to be, I know more busswords than have actual coding experience, above BASIC, the equivalent knowledge of one undergrad Pascal course and some basic assembler on my C64 in the good old days.

cheers

Erik


(chavo_one) #4

I think answers to these questions would help us all. I came into scripting with the assumption that it behaved like a proper language, with functions returning to their calling function after execution.

However, when you try to do complex function call algorithms, it doesn’t seem to behave that way in all cases. And then there’s the whole business with resetscript (which still confuses me).


(digibob) #5

http://www.splashdamage.com/forums/viewtopic.php?t=4476&highlight=

I think everything i said in that thread should cover this.