|
Post by guardsman111 on Aug 19, 2014 23:31:16 GMT 1
Hey, I'm sorry to have to post this, I'm sure that you will not actually find this too difficult to solve.
I'm completely stuck on scripting in some reinforcements. All I want to happen is one squad appear with the message "reinforcements have arrived" to prove that its working, but that is simply refusing to happen. I've been sat here staring at it for two whole hours, and frankly, my head hurts. There doesn't seem to be any spelling mistakes, or punctuation errors. Here's the script I'm using:
function Reinforce() LandReinforcement(0); Suicide(); end;
I've tried this too
function Reinforce() LandReinforcement(0); Suicide(); end; end;
and I'm going to be honest I've also tried more complex versions which should also have worked using the areas, but I figured if I can't even get the basic "unit appears immediately after the start of the game" then I'm not going to get it after I advance into a box.
Anyway, I've tried them all, deleted the more advance script in frustration, and still nothing is happening. The unit disappears, but doesn't re-appear even after leaving it for 1-2 minutes.
Please help me, I really can't see where I'm going wrong. (and yes, I have made sure that I've linked it to the map. It does have a mod on the map, but I tried it with all mod units and objects removed and with the mod set to none and it still won't work)
Thanks in advance, this is mind boggling to me
|
|
|
Post by keepitsimple on Aug 20, 2014 0:07:34 GMT 1
Hi Guardsman111,
This is minimum script you would have to use. Of course in the map editor you must also make reinforcement group 10. The unit(s) in this group can but don't need to have the same number. Using 0 might lead to trouble. Zero is really a number.
function Reinforcement()
LandReinforcement(10);
Suicide();
end;
function Init()
RunScript( "Reinforcement", 80000);
end;
|
|
|
Post by Major Pain on Aug 20, 2014 11:43:55 GMT 1
To further explain how this works, you must declare a script unit by Script ID, place them on the map. They are landed by the Script after the event is triggered. Zero will not work for a Script ID number. So as suggested, use a positive number. I tend to use 4 digit numbers; 1000s for Player / 2000s for AI. function Reinforcement() LandReinforcement(1001); Suicide(); end; function Init() RunScript( "Reinforcement", 80000); end; Scripting is not that difficult after you understand the way it works. I suggest downloading Calvin's Guide: www.mediafire.com/view/ay1ccr22b2cul9v/Calvin's_Blitzkrieg_Lua_Scripting_Guide.pdf
|
|
|
Post by guardsman111 on Aug 20, 2014 15:53:00 GMT 1
Okay thanks for the quick responses guys, its great to see this community is still alive I have to say that I'm really not a scripting "noob", in fact I'm not that bad at C++, but this one was completely lost on me... Secondly, ill try these both later, as I was using group 0 (as you can see) and script ID 1. I don't have a lot of time, but I will try these before I go to bed tonight if I get time Thanks again, I will get back to you on whether it worked or not
|
|