The VS Mode - Wanna Help Me,Release The Demo Sooner?

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

The VS Mode - Wanna Help Me,Release The Demo Sooner?

Post by metal_head » Mon Oct 06, 2008 7:56 pm

OK,I need to accomplish one more thing and I'll release MF's demo! It's the VS mode. Now it sounds really simple - two teams,fighting each other on a small map,but it's not!

It's a lot to ask,so I don't want from you,guys to make the scripts for me,but to help me start them.

Let me start listing the things I'll need:

1-st A kill counter - I need to make a script,that will look at the two team's kills and the first team,who scores for example 20 kills,wins.If my team scores 20 first,I want the script to activate a trigger or something,that will ask me if I want to replay the level or I want to proceed to the next level (I don't even know if all that's possible).Maybe I'll need two scripts - one for my team and one for the other team. If the other team scores 20 first,the script to display a message,saying "You have been defeated" and automaticly to replay the level after 5 seconds.
Now,what I think that will be needed for this:
2 new attributes,which will be used in counting the kills. A command in the pawn's death order,that will add 1 point to one of the attributes. and the two scripts,just to watch if my team for example has scored > 19 (more than 19) kills (I think that's how it can be made in scripting) .


Unfortunately,that was just the beginning :

2-nd I'll need the pawns and the player to respawn into random spawn points. <-- for that I just don't have an idea how to make it..for the pawns maybe a command in the death order,but for the player...man I have no Idea.

3-rd That's Hard too - Adding 2 more abilities to the perfectai script. In the VS mode,when spawned,the pawns start walking,using script points,I want to make the pawns follow the script points into water pools or ladders,but they can't climb or swim. Is it possible to make a pawn climb a ladder or swim?

Help me with this,that you know the answer to,now necessary to answer all the questions :)

dylanwinn
Posts: 84
Joined: Wed Mar 05, 2008 6:15 am

Re: The VS Mode - Wanna Help Me,Release The Demo Sooner?

Post by dylanwinn » Fri Oct 10, 2008 6:40 pm

Are you making this in some special build of RF? I know for a fact that multiplayer doesn't work at all in the official realese...

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: The VS Mode - Wanna Help Me,Release The Demo Sooner?

Post by metal_head » Fri Oct 10, 2008 7:24 pm

It's not a multiplayer,the VS mode is instead of multiplayer.I want whoever plays my game to have the illusion that he's battling real people,though he will know,that they are only AIs.But I really have no clue for how to do all theese,if I manage to make theese features,the demo will be released!

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: The VS Mode - Wanna Help Me,Release The Demo Sooner?

Post by Juutis » Thu Oct 16, 2008 9:51 pm

metal_head wrote:1-st A kill counter - I need to make a script,that will look at the two team's kills and the first team,who scores for example 20 kills,wins.If my team scores 20 first,I want the script to activate a trigger or something,that will ask me if I want to replay the level or I want to proceed to the next level (I don't even know if all that's possible).Maybe I'll need two scripts - one for my team and one for the other team. If the other team scores 20 first,the script to display a message,saying "You have been defeated" and automaticly to replay the level after 5 seconds.
Now,what I think that will be needed for this:
2 new attributes,which will be used in counting the kills. A command in the pawn's death order,that will add 1 point to one of the attributes. and the two scripts,just to watch if my team for example has scored > 19 (more than 19) kills (I think that's how it can be made in scripting)
Fairly simple:

Code: Select all

{

Spawn[ ()
{
     LowLevel("run");
}

run[ ()
{
     if(GetAttribute("points_team1","Player") >= 20)
     {
          SetEventState("victory",true);
          HighLevel("End");
     }

     if(GetAttribute("points_team2","Player") >= 20)
     {
          SetEventState("defeat",true);
          HighLevel("Wait");
     }
} ]

Wait[ ()
{
     Delay("",5,"");
     SetEventState("restartlevel",true);
     Remove(true);
} ]

End[ ()
{
     Remove(true);
} ]

}
You can use a Message entity to show the texts on the screen and ChangeLevel entity to restart or change the level. For the part where it asks the player whether he wants to replay the level or go to the next, you could probably use a pawn conversation.
Continue -> activate the trigger for the ChangeLevel that changes the level.
Replay -> activate the trigger for the ChangeLevel that restarts the level.



I'll try to answer the rest later.
Pain is only psychological.

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: The VS Mode - Wanna Help Me,Release The Demo Sooner?

Post by metal_head » Thu Oct 16, 2008 10:16 pm

Really,Really thanks for the answer! You are right,it is simple,I don't know how I haven't though of that. Anyway,I've just started to learn the structure of programming in school,so I hope I'll get better.

I want to ask if there's a way for the game to show 2 buttons on the screen after one of the teams win.I haven't dealed with buttons yet,so...don't write the script for me,only if you could help me get along with the manual,I'm sure it's all explained there,but I just don't know where to look.Soo,back to the two buttons.If my team wins - 2 buttons on the screen
1 - Restart Level
2 - Proceed!

the restart button will restart the level,ok I know how to cause a level restart (I think),but I don't know how to make the button.
And the second button to activate the level change entity for the next level. That I also can do,but the button is the hard part :D.
I'll try to answer the rest later.
well,you don't have to if you have a lot of work,I also know what a game you are making and I'm sure it takes a lot of time.Funny,but you created a big part of Metal Force too along with your game,and this will be credited very well!

User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Re: The VS Mode - Wanna Help Me,Release The Demo Sooner?

Post by Juutis » Wed Oct 22, 2008 2:19 pm

metal_head wrote:I want to ask if there's a way for the game to show 2 buttons on the screen after one of the teams win.I haven't dealed with buttons yet,so...don't write the script for me,only if you could help me get along with the manual,I'm sure it's all explained there,but I just don't know where to look.Soo,back to the two buttons.If my team wins - 2 buttons on the screen
1 - Restart Level
2 - Proceed!
There's no easy way of doing this. Basically you have to draw the buttons manually [ DrawFlipBookImage() ], check if the mouse is on top of a button [ GetMousePosX(), GetMousePosY() ], check if the mouse is clicked [ self.lbutton_pressed ] and then activate the correct trigger [ SetEventState() ].
Pain is only psychological.

User avatar
metal_head
Posts: 1244
Joined: Sat Jan 05, 2008 8:31 pm
Location: Bulgaria,Sofia
Contact:

Re: The VS Mode - Wanna Help Me,Release The Demo Sooner?

Post by metal_head » Wed Oct 22, 2008 6:58 pm

Sounds Really Hard,but I'll have to do it if I want,I'll start working and post my not-working script to elp me fix the mistakes I'll have made :D

Post Reply