Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
I have a huge set of scripts which I changed over to detecting an object type instead of a specific unit name. So instead of saying for example 'ChinaVehicleInfernoCannon' the script uses the general term 'Artillery' which covers all long range units from all factions.

The problem is that some units are still not being recognized as Artillery even though they're a long range unit. The script to define the object type(s) contains all units from all factions so I'm at a loss as to why some units aren't detected. Has anyone else used object type in scripting? Any suggestions?
Sponsor
fleetatks
17 years ago
It's probably not that it isn't detecting the unit, but it's not detecting the unit on the Player's team.
Email me if you ever need help (edited signature November 6th, 2014)
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
So what do you suggest?

I have a copy of the object list in each AI folder along with the other scripts that pertain to this player. The object scripts deactivate upon success. This is the setting they were at in the zip folder I received from you. Should they stay active?

fleetatks
17 years ago
Yeah, have them stay active, and also clone it to switch between the two for on/off settings.
Email me if you ever need help (edited signature November 6th, 2014)
fleetatks
17 years ago
Maybe it is detecting them, its just not executing the scripts. Try something simple like display a message when it happens.
Email me if you ever need help (edited signature November 6th, 2014)
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
Thanks Fleetatks, I'll give that a try.
It would be nice to use what I already have done. I had just started remaking those scripts to list all units and it took a good twenty minutes to do one set out of 36 sets. (Even copied scripts need the location changed on each line so it takes awhile.)

As far as cloning the Object script, I'm not sure I follow you.
If it's just setting the object type wouldn't it either just set the types and then deactivate, or have the script always on for reference?
The detection scripts are always on and I can see that the Object script should probably be set to stay on as well. I'll give that a try as well as adding a message or a display of some sort for testing.
Thanks again,
Sky Demon
17 years ago
On the subject of making scripts. How the hell do you do it?
Sometimes I find myself really annoyed in the Generals worldbuilder. I have recently kinda just been messin around with scripts etc. See what's new that I can cook up! :)
Even though the "How to make scripts??" is my main concern here.

Why is it that I can transfer units to myself at game start fine, so long as I give the unit a name...
But that's like old school suckish. Two big problems I'd like you to answer if you can.
1: Why is it when I transfer a unit to myself at game start like a MissileDefender for example I get something like this is the top right corner "Special_Ability_LaserGuidedMissiles 0.00"? This also happens if I spawn an individual unit on my team (With a name).
2: Why is it so hard to just simply create a team and then spawn that team under your control!? I just can't do it....I tried! Make a team, put what I want in the team, e.g Min/Max of 6 rocket men & 2 snipers (for a bunker), put a waypoint down, script it to spawn the team I just made and then for it to instantly just after spawning transfer control of the team to (I.E Me!).
I mean the team don't even spawn, let alone under my control...Can anyone help me out here. I mean spawning teams under players controls, it should be easy :(


Thanks for even reading the post this if you read down to this :)
Get back with answers to as many of my q's as you can.
Thanks guys, and sorry to drop in questions of my own on someone elses post.
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
Hey Sky Demon, don't get frustrated. Once you figure out a few things and get them to work reliably for you, you'll come up with some new ideas.
Sky Demon
17 years ago
Yeah sorry, my bad. I forgot to mention that I ONLY run GENERALS. Your map is 4 zero-hour.
I was very tired when I typed that post and missed some stuff out.
When I was on about making scripts, I meant more the .scb files. People seem to be able to actually create there own custom scripts.
e.g Like how could I make a script like:

{Player}Spawn named unit "???????" of type "??????" under player "?????????" control at waypoint "????????"

Because I really need something like that and it's a reall pain that EA didn't make one with the Worldbuilder....
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
So you still can't play Zero Hour? I thought you had resolved that issue some time ago.

{Player}Spawn named unit "???????" of type "??????" under player "?????????" control at waypoint "????????"

