Objectives for both teams in multiplayer

Post your scripting questions / solutions here

Moderator: Moderators

Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

well that one is for allies setting, you have to change it for axis setting.

you seemed to have it set up right with global\obj_dm_axis etc...

so the one above would be global\obj_dm_allied and then you can jsut reverse all the team names for the other.

Your victory conditions might require additional coding as well. Mostly you can just use self.exploded if you need to know if its gone off or not, so not much of a problem.

If bomb1.exploded = 1 <-- (is my syntax correct here? assuming bomb1 was what was sent as self of course...)

then it has been detonated.
When I am king, you will be first against the wall~
Image
User avatar
GARRAPIGNADO
Corporal
Posts: 49
Joined: Mon Aug 09, 2004 5:43 pm
Contact:

Post by GARRAPIGNADO »

The winning conditions are my other problem.

I though in what you say, but I don't know to create that variable: one called allies_boom and other axis_boom (for example) with initial value 0 and, set to 1 when explode (in the good obj_dm copy), and how to compare to set the winner (in the map scr).

And: what you recomend when time's up? Can I make win by kills (as in DM)? Or it's automatic?

Thanks :D :D
CLAN LA COMPAÑIA (ESPAÑA)
www.clanlacompania.com

Image

MAPPING SECTION ;)
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

if first bomb to blow wins....(this isnt a complete script of course)


level waitTill prespawn
thread global/exploder.scr::main

level waitTill spawn
level.clockside = kills // or draw if you want (allies, axis, kills, draw)

$axisbomb thread global/obj_dm_axis.scr::bomb_thinker
$alliesbomb thread global/obj_dm_allies.scr::bomb_thinker

thread axis_victory
thread allies_victory

axis_victory:
while ($axisbomb.exploded = 0)
{
waitframe
}
Teamwin Axis
end


allies_victory:
while ($alliesbomb.exploded = 0)
{
waitframe
}
teamwin allies
end


not positive if that will work, someone please correct me if it wont =)
$bomb.exploded should maintain its value across threads right?
When I am king, you will be first against the wall~
Image
User avatar
GARRAPIGNADO
Corporal
Posts: 49
Joined: Mon Aug 09, 2004 5:43 pm
Contact:

Post by GARRAPIGNADO »

I think it won't work because you say that: "while bomb doesn't explode, the team wins".

I think it will be better something like that (for example, to axis):

Code: Select all

axis_victory: 

if ($axisbomb.exploded = 1) 
{ 
waitframe
teamwin axis 
}

end
but, How can I set exploded to 1? It may be set to 0 at starting.
CLAN LA COMPAÑIA (ESPAÑA)
www.clanlacompania.com

Image

MAPPING SECTION ;)
User avatar
GARRAPIGNADO
Corporal
Posts: 49
Joined: Mon Aug 09, 2004 5:43 pm
Contact:

Post by GARRAPIGNADO »

Ok, forget my last post, it's wrong.

One thing: where can I find a map like I want? I would see its scripts and its globals. A map where two teams have to plant a bomb to win.

Thanks :D :D
CLAN LA COMPAÑIA (ESPAÑA)
www.clanlacompania.com

Image

MAPPING SECTION ;)
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

For conditions, use == instead of = :wink:

= -> assignment, set a variable to some value.
== -> equal, returns 1 if the values before the == and after are equal, 0 otherwise.
Image
User avatar
GARRAPIGNADO
Corporal
Posts: 49
Joined: Mon Aug 09, 2004 5:43 pm
Contact:

Post by GARRAPIGNADO »

Yes jv_map, you're all right!

So, there is another problem: When I start the map, allies win automatically at 2 seconds, jejejjejejeeje. It's too easy! :D

I only have the win conditions of Splaetos.

It will happen with axis if I change the order of the winning threads. Do I need another condition? What's wrong in those?

Thanks, I'm learning a lot!
CLAN LA COMPAÑIA (ESPAÑA)
www.clanlacompania.com

Image

MAPPING SECTION ;)
User avatar
GARRAPIGNADO
Corporal
Posts: 49
Joined: Mon Aug 09, 2004 5:43 pm
Contact:

Post by GARRAPIGNADO »

:D :D :D It worksssss :D :D :D

I found a map with this system, and I loooked its script. I copied using my targetnames, and works fine.

Here is the code:

Code: Select all

level waitTill prespawn 
thread global/exploder.scr::main 

level waitTill spawn 
level.clockside = kills // or draw if you want (allies, axis, kills, draw) 

$axisbomb thread global/axis_obj.scr::bomb_thinker 
$alliesbomb thread global/allied_obj.scr::bomb_thinker 

thread axis_victory $axisbomb
thread allies_victory $alliesbomb
end

axis_victory local.axisbomb: 
while (local.axisbomb.exploded != 1) 
{ 
waitframe 
} 
teamwin axis 
end 


allies_victory local.alliesbomb: 
while (local.alliesbomb.exploded != 1) 
{ 
waitframe 
} 
teamwin allies 
end 
Thanks all of you for your help!!!! I only needed some push, jejejeje.
CLAN LA COMPAÑIA (ESPAÑA)
www.clanlacompania.com

Image

MAPPING SECTION ;)
Splaetos
Major General
Posts: 730
Joined: Tue Jan 20, 2004 2:55 pm
Contact:

Post by Splaetos »

sorry, the = instead of == was a typo =p
When I am king, you will be first against the wall~
Image
Post Reply