Page 1 of 1

Obj tutorial

Posted: Thu Nov 11, 2004 11:00 pm
by agentmad007
Hi all ,

Does anyone has a Tutorial , that show how make serveral objectives in a map ( 4 ) and also a tuts for custom objectives (not bomb diffusing or document stealing) .

I have no idea how to set an objectives achieved if the allies team has actived the switch for example .

Also what should be the level.gametype for such a map ?

thanks a lot .

Posted: Fri Nov 12, 2004 12:39 am
by Bjarne BZR
Well, I have the Combining different objectives tutotial, but as it has documents and bombs in it... maby you arent interested ;)

But if you want switches: you could take a look at the AA Liberation tutoial, its objectives are controlled by switches.

And the level.gametype would probably be 4 (objective).

Posted: Fri Nov 12, 2004 1:34 am
by agentmad007
Thx bjarne i ll take a look .

I will probably try to combine documents and switches ....

While loops

Posted: Fri Nov 12, 2004 1:56 am
by tltrude
The easiest way is to use while loops like this.

allies_win_checker:

while (level.objective_1 != 1)
wait .1
while (level.objective_2 != 1)
wait .1
while (level.objective_3 != 1)
wait .1
while (level.objective_4 != 1)
wait .1

teamwin allies
end

"!=" is the same as "does not equal". So when the variables are all equal to "1", the allies will win.

Posted: Fri Nov 12, 2004 9:05 am
by Grassy
But that would be sequential wouldn't it Trude?

Wouldn't it be better to do something like this, so is not sequential.

level.numobjectives = 4
level.allies_obj = 0

At each obj trigger in script if bomb or task is complete
level.allies_obj++
thread check_endmatch

check_endmatch:
if (level.allies_obj == level.numobjectives)
teamwin allies
end

Posted: Fri Nov 12, 2004 9:14 am
by Bjarne BZR
Yes, that looks good. Toms version could be used for a progression style objective where the objectives should be completed in order.

Posted: Fri Nov 12, 2004 12:55 pm
by bdbodger
Well no toms way just means when the first one is done it looks at the second one and that one may already be done . Same for the rest the point being the allies win when all are done even if the first one on the list is done last . What ever way you do it the main thing is teamwin allies or teamwin axis . When the script executes either one of those the round is over any scripting method you use to get to that point will do . Most of the time you see people changeing the obj_dm.scr instead of comeing up with thier own scripts which is fine but even that script just sets a couple of bombs as haveing gone off and or setting level.objects_destroyed one number higher . It does take care of some other things like executeing the exploder.scr etc but there is no reason you can't make you own scripts and set the conditions to make the teamwins execute with a little thought and carefull scripting .

Posted: Fri Nov 12, 2004 7:30 pm
by agentmad007
level.numobjectives = 4
level.allies_obj = 0

does that mean to win you have to achieve 4 ojectives and the allies have 0 objectives ?

i am new to obj script , and i was not that good before with easy script though .....

thx for your answers :D

Posted: Fri Nov 12, 2004 7:52 pm
by Bjarne BZR
agentmad007 wrote:Does that mean to win you have to achieve 4 ojectives and the allies have 0 objectives ?
Well, if you create the script, it can mean anything you want it to. But if I write it like this, the functionality Grassy ment will be a bit more aparent:

Code: Select all

level.numTotalAlliedObjectives = 4
level.numCompletedAlliedObjectivesSoFar = 0

Posted: Fri Nov 12, 2004 8:38 pm
by agentmad007
ok i see , again a question is that level.num can a game variable that have to stay as it is ...or can i write:

Code: Select all

 level.objectivestoachieve
instead of

Code: Select all

level.numObjectivestoachieve
when i am checking obj script there is some weird variable level.?? and i wonder where they get that .

Is it their self creation ?

Posted: Fri Nov 12, 2004 8:58 pm
by Bjarne BZR
agentmad007 wrote:...or can i write...
You can write:

Code: Select all

level.Ihave5mONkeYsINmYPanTs = 0
...if you want to, for variables you create yourself that is.

But for variables defined by the game, you must spell them right ( like "param.other" and "level.targets_to_destroy" ).
agentmad007 wrote:when i am checking obj script there is some weird variable level.?? and i wonder where they get that .

Is it their self creation ?
level is an object that keeps its state over the level ( until the match is complete ). local is an object that keeps its state untill the method reaches its end.

Posted: Fri Nov 12, 2004 10:27 pm
by agentmad007
okay thx lol and sorry for the syntax above , i writed my sentence to quick .

What the hell with your monkeys on the pants Lmao .....but i understood .

thank you

Posted: Sun Nov 14, 2004 3:59 am
by Bjarne BZR
I have NO monkeys in my pants!

Code: Select all

level.Ihave5mONkeYsINmYPanTs = 0
...see, ZERO monkeys!

:D

Posted: Sun Nov 14, 2004 6:01 am
by lizardkid
Bjarne, how old r u? :lol:

(is spamming he knows)

Posted: Sun Nov 14, 2004 1:46 pm
by Bjarne BZR
I'm 33 monkey-years old.