Obj tutorial
Moderator: Moderators
-
agentmad007
- Brigadier General
- Posts: 570
- Joined: Tue Feb 24, 2004 3:52 pm
Obj tutorial
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 .
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 .
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
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).
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).
-
agentmad007
- Brigadier General
- Posts: 570
- Joined: Tue Feb 24, 2004 3:52 pm
While loops
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.
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.
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
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
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
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 .
-
agentmad007
- Brigadier General
- Posts: 570
- Joined: Tue Feb 24, 2004 3:52 pm
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
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:agentmad007 wrote:Does that mean to win you have to achieve 4 ojectives and the allies have 0 objectives ?
Code: Select all
level.numTotalAlliedObjectives = 4
level.numCompletedAlliedObjectivesSoFar = 0-
agentmad007
- Brigadier General
- Posts: 570
- Joined: Tue Feb 24, 2004 3:52 pm
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:
instead of
when i am checking obj script there is some weird variable level.?? and i wonder where they get that .
Is it their self creation ?
Code: Select all
level.objectivestoachieveCode: Select all
level.numObjectivestoachieveIs it their self creation ?
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
You can write:agentmad007 wrote:...or can i write...
Code: Select all
level.Ihave5mONkeYsINmYPanTs = 0But for variables defined by the game, you must spell them right ( like "param.other" and "level.targets_to_destroy" ).
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.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 ?
-
agentmad007
- Brigadier General
- Posts: 570
- Joined: Tue Feb 24, 2004 3:52 pm
-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:
I have NO monkeys in my pants!
...see, ZERO monkeys!

Code: Select all
level.Ihave5mONkeYsINmYPanTs = 0-
Bjarne BZR
- Site Admin
- Posts: 3298
- Joined: Wed Feb 05, 2003 2:04 pm
- Location: Sweden
- Contact:


