Jump to content

timmiej93

Members
  • Posts

    207
  • Joined

  • Last visited

Everything posted by timmiej93

  1. Hey guys, So I've made some changes to the FireStation script from the LA Mod, and for some reason my alarms just keep running, and I still haven't found why it keeps happening. I hope somebody here can help me, because I'm really flabbergasted. (PS. Posted here and not in the LA Mod section because I believe this is more modding related then specifically LA Mod related) Now there are a few changes you should know about: - I added a police station that works like a fire station. This SHOULD have the alarm sound, but DOESN'T have the special flashing light. - I added a tech station that works kinda like a fire station. This SHOULDN'T have the alarm sound, and DOESN'T have the special flashing light. - The Dummy itself DOES get removed (I can click the alarm button on the CP again) after the set time (about 14 secs), but the alarm keeps running. - I added a System::Log("Message"); bit to the code in DummyDisableAlarm. I did this because my game kept freezing at he moment the alarms should end. Now my game doesn't freeze, but I do have 3 log statements, saying "!No station at all!", which is the text it should display when it can't find it's caller. - Long story short: The problem is I can't figure out why the caller suddenly can't get defined for any of the stations. I hope I didn't confuse you guys too much. If you have any questions, let me know below, I'll respond asap. Any hep is appreciated.
  2. Well actually, I went a bit further then that, I created a new command for it, and added it to the controlpanel at the techstation. I added these commands to a bit of script that is WIP, so I haven't included the top section, but everything is characterized(?). As I said, I have a loose fire station gate to test if the script works, which is gate 3e. This has no VO to block it, since it's just a test gate. Maybe you can test the gates for yourself, if they can be moved manually, I really can't get them to work unfortunately. Here's the entire script that's about the gates:
  3. If I may ask Hoppah, what does the GroupID do? I've also seen DummyGroups with a number behind them, but I haven't been able to figure out what they do
  4. Hey guys, So I'm trying to control a gate that comes with the game (stated below), as if it is a fire station gate. So I'd have a button on a controlpanel to open the gate and one to close it. The current setup I have is: 2 of these gates, 1 fire station gate, for testing purposes. I've got the script pretty much done, and the fire station gate works, but the Industry gate refuses to do anything. The industry gate btw is one of those gates that work when you place a trigger over it, and give both the trigger and the gate the same name. mod:Prototype/Objects/Fences/industryfence03 Industry Fence 03 Animated for(int i=0; i < gate01e.GetNumObjects(); i++){ GameObject *gate = gate01e.GetObject(i); Actor *vogate = vogate01e.GetActor(i); if (gate->GetUserData() == 0) { gate->SetUserData(1); gate->SetAnimation(ANI_OPEN); vogate->SetVirtualObjectTerrain(VOSET_ROAD); }}I believe it has something to do with this piece of code, especially the FOR statement. I think this statement never returns a true value. I've tested it with a Mission::PlayHint and a System::Log right behind the GameObject *gate statement, but those never showed up, not ingame, not in the log. Does anyone know why this could be happening and how I can solve this? I'd love to be able to control the gates.
  5. It looks a bit funny, because we tilted the gates 'upright', but it works, thanks Hoppah!
  6. I'm not quite sure what you're getting at Hoppah, but I guess you think I want to use it in the same way as the ACTOR's? I was only curious if there is such a variety of ROLE's and BEHAVIOR's as well. I was asking this because I want to spawn vehicles, and make them act like normal civilian vehicles. PS. Love your signature Hoppah, it brings a smile to my face every time
  7. Once I've got my TechStation script running I'll post a small tutorial, just keep an eye on this topic.
  8. Thanks mate! About the script, I have got it working. Check my previous post in this topic for the sollution. I do have another problem now. I'm trying to spawn civil cars inside the tech station (to replace the wrecks) and make them drive off like regular cars. Anyone got an idea how to do this?
  9. Thank you sir! PS. Do you have a similar list for ROLE and BEHAVIOR? Or a source? That would help a lot.
  10. Hey guys, I've come across this a few times now, and I was just wondering what kind of actors there are available. For instance, when using below piece of code, it uses ACTOR_VEHICLE, to check if a vehicle is inside that VO. Game::CollectObstaclesOnVirtualObject(VO_FRONT01, l3, ACTOR_VEHICLE); I can imagine there being a similar actor for persons, being ACTOR_PERSON. But what other actors are there? Is there something like ACTOR_OBJECT or anything like that? I would need that one at the moment, to check if a VO is being occupied by an object. So if anyone could list (or direct me to a list) the actors available? Thanks,Tim
  11. Thank you ItchBoy, very helpful. Now I've been trying all kinds of things, and it's starting to work. The problem I'm facing right now, is the wrecked car and new rollback are spawning immediately when I click the ToTechStation button. Scripted like this atm: v.PushActionMove(ACTION_NEWLIST, Park); v.PushActionTurnTo(ACTION_APPEND, Turnto); v.PushActionWait(ACTION_APPEND, 1.0f); v.PushActionDeleteOwner(ACTION_APPEND); Vehicle m = Game::CreateVehicle(OBJ_ROLLBACK, "Unnamed"); m.EnableBlueLights(false); m.SetPosition(Park); m.SetRotation(gate6); m.UpdatePlacement(); m.SetMaxPassengers(1); m.SetSpeed(8.0f); m.PushActionWait(ACTION_APPEND, 5.0f); int RandomWreck = Math::rand()%MAX_POOL; GameObject w = Game::CreateObject(WreckPool[RandomWreck], "Unnamed"); w.SetPosition(Dropoff); w.SetRotation(gate6); Anyone got any ideas? Tim PS. I know why it's happening, I just don't know how to prevent it. Could it be possible to re-use the v. caller, instead of using the m.? ---------------------------------- So, the sollution:
  12. So thinking about everything, I've decided to replace the unload action with a (replace loaded rollback for empty) script, and then have something like 5 to 10 wrecked vehicles that spawn in the VO randomly. The only problem is that I don't have any experience with randomness in scripting, and I haven't seen any examples of it.. Does anyone know an example of howto create randomness in a script?
  13. So what you're implying would be something like this: - Adding something like below to the move script: (Not sure if it would work though, since move might only be affected on clicking, and not when it has been driving for a while.) if (Vehicle collides with gate VO) { Call command X } And then just make script X that opens the gate? PS. I thought the US Army mod is pretty much freeplay into campaign? As far as I've seen, it's pretty much that, and it's quite awesome. Too bad of the many ambushes though. ------------ Well the gates not opening is definitely up to the gates themselves.. Added a firestation gate next to it, included it into the script, and that one worked. Time to find an alternative then, unfortunately.. Could anyone check if this gate can be opened and closed like the fire station gates? LA Mod mod:Prototype/Objects/Fences/industryfence03 Industry Fence 03 Animated If not, does anyone know of a good looking animated gate that can be moved like the firestation gates??
  14. That's a good point, and I'm afraid you're right. Thanks for taking the time to answer anyways.
  15. Hey guys, Just a little thing that has been bugging me, not just on this forum, but on pretty much every forum out there. I do understand why there's a rule against double posting, it can be annoying and it can be abused. But there's a problem with editing your last post: Nobody will know you edited it, until they open the actual topic. No notification, no fat text on the Subforum page, nothing. This can seriously impair the amount of help you can get, since people could think: I've read that, it said he got it working. But what if the post is edited 24 hrs later, saying another error popped up, with the same cause. Almost nobody will know, since they don't get notified. I know I'm not the person to say much about it, but I think it'd be a great addition to the forum if editing a post would mark a topic as unread as well, or something along that line. In my opinion it would help a lot. I'd love to hear your opinions about this. Tim PS. I'm sorry if this is not the right place for such a post, it seemed the most fitting to me.
  16. Bullocks.. Just typed a lengthy answer, wifi drops and tapatalk refuses to post. I'll from a PC tomorrow.. -------------- Alright, let's try again. I'll definitely have a look at the US Army mod, see if that's of any help for me, thanks for the tip. It is indeed freeplay, yes. Unfortunately, I never played the original freeplay map, only modded ones, so I'm not quite familiar with it, and not quite sure which garage doors you mean. I've probably been doing something weird if it's that easy, because it just won't work. I've copied parts of your VcmdOpenGates (and close) scripts, and changed them so they should work for me, but the FOR parameter or whatever it's called, never get's caled. It's something like this: for(i = 0; i < gate->GetNumObjects; i++); If I'm able to read this correct, this states that there is in fact no gate? ---------------- So I've just tested the FOR parameter, like this: for(int i=0; i < gate01.GetNumObjects(); i++) { System::Log("gate01"); Mission::PlayHint("gate01"); }Entire script: And just like I thought, the log file is clear. I used the following gate: LA Mod mod:Prototype/Objects/Fences/industryfence03 Industry Fence 03 Animated Could this particular gate be causing this? ---------------------- PS. I've checked the US army mod script, but that's a bit above me I'm afraid. I get how the below script works, but when trying to integrate it into my own script, it just does nothing. I think it has something to do with the parameter "Trigger", it's like the game doesn't know what it is when I'm playing the LA Mod (which I'm modding for), and when looking in the missionscript from the US Army mod, it doesn't look like it gets defined somewhere void OnTrigger(const char *Trigger, Actor *Collider) { switch(Trigger) { case "gate" : { if (Collider->GetType() == ACTOR_PERSON || Collider->GetType() == ACTOR_VEHICLE) { if (mBarrier.IsValid() && !mBarrier.IsCurrentAnimation("open")) { if (Collider->GetType() == ACTOR_VEHICLE) Vehicle v(Collider); if (Collider->GetType() == ACTOR_PERSON) Person v(Collider); if(v.IsCurrentAction("EActionMove") || v.IsCurrentAction("EActionFindPath")) mBarrier.SetAnimation("open"); mBarrier.PushActionWait(ACTION_NEWLIST, 10.f); mBarrier.PushActionSwitchAnim(ACTION_APPEND, "close"); } } } break;
  17. Hey guys, I'm trying to create a script that constantly checks if a vehicle is inside a VO, so it can open a gate. I know what you're thinking, why not just use a trigger? I tried that, but there were a few flaws with it: - Vehicles just drove straight through the gate - The "open" animation often wasn't even finished before it started the 'close' animation, resulting in a weird jump in the fence - The gates not opening at all sometimes. Other reasons why I want to use a script for these gates are: - Opening times, automatically "unlock" the gates after 7am and lock them after 5pm. - Being able to push a button on a controlpanel to open or close the gate - Nicer opening and closing settings - Bonus: Scripting experience for me. So if anyone understands what I'm trying to achieve, I could definitely use your help, I'm willing to test everything. Tim
  18. Aha, I got it. I added a simple logwrite saying "Not a firestation" like below, and indeed, two cases occur in the log and the game doesn't crash. Now I've gotta find out what is calling the Dummy then if(Caller->HasName(NAME_CONTROLPANEL) || Caller->HasName(NAME_FIRESTATION)) //= fire station 1 GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION); else if(Caller->HasName(NAME_CONTROLPANEL2) || Caller->HasName(NAME_FIRESTATION2)) //= fire station 2 GameObjectList l1 = Game::GetGameObjects(NAME_FIRESTATION2); else System::Log("not a firestation"); return;-------------------- Alright, a small edit here: I commented out the parts I thought that were causing the problem, but the log still shows two lines saying not a firestation. I guess there isn't a method to identify the callers name right? So instead of Caller->HasName, something like Caller->FindName ? -------------------- Was cheering too early again.. Now that has been fixed, the game starts freezing after a few seconds again. This time though, I've been able to narrow it down to something very strange. The problem seems to be the spawning of engineers. When I disable the engineers spawning on startup, the techvans spawn perfectly, and everything works like it should. I also tried making the engineers pawn from a different VO, the same one where the battalion chief spawns from. Now, all 6 engineers spawn like they should and nothing seems wrong... Could it be that I'm using names in the editor or in the script that aren't according to the "rules" that the game uses? The VO is called "TT_spawn", in the script it's referred to as "VO_SPAWN_TT". Could this be the cause? Or a wrong setting for the VO? Or maybe a problem with the building-model? (The spawn VO is inside an open building, just like the Fire Station.) ---------------------- So, after placing the VO outside of the building, the engineers happily spawn.. does anyone have a clue why they refuse to spawn inside? PS. somewhere there's a big problem in this model or something, since I changed the code, so when l1 (the spawn vo) wouldn't fit the criteria, it should draw an error, but that error never showed up. Not ingame, not in the log. else if(v.IsCollidingWithVirtualObject(VO_SQUAD01_TT)) { ActorList l1 = Game::GetActors(VO_SPAWN_TT); if(l1.GetNumActors() > 0) { Vector Spawn = l1.GetActor(0)->GetPosition(); } else { Mission::PlayHint("Spawning problems"); System::Log("Spawning problems"); return; } }
  19. This is getting weirder by the minute. Thanks for explaining everything guys, I appreciate the patience you have with me. I'll check everything again tomorrow's night, and I'll let you know
  20. Nope, both controlpanels are still there, unfortunately. I wish it was that simple. Also ran checks on the names of the firestations, those weren't it either.
  21. No I didn't edit it in that way, only added things. But still. The point it's referring to is an l1. If that didn't exist, an error should occur with l1 isn't greater then zero, since those all start with if(l1>0), simply put
  22. Yes I did, but in which way could that conflict with this script?
  23. I edited one, and when I take that one out, it indeed works like normal.. It's just 700 lines, just got a good read ahead of me . Too bad it seems like there's nothing wrong with it ------ Now this is seriously getting strange... I narrowed the errors down to LAFireStation and LAFireStationStart, but they just don't make sense... I've put the default LAFireStation script back, moved my edited version out of the folder, and left my edited version of LAFireStationStart in it. When running the game, after about 15 seconds, I get this error: ?(_LAFireStation8b572): Error: Symbol l1 is not defined in current scope ?(_LAFireStation8b572): FILE:mod:/scripts/game/command/LAFireStation.script8b572 LINE:1293?(_LAFireStation8b572): Error: Failed to evaluate l1.GetNumObjects()?(_LAFireStation8b572): Possible candidates are...?(_LAFireStation8b572): filename line:size busy function type and name ?(_LAFireStation8b572): ?(_LAFireStation8b572): !!!Dictionary position rewound... ?(_LAFireStation8b572): !!!Error recovered!!!?(_LAFireStation8b572): Error: Symbol l1 is not defined in current scope ?(_LAFireStation8b572): FILE:mod:/scripts/game/command/LAFireStation.script8b572 LINE:1293?(_LAFireStation8b572): Error: Failed to evaluate l1.GetNumObjects()?(_LAFireStation8b572): Possible candidates are...?(_LAFireStation8b572): filename line:size busy function type and name ?(_LAFireStation8b572): ?(_LAFireStation8b572): !!!Dictionary position rewound... ?(_LAFireStation8b572): !!!Error recovered!!!This refers to the default, unedited LAFireStation script, so I'm completely baffled why this is happening.. Any ideas about what's happening?
  24. Hey guys, So my game suddenly started freezing up just a few seconds after the freeplay game is loaded. No biggy you'd say, just check the log. But there is just no error reported, the game just quits.. How strange is that? Does anyone know more about this?
  25. This one I found out myself. A real stupid, stupid, stupid mistake: I had placed an old version of the same script in the commands folder to edit later on, but I forgot about it, so it kept jamming everything. Tip for everyone who's script doesn't seem to do anything: Remove all other scripts (except for those you can't do without) and check if the problem is still there. Then slowly add scripts back untill the problem arises again, then you'll know what script causes the problem. Also, check the last edited date, the files lasts edited in 2009 or something obviously can't do you any harm since those are the original files.
×
×
  • Create New...