Jump to content


Photo

Some Scripting Problems


  • Please log in to reply
7 replies to this topic

#1 AdmiralGT

AdmiralGT

    title available

  • Members
  • 1,702 posts
  • Location:Bristol, UK
  • Projects:Petrolution

Posted 24 May 2004 - 12:06 AM

Hi,

First of all, for those wondering about my Nuke Question, i managed to fix it with some help from spyVspy at the CNC Den forums. Hopefully the map should be available for download in a few days.

Firstly i'll outline what im trying to achieve. I'm trying to create a King of the Hill Style Map where Players 1 & 2 start on the Hill with players 3-8 around it. In the Middle of the Hill is a Bunker which can be garrisoned and is Labelled "Bunker". When a troop from either Player 1 or 2 enters the Bunker i want a 30 minute counter to start. Then, if the counter reaches zero, Team 1 (Players 1 & 2) win and Team 2 (3-8) are destroyed. If the Bunker is Destroyed I want Team 2 to win and Team 1 Destroyed.
Other small things i want included are for Team 1 to be alerted by a radar message when the Bunker is under attack and a small 5 second message when the Bunker is destroyed.

Unfortunately, my scripting skills at present are not good enough to accomplish this goal and i seek some help to get it working. I've included the Scripts i've made so far and the only object i've placed on the map is the Garrisonable Guard Tower which is labelled "Bunker". If anybody can help me i'd greatly appreciate it.

AdmiralGT

Attached Files



#2 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 24 May 2004 - 07:12 AM

**IF
Player <Player1> has entered a building named <your guard tower>
**OR
Player <Player2> has entered a building named <your guard tower>

**THEN
Timer <timer name> set to expire in 1800.00 seconds.


**IF
Timer <timer name> has expired

**THEN

All of Player <Player 2, or Team 2>'s buildings and units are dealt a lethal amount of damage.
Show Victorious window and end game (assuming that the human player is team 1)

**IF
Unit <guard tower> has been destroyed

**THEN
Show Defeated window and end game (assuming team 2 is a computer)


That's about it...
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#3 AdmiralGT

AdmiralGT

    title available

  • Members
  • 1,702 posts
  • Location:Bristol, UK
  • Projects:Petrolution

Posted 24 May 2004 - 11:44 AM

Thanks for the reply, I forgot to mention that Team 2 could consist of Human Players (This was the main idea) but also consist of Comp AI if needed.

Secondly, when i put "<Player1>" and "<Player2>" in the enter the build lines it comes up with [???] at the start of the line. I'm assuming this isnt a good thing since I havent seen any other scripts with this ? sign. How do I make it so that the person in position 1 is Player 1 and the person in Position 2 is Player 2 and form Team 1 and then those in 3-8 collectively become Team 2?

Sorry for what may seem really simple questions but this is my first attempt at some scripting.

AdmiralGT

#4 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 25 May 2004 - 11:24 AM

You first have to change the player list, use the "Add Skirmish Players" button to add the basic players. This has to be something like a skirmish map since you want either humans or AI players to select their locations.

Once you have added the skirmish players you should be able to select the players from pop up lists. Use <This Player>, it refers to the player which's folder this script is in. Note that <This Player> does not refer to human players... first try this and see if it works and then try making one script with the same logic to refer to the <Local Player>.
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#5 AdmiralGT

AdmiralGT

    title available

  • Members
  • 1,702 posts
  • Location:Bristol, UK
  • Projects:Petrolution

Posted 27 May 2004 - 04:46 PM

Ok, thanks for help, still cant get it to work so im gonna work on some sort of workaround for it.

However, i've now encountered another problem.
My friend has this idea for a mod whereby the more area of land you "own" then the more cash you make. Now i cant think of any way to define "owning of land" in generals so what i proposed was that the more land you had stepped through the more money you make. Then, by creating Derricks (or similar objects) off the map, and areas in the map then you could grant the player the derrick when they stepped into the area. and when the other player stepped into the area they got the derrick from them.
So to test this i made a very quick 1v1 map. Two start locations, 2 Areas (Area 1 & Area 2) and 2 Derricks (D1 and D2). I then created 2 scripts in PlyrCivilian.

***IF***
Player '<Local Player>' has units in area 'Area 1'.
*** THEN ***
Unit 'D1' is transferred to the command of Player '<Local Player>'

and

***IF***
Player '<Local Player>' has units in area 'Area 2'.
*** THEN ***
Unit 'D2' is transferred to the command of Player '<Local Player>'

I tried this on my own and it worked fine. It granted me the derricks. I then tried this with a friend and it kept mismatching. When i entered Area 2, i saw my derrick go Pink but when he entered his it stayed White. He tells me that his went Purple when he entered Area 1 and mine stayed White. I checked his version of the map and he has all the scripts and stuff so i cant think whats wrong.
Anyone with any ideas on why this is Mismatching and how to prevent it or fix my problem or have any idea how to get my friends mod idea to work then please post them here.

Thnx

GT

#6 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 28 May 2004 - 08:43 AM

Quoting from RVMECH:

Normally modifying anything for the human player that involves scoring in anyway with a script will or can cause a mismatch.


There must be a way around this though. Try putting it into the neutral folder even though this is a bit desparate but it's worth the try..
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ

#7 AdmiralGT

AdmiralGT

    title available

  • Members
  • 1,702 posts
  • Location:Bristol, UK
  • Projects:Petrolution

Posted 28 May 2004 - 12:48 PM

Nope, tried putting it in the (neutral) folder and all it does it completely stop the script from working. You enter the area and it the Derrick still remains neutral. Also, setting the Derrick to (neutral) means it doesnt produce money.
Thanks for the suggestion, if anyone has any more i'd be glad to hear it.

GT

#8 Mithril

Mithril

    496

  • Hosted
  • 1,386 posts
  • Location:UK
  • Projects:Heh! You're not going to ask me that question.

Posted 03 June 2004 - 01:37 PM

Hmm then you'll have to find a way to stop the player from getting the score. Maybe by removing the STRUCTURE kindof, though nasty things are possibly associated with that..
Command & Conquer: Red Alert - ReGeneration

"Not the faintest clue =\"

-ComradeJ




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users