You can use lines like that. The problem, as least for zero hour is that you can't spawn directly to local player. You need to spawn to a team which would be teamcivilian. AND in order to tranfer control of a unit to local player it has to be a named unit.
Here's a quick rundown of how to do it for a five tank team.

*** IF ***
True.
*** THEN ***
Enable Script 'CreateTank1'.

(CreateTank1)
*** IF ***
Unit 'Tank1' exists and is alive.
*** THEN ***
Set timer 'TimerTank2' to expire in 10.00 seconds.
Enable Script 'ActivateTank2'.
*** ELSE ***
Spawn Unit 'Tank1' of type 'AmericaTankCrusader' on Team 'teamPlyrCivilian' at waypoint Waypoint 'Spawn1'
Set timer 'TimerTank2' to expire in 10.00 seconds.
Enable Script 'ActivateTank2'.

(ActivateTank2)
*** IF ***
Timer 'TimerTank2' has expired.
*** THEN ***
Enable Script 'CreateTank2'.

*********
And so on through five tank sets.
*********
Then just tranfer these units to player with another script AND Hide the special message that come up.

*** IF ***
True.
*** THEN ***
Unit 'Tank1' is transferred to the command of Player ''
Unit 'Tank2' is transferred to the command of Player ''
Unit 'Tank3' is transferred to the command of Player ''
Unit 'Tank4' is transferred to the command of Player ''
Unit 'Tank5' is transferred to the command of Player ''
Disables special power countdown display.
******

I'm not familiar with "Generals" and its World Builder. Hopfully you can do something like this.

My main focus has been on making AI harder to beat, not giving help to local player but it was a nice change to make those scripts.
Hope you get Zero Hour working!!!!
Sky Demon
17 years ago
I am not quite sure what you are on about but I will see if spawning to still does what I want it to do (Spawn unit on my team/side) but without some rubbish countdown timers.
Why did EA put those types of things in anyways, I mean it's not like a SW or something "LaserGuided_Rockets 0.00"...?

I wanna know why you just can't spawn something to a Player...It's not like violating the laws of the game engine or something is it? lol. Should be no problems in spawning a unit to a player, so long as the player exists. Right?
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago

I am not quite sure what you are on about but I will see if spawning to still does what I want it to do (Spawn unit on my team/side) but without some rubbish countdown timers.


You're the one who jumped in to MY post/off topic as this topic is about Object types. As far as "rubbish countdown timers", you said "I can transfer units to myself at game start fine" so I assumed you wanted to bring in support later in the game. The scripts I sent to you will bring in support for any faction you're playing and replace the unit if it's taken out. Sorry that I made it for Zero Hour.

I wanna know why you just can't spawn something to a Player...It's not like violating the laws of the game engine or something is it? lol. Should be no problems in spawning a unit to a player, so long as the player exists. Right?


Hey, we all know there are limitations to the World Builder. You just need to learn to work with it.
******
You should start your own topic as this post is regarding object type.
Sky Demon
17 years ago
Okay, I know when i'm touching a nerve (Something sensitive).
I'll just drop it and maybe start up a Topic of my 0wn.

As much as I hate EA I guess I can't just flame em for not putting in enough scripts for all the things I want to do. But still, funny how a game engine permits certain things to be spawned to teams and not players.
It's also strange how whatever is scripted in a map only ever applies to the Host of the game. So anything given to a player in scripts is unfair.

Anyways->I'm gone-> 😞
Drummin
  • Drummin
  • 100% (Exalted)
  • General Topic Starter
17 years ago
Well you can make scripts for AI player if you add the AI script folders containing their basic coding to your map. In case you don't have a copy of those scripts here they are.
UserPostedImage AI_Scripts.zip 

And as talked about in topic http://www.cncgeneralsworld.com/forums/topic.asp?TOPIC_ID=9006 , I guess you can script for other human players other than host or local player but I haven't played with that yet. Good luck on your search.

EDIT!!!!!!!!
Man, I just remembered that you can't load Zero Hour.
What's up with that?
In any case, I'll leave the AI scripts for anyone else looking for (Zero Hour) AI scripts.